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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
f41f5f74
Commit
f41f5f74
authored
Mar 25, 2014
by
Kentoku SHIBA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use handler no where clause
parent
a99b54cf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
14 deletions
+63
-14
storage/spider/ha_spider.cc
storage/spider/ha_spider.cc
+43
-7
storage/spider/ha_spider.h
storage/spider/ha_spider.h
+1
-0
storage/spider/spd_db_conn.cc
storage/spider/spd_db_conn.cc
+5
-2
storage/spider/spd_db_include.h
storage/spider/spd_db_include.h
+2
-0
storage/spider/spd_db_mysql.cc
storage/spider/spd_db_mysql.cc
+11
-4
storage/spider/spd_include.h
storage/spider/spd_include.h
+1
-1
No files found.
storage/spider/ha_spider.cc
View file @
f41f5f74
...
...
@@ -154,6 +154,7 @@ ha_spider::ha_spider(
result_list
.
direct_aggregate
=
FALSE
;
#endif
result_list
.
casual_read
=
NULL
;
result_list
.
use_both_key
=
FALSE
;
DBUG_VOID_RETURN
;
}
...
...
@@ -258,6 +259,7 @@ ha_spider::ha_spider(
result_list
.
direct_aggregate
=
FALSE
;
#endif
result_list
.
casual_read
=
NULL
;
result_list
.
use_both_key
=
FALSE
;
ref_length
=
sizeof
(
SPIDER_POSITION
);
DBUG_VOID_RETURN
;
}
...
...
@@ -1714,6 +1716,7 @@ int ha_spider::reset()
clone_bitmap_init
=
FALSE
;
result_list
.
tmp_table_join
=
FALSE
;
result_list
.
use_union
=
FALSE
;
result_list
.
use_both_key
=
FALSE
;
pt_clone_last_searcher
=
NULL
;
conn_kinds
=
SPIDER_CONN_KIND_MYSQL
;
has_clone_for_merge
=
FALSE
;
...
...
@@ -4126,10 +4129,14 @@ int ha_spider::read_range_first(
if
((
error_num
=
spider_bg_all_conn_pre_next
(
this
,
search_link_idx
)))
DBUG_RETURN
(
error_num
);
use_pre_call
=
FALSE
;
DBUG_RETURN
(
read_range_next
());
if
((
error_num
=
read_range_next
()))
DBUG_RETURN
(
error_num
);
DBUG_RETURN
(
check_ha_range_eof
());
}
DBUG_RETURN
(
read_range_first_internal
(
table
->
record
[
0
],
start_key
,
end_key
,
eq_range
,
sorted
));
if
((
error_num
=
read_range_first_internal
(
table
->
record
[
0
],
start_key
,
end_key
,
eq_range
,
sorted
)))
DBUG_RETURN
(
error_num
);
DBUG_RETURN
(
check_ha_range_eof
());
}
int
ha_spider
::
read_range_next
()
...
...
@@ -4160,7 +4167,7 @@ int ha_spider::read_range_next()
if
((
error_num
=
spider_db_seek_next
(
table
->
record
[
0
],
this
,
search_link_idx
,
table
)))
DBUG_RETURN
(
check_error_mode_eof
(
error_num
));
DBUG_RETURN
(
0
);
DBUG_RETURN
(
check_ha_range_eof
()
);
}
#ifdef HA_MRR_USE_DEFAULT_IMPL
...
...
@@ -4687,7 +4694,7 @@ int ha_spider::read_multi_range_first_internal(
#else
*
found_range_p
=
multi_range_curr
;
#endif
DBUG_RETURN
(
0
);
DBUG_RETURN
(
check_ha_range_eof
()
);
}
if
(
error_num
!=
HA_ERR_END_OF_FILE
&&
...
...
@@ -5743,7 +5750,7 @@ int ha_spider::read_multi_range_next(
)
{
if
(
!
(
error_num
=
spider_db_seek_next
(
table
->
record
[
0
],
this
,
search_link_idx
,
table
)))
DBUG_RETURN
(
0
);
DBUG_RETURN
(
check_ha_range_eof
()
);
#ifdef HA_MRR_USE_DEFAULT_IMPL
range_res
=
mrr_funcs
.
next
(
mrr_iter
,
&
mrr_cur_range
);
DBUG_PRINT
(
"info"
,(
"spider range_res1=%d"
,
range_res
));
...
...
@@ -6092,7 +6099,7 @@ int ha_spider::read_multi_range_next(
#else
*
found_range_p
=
multi_range_curr
;
#endif
DBUG_RETURN
(
0
);
DBUG_RETURN
(
check_ha_range_eof
()
);
}
if
(
error_num
!=
HA_ERR_END_OF_FILE
&&
...
...
@@ -11489,6 +11496,35 @@ void ha_spider::check_direct_order_limit()
DBUG_VOID_RETURN
;
}
int
ha_spider
::
check_ha_range_eof
()
{
DBUG_ENTER
(
"ha_spider::check_ha_range_eof"
);
DBUG_PRINT
(
"info"
,(
"spider this=%p"
,
this
));
const
key_range
*
end_key
=
result_list
.
end_key
;
DBUG_PRINT
(
"info"
,(
"spider use_both_key=%s"
,
result_list
.
use_both_key
?
"TRUE"
:
"FALSE"
));
DBUG_PRINT
(
"info"
,(
"spider sql_kind[%u]=%u"
,
search_link_idx
,
sql_kind
[
search_link_idx
]));
DBUG_PRINT
(
"info"
,(
"spider sql_command=%u"
,
sql_command
));
if
(
result_list
.
use_both_key
&&
(
sql_kind
[
search_link_idx
]
&
SPIDER_SQL_KIND_HANDLER
)
&&
sql_command
!=
SQLCOM_HA_READ
)
{
int
cmp_result
=
key_cmp
(
result_list
.
key_info
->
key_part
,
end_key
->
key
,
end_key
->
length
);
DBUG_PRINT
(
"info"
,(
"spider cmp_result=%d"
,
cmp_result
));
if
(
cmp_result
>
0
||
(
end_key
->
flag
==
HA_READ_BEFORE_KEY
&&
!
cmp_result
)
)
{
table
->
status
=
STATUS_NOT_FOUND
;
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
}
}
DBUG_RETURN
(
0
);
}
int
ha_spider
::
drop_tmp_tables
()
{
int
error_num
=
0
,
tmp_error_num
,
need_mon
;
...
...
storage/spider/ha_spider.h
View file @
f41f5f74
...
...
@@ -740,6 +740,7 @@ class ha_spider: public handler
);
uint
check_partitioned
();
void
check_direct_order_limit
();
int
check_ha_range_eof
();
int
drop_tmp_tables
();
bool
handler_opened
(
int
link_idx
,
...
...
storage/spider/spd_db_conn.cc
View file @
f41f5f74
...
...
@@ -1595,9 +1595,10 @@ int spider_db_append_key_where_internal(
start_key_part_map
=
0
;
use_both
=
FALSE
;
}
if
(
end_key
)
if
(
end_key
)
{
end_key_part_map
=
end_key
->
keypart_map
&
full_key_part_map
;
else
{
result_list
->
end_key
=
end_key
;
}
else
{
end_key_part_map
=
0
;
use_both
=
FALSE
;
}
...
...
@@ -1657,6 +1658,8 @@ int spider_db_append_key_where_internal(
tgt_key_part_map
=
end_key_part_map
;
}
DBUG_PRINT
(
"info"
,
(
"spider tgt_key_part_map=%lu"
,
tgt_key_part_map
));
if
(
start_key_part_map
==
end_key_part_map
)
result_list
->
use_both_key
=
TRUE
;
if
(
sql_kind
==
SPIDER_SQL_KIND_SQL
)
{
...
...
storage/spider/spd_db_include.h
View file @
f41f5f74
...
...
@@ -1591,6 +1591,8 @@ typedef struct st_spider_result_list
uint
*
sql_kind_backup
;
uint
sql_kinds_backup
;
bool
use_union
;
bool
use_both_key
;
const
key_range
*
end_key
;
spider_string
*
insert_sqls
;
spider_string
*
update_sqls
;
TABLE
**
upd_tmp_tbls
;
...
...
storage/spider/spd_db_mysql.cc
View file @
f41f5f74
...
...
@@ -7119,10 +7119,17 @@ int spider_mysql_handler::append_condition_part(
}
ha_where_pos
=
str
->
length
();
if
(
sql_part2
.
length
())
{
str
->
append
(
sql_part2
);
start_where
=
FALSE
;
if
(
spider
->
sql_command
==
SQLCOM_HA_READ
||
!
spider
->
result_list
.
use_both_key
)
{
if
(
sql_part2
.
length
())
{
str
->
append
(
sql_part2
);
start_where
=
FALSE
;
}
}
else
{
DBUG_RETURN
(
0
);
}
}
break
;
...
...
storage/spider/spd_include.h
View file @
f41f5f74
...
...
@@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#define SPIDER_DETAIL_VERSION "3.1.1
3
"
#define SPIDER_DETAIL_VERSION "3.1.1
4
"
#define SPIDER_HEX_VERSION 0x0301
#if MYSQL_VERSION_ID < 50500
...
...
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