Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
088b981e
Commit
088b981e
authored
Mar 25, 2014
by
Kentoku SHIBA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bg mrr crash
parent
3a931cdc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
26 deletions
+67
-26
storage/spider/ha_spider.cc
storage/spider/ha_spider.cc
+60
-22
storage/spider/ha_spider.h
storage/spider/ha_spider.h
+3
-0
storage/spider/spd_db_conn.cc
storage/spider/spd_db_conn.cc
+4
-4
No files found.
storage/spider/ha_spider.cc
View file @
088b981e
...
@@ -3832,6 +3832,7 @@ int ha_spider::read_range_first_internal(
...
@@ -3832,6 +3832,7 @@ int ha_spider::read_range_first_internal(
result_list
.
limit_num
=
result_list
.
limit_num
=
result_list
.
internal_limit
>=
result_list
.
split_read
?
result_list
.
internal_limit
>=
result_list
.
split_read
?
result_list
.
split_read
:
result_list
.
internal_limit
;
result_list
.
split_read
:
result_list
.
internal_limit
;
DBUG_PRINT
(
"info"
,(
"spider limit_num=%lld"
,
result_list
.
limit_num
));
if
(
if
(
(
error_num
=
spider_db_append_key_where
(
(
error_num
=
spider_db_append_key_where
(
start_key
,
eq_range
?
NULL
:
end_key
,
this
))
start_key
,
eq_range
?
NULL
:
end_key
,
this
))
...
@@ -4264,28 +4265,6 @@ int ha_spider::multi_range_read_init(
...
@@ -4264,28 +4265,6 @@ int ha_spider::multi_range_read_init(
)
)
);
);
}
}
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100000
int
ha_spider
::
multi_range_read_next
(
range_id_t
*
range_info
)
#else
int
ha_spider
::
multi_range_read_next
(
char
**
range_info
)
#endif
{
int
error_num
;
DBUG_ENTER
(
"ha_spider::multi_range_read_next"
);
DBUG_PRINT
(
"info"
,(
"spider this=%p"
,
this
));
if
(
!
mrr_have_range
)
{
error_num
=
multi_range_read_next_first
(
range_info
);
mrr_have_range
=
TRUE
;
}
else
error_num
=
multi_range_read_next_next
(
range_info
);
DBUG_RETURN
(
error_num
);
}
#endif
#endif
#ifdef HA_MRR_USE_DEFAULT_IMPL
#ifdef HA_MRR_USE_DEFAULT_IMPL
...
@@ -4408,6 +4387,7 @@ int ha_spider::read_multi_range_first_internal(
...
@@ -4408,6 +4387,7 @@ int ha_spider::read_multi_range_first_internal(
result_list
.
split_read
?
result_list
.
split_read
?
result_list
.
split_read
:
result_list
.
split_read
:
result_list
.
internal_limit
-
result_list
.
record_num
;
result_list
.
internal_limit
-
result_list
.
record_num
;
DBUG_PRINT
(
"info"
,(
"spider limit_num=%lld"
,
result_list
.
limit_num
));
if
(
if
(
#ifdef HA_MRR_USE_DEFAULT_IMPL
#ifdef HA_MRR_USE_DEFAULT_IMPL
(
error_num
=
spider_db_append_key_where
(
(
error_num
=
spider_db_append_key_where
(
...
@@ -4695,6 +4675,8 @@ int ha_spider::read_multi_range_first_internal(
...
@@ -4695,6 +4675,8 @@ int ha_spider::read_multi_range_first_internal(
}
}
}
else
{
}
else
{
#ifdef HA_MRR_USE_DEFAULT_IMPL
#ifdef HA_MRR_USE_DEFAULT_IMPL
if
(
!
range_info
)
DBUG_RETURN
(
0
);
if
(
!
(
error_num
=
spider_db_fetch
(
table
->
record
[
0
],
this
,
table
)))
if
(
!
(
error_num
=
spider_db_fetch
(
table
->
record
[
0
],
this
,
table
)))
#else
#else
if
(
!
buf
||
!
(
error_num
=
spider_db_fetch
(
buf
,
this
,
table
)))
if
(
!
buf
||
!
(
error_num
=
spider_db_fetch
(
buf
,
this
,
table
)))
...
@@ -5094,6 +5076,7 @@ int ha_spider::read_multi_range_first_internal(
...
@@ -5094,6 +5076,7 @@ int ha_spider::read_multi_range_first_internal(
}
}
}
else
{
}
else
{
result_list
.
limit_num
=
result_list
.
internal_limit
;
result_list
.
limit_num
=
result_list
.
internal_limit
;
result_list
.
split_read
=
result_list
.
internal_limit
;
if
(
if
(
(
error_num
=
init_union_table_name_pos_sql
())
||
(
error_num
=
init_union_table_name_pos_sql
())
||
(
error_num
=
append_union_all_start_sql_part
(
(
error_num
=
append_union_all_start_sql_part
(
...
@@ -5137,6 +5120,9 @@ int ha_spider::read_multi_range_first_internal(
...
@@ -5137,6 +5120,9 @@ int ha_spider::read_multi_range_first_internal(
)
)
DBUG_RETURN
(
error_num
);
DBUG_RETURN
(
error_num
);
set_where_pos_sql
(
SPIDER_SQL_TYPE_SELECT_SQL
);
set_where_pos_sql
(
SPIDER_SQL_TYPE_SELECT_SQL
);
DBUG_PRINT
(
"info"
,(
"spider internal_offset=%lld"
,
result_list
.
internal_offset
));
DBUG_PRINT
(
"info"
,(
"spider limit_num=%lld"
,
result_list
.
limit_num
));
if
(
if
(
#ifdef HA_MRR_USE_DEFAULT_IMPL
#ifdef HA_MRR_USE_DEFAULT_IMPL
(
error_num
=
spider_db_append_key_where
(
(
error_num
=
spider_db_append_key_where
(
...
@@ -5537,6 +5523,8 @@ int ha_spider::read_multi_range_first_internal(
...
@@ -5537,6 +5523,8 @@ int ha_spider::read_multi_range_first_internal(
DBUG_RETURN
(
error_num
);
DBUG_RETURN
(
error_num
);
}
else
{
}
else
{
#ifdef HA_MRR_USE_DEFAULT_IMPL
#ifdef HA_MRR_USE_DEFAULT_IMPL
if
(
!
range_info
)
DBUG_RETURN
(
0
);
if
(
!
(
error_num
=
spider_db_fetch
(
table
->
record
[
0
],
this
,
table
)))
if
(
!
(
error_num
=
spider_db_fetch
(
table
->
record
[
0
],
this
,
table
)))
#else
#else
if
(
!
buf
||
!
(
error_num
=
spider_db_fetch
(
buf
,
this
,
table
)))
if
(
!
buf
||
!
(
error_num
=
spider_db_fetch
(
buf
,
this
,
table
)))
...
@@ -5611,6 +5599,56 @@ int ha_spider::read_multi_range_first_internal(
...
@@ -5611,6 +5599,56 @@ int ha_spider::read_multi_range_first_internal(
}
}
#ifdef HA_MRR_USE_DEFAULT_IMPL
#ifdef HA_MRR_USE_DEFAULT_IMPL
int
ha_spider
::
pre_multi_range_read_next
(
bool
use_parallel
)
{
DBUG_ENTER
(
"ha_spider::pre_multi_range_read_next"
);
DBUG_PRINT
(
"info"
,(
"spider this=%p"
,
this
));
check_pre_call
(
use_parallel
);
if
(
use_pre_call
)
{
store_error_num
=
multi_range_read_next_first
(
NULL
);
DBUG_RETURN
(
store_error_num
);
}
DBUG_RETURN
(
0
);
}
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100000
int
ha_spider
::
multi_range_read_next
(
range_id_t
*
range_info
)
#else
int
ha_spider
::
multi_range_read_next
(
char
**
range_info
)
#endif
{
int
error_num
;
DBUG_ENTER
(
"ha_spider::multi_range_read_next"
);
DBUG_PRINT
(
"info"
,(
"spider this=%p"
,
this
));
if
(
use_pre_call
)
{
if
(
store_error_num
)
{
if
(
store_error_num
==
HA_ERR_END_OF_FILE
)
table
->
status
=
STATUS_NOT_FOUND
;
DBUG_RETURN
(
store_error_num
);
}
if
((
error_num
=
spider_bg_all_conn_pre_next
(
this
,
search_link_idx
)))
DBUG_RETURN
(
error_num
);
use_pre_call
=
FALSE
;
mrr_have_range
=
TRUE
;
DBUG_RETURN
(
multi_range_read_next_next
(
range_info
));
}
if
(
!
mrr_have_range
)
{
error_num
=
multi_range_read_next_first
(
range_info
);
mrr_have_range
=
TRUE
;
}
else
error_num
=
multi_range_read_next_next
(
range_info
);
DBUG_RETURN
(
error_num
);
}
#else
#else
int
ha_spider
::
pre_read_multi_range_first
(
int
ha_spider
::
pre_read_multi_range_first
(
KEY_MULTI_RANGE
**
found_range_p
,
KEY_MULTI_RANGE
**
found_range_p
,
...
...
storage/spider/ha_spider.h
View file @
088b981e
...
@@ -469,6 +469,9 @@ public:
...
@@ -469,6 +469,9 @@ public:
bool
use_parallel
bool
use_parallel
);
);
#ifdef HA_MRR_USE_DEFAULT_IMPL
#ifdef HA_MRR_USE_DEFAULT_IMPL
int
pre_multi_range_read_next
(
bool
use_parallel
);
#else
#else
int
pre_read_multi_range_first
(
int
pre_read_multi_range_first
(
KEY_MULTI_RANGE
**
found_range_p
,
KEY_MULTI_RANGE
**
found_range_p
,
...
...
storage/spider/spd_db_conn.cc
View file @
088b981e
...
@@ -3680,14 +3680,14 @@ int spider_db_store_result(
...
@@ -3680,14 +3680,14 @@ int spider_db_store_result(
current
->
record_num
));
current
->
record_num
));
DBUG_PRINT
(
"info"
,(
"spider result_list->record_num=%lld"
,
DBUG_PRINT
(
"info"
,(
"spider result_list->record_num=%lld"
,
result_list
->
record_num
));
result_list
->
record_num
));
DBUG_PRINT
(
"info"
,(
"spider result_list->internal_limit=%lld"
,
result_list
->
internal_limit
));
DBUG_PRINT
(
"info"
,(
"spider result_list->split_read=%lld"
,
result_list
->
split_read
));
if
(
if
(
result_list
->
internal_limit
<=
result_list
->
record_num
||
result_list
->
internal_limit
<=
result_list
->
record_num
||
result_list
->
split_read
>
current
->
record_num
result_list
->
split_read
>
current
->
record_num
)
{
)
{
DBUG_PRINT
(
"info"
,(
"spider result_list->internal_limit=%lld"
,
result_list
->
internal_limit
));
DBUG_PRINT
(
"info"
,(
"spider result_list->split_read=%lld"
,
result_list
->
split_read
));
DBUG_PRINT
(
"info"
,(
"spider set finish_flg point 2"
));
DBUG_PRINT
(
"info"
,(
"spider set finish_flg point 2"
));
DBUG_PRINT
(
"info"
,(
"spider current->finish_flg = TRUE"
));
DBUG_PRINT
(
"info"
,(
"spider current->finish_flg = TRUE"
));
DBUG_PRINT
(
"info"
,(
"spider result_list->finish_flg = TRUE"
));
DBUG_PRINT
(
"info"
,(
"spider result_list->finish_flg = TRUE"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment