diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2011-12-07 01:03:00 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2011-12-07 01:03:00 +0400 |
commit | 8e25dcfcd7bc1ccf9d65b2f12eba4543ed1bf9f4 (patch) | |
tree | 902b1c51f21914d62467f9ec550d9dab22ad1897 /mysql-test/r | |
parent | 264aaf111d0493f0472e704ad7dda426f81376ea (diff) | |
download | mariadb-git-8e25dcfcd7bc1ccf9d65b2f12eba4543ed1bf9f4.tar.gz |
BUG#868908: Crash in check_simple_equality() with semijoin + materialization + prepared statement
- Part 1 of the fix: for semi-join merged subqueries, calling child_join->optimize() until we're done with all
PS-lifetime optimizations in the parent.
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/subselect_mat.result | 23 | ||||
-rw-r--r-- | mysql-test/r/subselect_sj_mat.result | 23 |
2 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result index 8eaad6d8034..afd1b14b4e2 100644 --- a/mysql-test/r/subselect_mat.result +++ b/mysql-test/r/subselect_mat.result @@ -1728,6 +1728,29 @@ FROM t4 , t5 ); f1 f5 DROP TABLE t1, t2, t3, t4, t5; +# +# BUG#868908: Crash in check_simple_equality() with semijoin + materialization + prepared statement +# +CREATE TABLE t1 ( a int ); +CREATE TABLE t3 ( b int, c int) ; +CREATE TABLE t2 ( a int ) ; +CREATE TABLE t4 ( a int , c int) ; +PREPARE st1 FROM " +SELECT STRAIGHT_JOIN * +FROM t1 +WHERE ( 3 ) IN ( + SELECT t3.b + FROM t3 + LEFT JOIN ( + t2 STRAIGHT_JOIN t4 ON ( t4.c = t2.a ) + ) ON ( t4.a = t3.c ) +); +"; +EXECUTE st1; +a +EXECUTE st1; +a +DROP TABLE t1,t2,t3,t4; # This must be at the end: set optimizer_switch=@subselect_sj_mat_tmp; set @subselect_mat_test_optimizer_switch_value=null; diff --git a/mysql-test/r/subselect_sj_mat.result b/mysql-test/r/subselect_sj_mat.result index 472cadf04c4..7a6c4952091 100644 --- a/mysql-test/r/subselect_sj_mat.result +++ b/mysql-test/r/subselect_sj_mat.result @@ -1764,5 +1764,28 @@ FROM t4 , t5 ); f1 f5 DROP TABLE t1, t2, t3, t4, t5; +# +# BUG#868908: Crash in check_simple_equality() with semijoin + materialization + prepared statement +# +CREATE TABLE t1 ( a int ); +CREATE TABLE t3 ( b int, c int) ; +CREATE TABLE t2 ( a int ) ; +CREATE TABLE t4 ( a int , c int) ; +PREPARE st1 FROM " +SELECT STRAIGHT_JOIN * +FROM t1 +WHERE ( 3 ) IN ( + SELECT t3.b + FROM t3 + LEFT JOIN ( + t2 STRAIGHT_JOIN t4 ON ( t4.c = t2.a ) + ) ON ( t4.a = t3.c ) +); +"; +EXECUTE st1; +a +EXECUTE st1; +a +DROP TABLE t1,t2,t3,t4; # This must be at the end: set optimizer_switch=@subselect_sj_mat_tmp; |