diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2014-03-13 12:20:57 +0100 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2014-03-13 12:20:57 +0100 |
commit | 8c04dd33dd7ab1c261bd15ace2009832af7a2f98 (patch) | |
tree | e896c2bae6e6cca37b0b7f31c836c71b19b7d187 /mysql-test | |
parent | fad4b3337662e8911efa206cf4cde5adc3515397 (diff) | |
download | mariadb-git-8c04dd33dd7ab1c261bd15ace2009832af7a2f98.tar.gz |
MDEV-5811: Server crashes in best_access_path with materialization+semijoin and big_tables=ON
- With big_tables=ON, materialized table will use Aria (or MyISAM) SE, which
allows prefix key reads. However, the temp.table has rec_per_key=NULL which
causes the optimizer to crash when attempting to read index statistics for a
prefix index read.
- Fixed by providing a rec_per_key array with zeros (i.e. "no statistics data")
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/subselect_mat.result | 14 | ||||
-rw-r--r-- | mysql-test/r/subselect_sj_mat.result | 14 | ||||
-rw-r--r-- | mysql-test/t/subselect_sj_mat.test | 18 |
3 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result index c47881d5434..7743e804f17 100644 --- a/mysql-test/r/subselect_mat.result +++ b/mysql-test/r/subselect_mat.result @@ -2041,6 +2041,20 @@ EXECUTE stmt; a DROP TABLE t1, t2; DROP VIEW v2; +# +# MDEV-5811: Server crashes in best_access_path with materialization+semijoin and big_tables=ON +# +SET @tmp_mdev5811= @@big_tables; +SET big_tables = ON; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); +SELECT * FROM t1 AS t1_1, t1 AS t1_2 +WHERE ( t1_1.a, t1_2.a ) IN ( SELECT MAX(b), MIN(b) FROM t2 ); +a a +DROP TABLE t1,t2; +SET big_tables=@tmp_mdev5811; # End of 5.3 tests set @subselect_mat_test_optimizer_switch_value=null; set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off'; diff --git a/mysql-test/r/subselect_sj_mat.result b/mysql-test/r/subselect_sj_mat.result index f267f32c887..9f3cb5ce0b8 100644 --- a/mysql-test/r/subselect_sj_mat.result +++ b/mysql-test/r/subselect_sj_mat.result @@ -2081,4 +2081,18 @@ EXECUTE stmt; a DROP TABLE t1, t2; DROP VIEW v2; +# +# MDEV-5811: Server crashes in best_access_path with materialization+semijoin and big_tables=ON +# +SET @tmp_mdev5811= @@big_tables; +SET big_tables = ON; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); +SELECT * FROM t1 AS t1_1, t1 AS t1_2 +WHERE ( t1_1.a, t1_2.a ) IN ( SELECT MAX(b), MIN(b) FROM t2 ); +a a +DROP TABLE t1,t2; +SET big_tables=@tmp_mdev5811; # End of 5.3 tests diff --git a/mysql-test/t/subselect_sj_mat.test b/mysql-test/t/subselect_sj_mat.test index bf5360dd4a7..5e7103aa6e9 100644 --- a/mysql-test/t/subselect_sj_mat.test +++ b/mysql-test/t/subselect_sj_mat.test @@ -1726,4 +1726,22 @@ EXECUTE stmt; DROP TABLE t1, t2; DROP VIEW v2; +--echo # +--echo # MDEV-5811: Server crashes in best_access_path with materialization+semijoin and big_tables=ON +--echo # +SET @tmp_mdev5811= @@big_tables; +SET big_tables = ON; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); + +SELECT * FROM t1 AS t1_1, t1 AS t1_2 + WHERE ( t1_1.a, t1_2.a ) IN ( SELECT MAX(b), MIN(b) FROM t2 ); + +DROP TABLE t1,t2; +SET big_tables=@tmp_mdev5811; + --echo # End of 5.3 tests |