Details
-
Bug
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11
Description
This test case is originally subselect_sj.test
--echo #
|
--echo # MDEV-5059: Wrong result (missing row) wih semijoin, join_cache_level > 2, LEFT JOIN, ORDER BY
|
--echo #
|
|
set join_buffer_size= 1024*1024*2;
|
SET join_cache_level = 3;
|
set optimizer_search_depth=62;
|
set join_buffer_space_limit=2097152;
|
|
set optimizer_switch="index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on";
|
CREATE TABLE t1 (pk1 INT PRIMARY KEY, i1 INT) ENGINE=MyISAM;
|
INSERT INTO t1 VALUES (1,4),(2,5);
|
|
CREATE TABLE t2 (i2 INT, c2 CHAR(1)) ENGINE=MyISAM;
|
INSERT INTO t2 VALUES (1,'v'),(7,'s');
|
|
CREATE TABLE t3 (pk3 INT PRIMARY KEY, i3 INT, c3 CHAR(1), INDEX(i3), INDEX(c3,i3)) ENGINE=MyISAM;
|
INSERT INTO t3 VALUES (1,7,'g'),(2,4,'p'),(3,1,'q');
|
|
CREATE TABLE t4 (i4 INT) ENGINE=MyISAM;
|
INSERT INTO t4 VALUES (1);
|
SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2)
|
WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2;
|
|
set join_buffer_size=262144;
|
|
SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2)
|
WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2;
|
|
DROP TABLE t1,t2,t3,t4;
|
-----------
The last SELECT produces two different results:
SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2)
|
WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2;
|
pk1 i1 i2 c2 pk3 i3 c3
|
1 4 7 s 1 7 g
|
1 4 7 s 2 4 p
|
1 4 7 s 3 1 q
|
1 4 1 v 1 7 g
|
1 4 1 v 2 4 p
|
1 4 1 v 3 1 q
|
set join_buffer_size=262144;
|
SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2)
|
WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2;
|
pk1 i1 i2 c2 pk3 i3 c3
|
1 4 7 s NULL NULL NULL
|
1 4 1 v NULL NULL NULL
|
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Assignee | Sergei Petrunia [ psergey ] |
Description |
This test case is originally subselect_sj.test
--echo # --echo # --echo # set join_buffer_size= 1024*1024*2; SET join_cache_level = 3; set optimizer_search_depth=62; set join_buffer_space_limit=2097152; set optimizer_switch="index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on"; CREATE TABLE t1 (pk1 INT PRIMARY KEY, i1 INT) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,4),(2,5); CREATE TABLE t2 (i2 INT, c2 CHAR(1)) ENGINE=MyISAM; INSERT INTO t2 VALUES (1,'v'),(7,'s'); CREATE TABLE t3 (pk3 INT PRIMARY KEY, i3 INT, c3 CHAR(1), INDEX(i3), INDEX(c3,i3)) ENGINE=MyISAM; INSERT INTO t3 VALUES (1,7,'g'),(2,4,'p'),(3,1,'q'); CREATE TABLE t4 (i4 INT) ENGINE=MyISAM; INSERT INTO t4 VALUES (1); SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; set join_buffer_size=262144; SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; DROP TABLE t1,t2,t3,t4; ----------- The last SELECT produces two different results: SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; pk1 i1 i2 c2 pk3 i3 c3 1 4 7 s 1 7 g 1 4 7 s 2 4 p 1 4 7 s 3 1 q 1 4 1 v 1 7 g 1 4 1 v 2 4 p 1 4 1 v 3 1 q set join_buffer_size=262144; SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; pk1 i1 i2 c2 pk3 i3 c3 1 4 7 s NULL NULL NULL 1 4 1 v NULL NULL NULL |
This test case is originally subselect_sj.test
{code:sql} --echo # --echo # --echo # set join_buffer_size= 1024*1024*2; SET join_cache_level = 3; set optimizer_search_depth=62; set join_buffer_space_limit=2097152; set optimizer_switch="index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on"; CREATE TABLE t1 (pk1 INT PRIMARY KEY, i1 INT) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,4),(2,5); CREATE TABLE t2 (i2 INT, c2 CHAR(1)) ENGINE=MyISAM; INSERT INTO t2 VALUES (1,'v'),(7,'s'); CREATE TABLE t3 (pk3 INT PRIMARY KEY, i3 INT, c3 CHAR(1), INDEX(i3), INDEX(c3,i3)) ENGINE=MyISAM; INSERT INTO t3 VALUES (1,7,'g'),(2,4,'p'),(3,1,'q'); CREATE TABLE t4 (i4 INT) ENGINE=MyISAM; INSERT INTO t4 VALUES (1); SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; set join_buffer_size=262144; SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; DROP TABLE t1,t2,t3,t4; {code} ----------- The last SELECT produces two different results: {code} SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; pk1 i1 i2 c2 pk3 i3 c3 1 4 7 s 1 7 g 1 4 7 s 2 4 p 1 4 7 s 3 1 q 1 4 1 v 1 7 g 1 4 1 v 2 4 p 1 4 1 v 3 1 q {code} {code} set join_buffer_size=262144; SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; pk1 i1 i2 c2 pk3 i3 c3 1 4 7 s NULL NULL NULL 1 4 1 v NULL NULL NULL {code} |
Description |
This test case is originally subselect_sj.test
{code:sql} --echo # --echo # --echo # set join_buffer_size= 1024*1024*2; SET join_cache_level = 3; set optimizer_search_depth=62; set join_buffer_space_limit=2097152; set optimizer_switch="index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on"; CREATE TABLE t1 (pk1 INT PRIMARY KEY, i1 INT) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,4),(2,5); CREATE TABLE t2 (i2 INT, c2 CHAR(1)) ENGINE=MyISAM; INSERT INTO t2 VALUES (1,'v'),(7,'s'); CREATE TABLE t3 (pk3 INT PRIMARY KEY, i3 INT, c3 CHAR(1), INDEX(i3), INDEX(c3,i3)) ENGINE=MyISAM; INSERT INTO t3 VALUES (1,7,'g'),(2,4,'p'),(3,1,'q'); CREATE TABLE t4 (i4 INT) ENGINE=MyISAM; INSERT INTO t4 VALUES (1); SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; set join_buffer_size=262144; SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; DROP TABLE t1,t2,t3,t4; {code} ----------- The last SELECT produces two different results: {code} SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; pk1 i1 i2 c2 pk3 i3 c3 1 4 7 s 1 7 g 1 4 7 s 2 4 p 1 4 7 s 3 1 q 1 4 1 v 1 7 g 1 4 1 v 2 4 p 1 4 1 v 3 1 q {code} {code} set join_buffer_size=262144; SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; pk1 i1 i2 c2 pk3 i3 c3 1 4 7 s NULL NULL NULL 1 4 1 v NULL NULL NULL {code} |
This test case is originally subselect_sj.test
{code} --echo # --echo # --echo # set join_buffer_size= 1024*1024*2; SET join_cache_level = 3; set optimizer_search_depth=62; set join_buffer_space_limit=2097152; set optimizer_switch="index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on"; {code} {code} CREATE TABLE t1 (pk1 INT PRIMARY KEY, i1 INT) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,4),(2,5); CREATE TABLE t2 (i2 INT, c2 CHAR(1)) ENGINE=MyISAM; INSERT INTO t2 VALUES (1,'v'),(7,'s'); CREATE TABLE t3 (pk3 INT PRIMARY KEY, i3 INT, c3 CHAR(1), INDEX(i3), INDEX(c3,i3)) ENGINE=MyISAM; INSERT INTO t3 VALUES (1,7,'g'),(2,4,'p'),(3,1,'q'); CREATE TABLE t4 (i4 INT) ENGINE=MyISAM; INSERT INTO t4 VALUES (1); {code} {code} SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; set join_buffer_size=262144; SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; DROP TABLE t1,t2,t3,t4; {code} ----------- The last SELECT produces two different results: {code} SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; pk1 i1 i2 c2 pk3 i3 c3 1 4 7 s 1 7 g 1 4 7 s 2 4 p 1 4 7 s 3 1 q 1 4 1 v 1 7 g 1 4 1 v 2 4 p 1 4 1 v 3 1 q {code} {code} set join_buffer_size=262144; SELECT * FROM t1, t2 LEFT JOIN t3 ON (c3 = c2) WHERE ( i2, pk1 ) IN ( SELECT i3, 1 FROM t3, t4 ) ORDER BY i1, c2; pk1 i1 i2 c2 pk3 i3 c3 1 4 7 s NULL NULL NULL 1 4 1 v NULL NULL NULL {code} |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Issue Type | Task [ 3 ] | Bug [ 1 ] |
Assignee | Sergei Petrunia [ psergey ] | Varun Gupta [ varun ] |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Assignee | Varun Gupta [ varun ] | Sergei Petrunia [ psergey ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Sergei Petrunia [ psergey ] | Varun Gupta [ varun ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Varun Gupta [ varun ] | Sergei Petrunia [ psergey ] |
Status | Stalled [ 10000 ] | In Review [ 10002 ] |
Assignee | Sergei Petrunia [ psergey ] | Igor Babaev [ igor ] |
Assignee | Igor Babaev [ igor ] | Sergei Petrunia [ psergey ] |
Assignee | Sergei Petrunia [ psergey ] | Igor Babaev [ igor ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Workflow | MariaDB v3 [ 97068 ] | MariaDB v4 [ 143591 ] |
Affects Version/s | 10.3 [ 22126 ] | |
Affects Version/s | 10.4 [ 22408 ] | |
Affects Version/s | 10.5 [ 23123 ] | |
Affects Version/s | 10.6 [ 24028 ] | |
Affects Version/s | 10.7 [ 24805 ] | |
Affects Version/s | 10.8 [ 26121 ] | |
Affects Version/s | 10.9 [ 26905 ] | |
Affects Version/s | 10.10 [ 27530 ] | |
Affects Version/s | 10.11 [ 27614 ] |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] | |
Fix Version/s | 10.8 [ 26121 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 10.10 [ 27530 ] |
Labels | 11.0-sel |
Assignee | Igor Babaev [ igor ] | Sergei Petrunia [ psergey ] |
Fix Version/s | 10.7 [ 24805 ] |
Fix Version/s | 10.3 [ 22126 ] |
Fix Version/s | 10.8 [ 26121 ] |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 10.10 [ 27530 ] |
Assignee | Sergei Petrunia [ psergey ] | Igor Babaev [ igor ] |
Priority | Critical [ 2 ] | Major [ 3 ] |
Fix Version/s | 10.4 [ 22408 ] |