diff options
author | Igor Babaev <igor@askmonty.org> | 2010-09-23 11:25:45 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2010-09-23 11:25:45 -0700 |
commit | db37f2db82a8fc58439dcd5e554df3ca33380461 (patch) | |
tree | dfbdef4c8163fbadaa64c5f5e1158699872dabbb /mysql-test/t/join_cache.test | |
parent | f144eb16ae879b42a42a35cbe3d1309022d741e9 (diff) | |
download | mariadb-git-db37f2db82a8fc58439dcd5e554df3ca33380461.tar.gz |
Applied the fix for bug #51084 taken from a mysql tree.
Diffstat (limited to 'mysql-test/t/join_cache.test')
-rwxr-xr-x | mysql-test/t/join_cache.test | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/mysql-test/t/join_cache.test b/mysql-test/t/join_cache.test index 7bc22fd4f23..f65f521f21a 100755 --- a/mysql-test/t/join_cache.test +++ b/mysql-test/t/join_cache.test @@ -1955,8 +1955,6 @@ set join_cache_level=default; drop table t1,t2,t3; -set @@optimizer_switch=@save_optimizer_switch; - --echo # --echo # Bug #52394: using join buffer for 3 table join with ref access --echo # LP #623209: and no references to the columns of the middle table @@ -1984,3 +1982,49 @@ DROP TABLE t1,t2,t3; set join_cache_level=default; +--echo # +--echo # Bug#51084: Batched key access crashes for SELECT with +--echo # derived table and LEFT JOIN +--echo # + +CREATE TABLE t1 ( + carrier int, + id int PRIMARY KEY +); +INSERT INTO t1 VALUES (1,11),(1,12),(2,13); + +CREATE TABLE t2 ( + scan_date int, + package_id int +); +INSERT INTO t2 VALUES (2008,21),(2008,22); + +CREATE TABLE t3 ( + carrier int PRIMARY KEY, + id int +); +INSERT INTO t3 VALUES (1,31); + +CREATE TABLE t4 ( + carrier_id int, + INDEX carrier_id(carrier_id) +); +INSERT INTO t4 VALUES (31),(32); + +SET join_cache_level=8; + +SELECT COUNT(*) + FROM (t2 JOIN t1) LEFT JOIN (t3 JOIN t4 ON t3.id = t4.carrier_id) + ON t3.carrier = t1.carrier; + +EXPLAIN +SELECT COUNT(*) + FROM (t2 JOIN t1) LEFT JOIN (t3 JOIN t4 ON t3.id = t4.carrier_id) + ON t3.carrier = t1.carrier; + +SET join_cache_level=default; + +DROP TABLE t1,t2,t3,t4; + +# this must be the last command in the file +set @@optimizer_switch=@save_optimizer_switch; |