summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-01-14 02:05:10 -0800
committerIgor Babaev <igor@askmonty.org>2011-01-14 02:05:10 -0800
commitc8e56e37135e2394702f72738256fa8cb9cc906c (patch)
tree3220b8da387d23659153ba016e0bd4e9c5e0cdb1 /mysql-test/t/select.test
parentd0e8dbc4a359d3fe354fff95e293bd1783ae009e (diff)
downloadmariadb-git-c8e56e37135e2394702f72738256fa8cb9cc906c.tar.gz
Fixed LP bug #702310 / bug #59493.
An assertion failure was triggered for a 6-way join query that uses two join buffers. The failure happened because every call of the function flush_cached_records() saved and restored status of all tables before the table join_tab. It must do it only for those of them that follow the last table that uses a join buffer.
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r--mysql-test/t/select.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index db08aad0df0..1139e7acc60 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -4087,5 +4087,38 @@ EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
DROP TABLE t1;
+--echo #
+--echo # Bug #702310: usage of 2 join buffers after ref access to an empty table
+--echo #
+
+CREATE TABLE t1 (f1 int) ;
+INSERT INTO t1 VALUES (9);
+
+CREATE TABLE t2 (f1 int);
+INSERT INTO t2 VALUES (3),(7),(18);
+INSERT INTO t2 VALUES (3),(7),(18);
+INSERT INTO t2 VALUES (3),(7),(18);
+INSERT INTO t2 VALUES (3),(7),(18);
+
+CREATE TABLE t3 (f1 int);
+INSERT INTO t3 VALUES (17);
+
+CREATE TABLE t4 (f1 int PRIMARY KEY, f2 varchar(1024)) ;
+
+CREATE TABLE t5 (f1 int) ;
+INSERT INTO t5 VALUES (20),(5);
+
+CREATE TABLE t6(f1 int);
+INSERT INTO t6 VALUES (9),(7);
+
+SET SESSION join_buffer_size = 9000;
+
+EXPLAIN
+SELECT STRAIGHT_JOIN * FROM t2, (t1 LEFT JOIN (t3,t4) ON t1.f1 = t4.f1), t5, t6;
+SELECT STRAIGHT_JOIN * FROM t2, (t1 LEFT JOIN (t3,t4) ON t1.f1 = t4.f1), t5, t6;
+
+SET SESSION join_buffer_size = DEFAULT;
+
+DROP TABLE t1,t2,t3,t4,t5,t6;
--echo End of 5.1 tests