Commit dc378280 authored by Sergei Golubchik's avatar Sergei Golubchik Committed by Oleksandr Byelkin

MDEV-29947 Spider doesn't return all rows when doing a join of two tables with no usable keys

followup for 57d233e2
parent f8997c68
...@@ -2055,7 +2055,6 @@ int ha_spider::index_first_internal( ...@@ -2055,7 +2055,6 @@ int ha_spider::index_first_internal(
pt_clone_source_handler)); pt_clone_source_handler));
pt_clone_source_handler->pt_clone_last_searcher = this; pt_clone_source_handler->pt_clone_last_searcher = this;
} }
if (sql_is_empty(SPIDER_SQL_TYPE_SELECT_SQL))
{ {
/* /*
spider_db_free_one_result_for_start_next(this); spider_db_free_one_result_for_start_next(this);
...@@ -2399,7 +2398,6 @@ int ha_spider::index_last_internal( ...@@ -2399,7 +2398,6 @@ int ha_spider::index_last_internal(
pt_clone_source_handler)); pt_clone_source_handler));
pt_clone_source_handler->pt_clone_last_searcher = this; pt_clone_source_handler->pt_clone_last_searcher = this;
} }
if (sql_is_empty(SPIDER_SQL_TYPE_SELECT_SQL))
{ {
/* /*
spider_db_free_one_result_for_start_next(this); spider_db_free_one_result_for_start_next(this);
......
...@@ -104,11 +104,47 @@ pkey ...@@ -104,11 +104,47 @@ pkey
21 21
26 26
27 27
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey+0 = b.pkey+0 ORDER BY a.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1; connection child2_1;
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %';
argument argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey` select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
select a.id,b.`pkey` from auto_test_remote.tmp_spider_bka_xxxx a,`auto_test_remote`.`tbl_b` b where a.c0 <=> b.`pkey` select a.id,b.`pkey` from auto_test_remote.tmp_spider_bka_xxxx a,`auto_test_remote`.`tbl_b` b where a.c0 <=> b.`pkey`
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
select `pkey` from `auto_test_remote`.`tbl_b` order by `pkey`
select `pkey` from `auto_test_remote`.`tbl_b` order by `pkey`
select `pkey` from `auto_test_remote`.`tbl_b` order by `pkey`
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %' SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey ; SELECT pkey FROM tbl_a ORDER BY pkey ;
SELECT pkey FROM tbl_b ORDER BY pkey; SELECT pkey FROM tbl_b ORDER BY pkey;
...@@ -139,6 +175,10 @@ SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argum ...@@ -139,6 +175,10 @@ SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argum
argument argument
select `pkey` from `auto_test_remote2`.`tbl_a` order by `pkey` select `pkey` from `auto_test_remote2`.`tbl_a` order by `pkey`
select a.id,b.`pkey` from auto_test_remote2.tmp_spider_bka_xxxx a,`auto_test_remote2`.`tbl_b` b where a.c0 <=> b.`pkey` select a.id,b.`pkey` from auto_test_remote2.tmp_spider_bka_xxxx a,`auto_test_remote2`.`tbl_b` b where a.c0 <=> b.`pkey`
select `pkey` from `auto_test_remote2`.`tbl_a` order by `pkey`
select `pkey` from `auto_test_remote2`.`tbl_b` order by `pkey`
select `pkey` from `auto_test_remote2`.`tbl_b` order by `pkey`
select `pkey` from `auto_test_remote2`.`tbl_b` order by `pkey`
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %' SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey ; SELECT pkey FROM tbl_a ORDER BY pkey ;
SELECT pkey FROM tbl_b ORDER BY pkey; SELECT pkey FROM tbl_b ORDER BY pkey;
...@@ -169,6 +209,10 @@ SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argum ...@@ -169,6 +209,10 @@ SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argum
argument argument
select `pkey` from `auto_test_remote3`.`tbl_a` order by `pkey` select `pkey` from `auto_test_remote3`.`tbl_a` order by `pkey`
select a.id,b.`pkey` from auto_test_remote3.tmp_spider_bka_xxxx a,`auto_test_remote3`.`tbl_b` b where a.c0 <=> b.`pkey` select a.id,b.`pkey` from auto_test_remote3.tmp_spider_bka_xxxx a,`auto_test_remote3`.`tbl_b` b where a.c0 <=> b.`pkey`
select `pkey` from `auto_test_remote3`.`tbl_a` order by `pkey`
select `pkey` from `auto_test_remote3`.`tbl_b` order by `pkey`
select `pkey` from `auto_test_remote3`.`tbl_b` order by `pkey`
select `pkey` from `auto_test_remote3`.`tbl_b` order by `pkey`
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %' SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey ; SELECT pkey FROM tbl_a ORDER BY pkey ;
SELECT pkey FROM tbl_b ORDER BY pkey; SELECT pkey FROM tbl_b ORDER BY pkey;
......
...@@ -169,6 +169,7 @@ if ($USE_CHILD_GROUP2) ...@@ -169,6 +169,7 @@ if ($USE_CHILD_GROUP2)
} }
--connection master_1 --connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey+0 = b.pkey+0 ORDER BY a.pkey; # MDEV-29947
if ($USE_CHILD_GROUP2) if ($USE_CHILD_GROUP2)
{ {
if (!$OUTPUT_CHILD_GROUP2) if (!$OUTPUT_CHILD_GROUP2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment