summaryrefslogtreecommitdiff
path: root/mysql-test/t/table_elim.test
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2011-01-11 12:42:16 +0200
committerSergey Petrunya <psergey@askmonty.org>2011-01-11 12:42:16 +0200
commitef6232095743df0f89c5c876205c14c3c1ca8f92 (patch)
tree8783096a9101083bbaac49a37799899d95c794c8 /mysql-test/t/table_elim.test
parentefbb3c6c90279f2bed8dda9c48dbaaf8b09a8cae (diff)
downloadmariadb-git-ef6232095743df0f89c5c876205c14c3c1ca8f92.tar.gz
BUG#675118: Elimination of a table results in an invalid execution plan
- Fix for MySQL BUG#52357 added NESTED_JOIN::is_fully_covered() which would not take into account that MariaDB's table elimination could eliminate tables from join plan (and so, from join nest). Fixed the check in the function to compare post-table-elimination numbers.
Diffstat (limited to 'mysql-test/t/table_elim.test')
-rw-r--r--mysql-test/t/table_elim.test32
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/t/table_elim.test b/mysql-test/t/table_elim.test
index 7ad69d5bf37..5576362b396 100644
--- a/mysql-test/t/table_elim.test
+++ b/mysql-test/t/table_elim.test
@@ -467,3 +467,35 @@ HAVING
field4 != 6;
drop table t0,t1,t2,t3,t4,t5,t6;
+
+--echo #
+--echo # BUG#675118: Elimination of a table results in an invalid execution plan
+--echo #
+CREATE TABLE t1 (f1 int(11), PRIMARY KEY (f1)) ;
+
+CREATE TABLE t2 (f4 varchar(1024), KEY (f4)) ;
+INSERT IGNORE INTO t2 VALUES ('xcddwntkbxyorzdv'),
+ ('cnxxcddwntkbxyor'),('r'),('r'), ('did'),('I'),('when'),
+ ('hczkfqjeggivdvac'),('e'),('okay'),('up');
+
+CREATE TABLE t3 (f4 varchar(1024), f1 int(11), f2 int(11)) ;
+INSERT IGNORE INTO t3 VALUES ('f','4','0'),('n','5','-996540416');
+
+CREATE TABLE t4 (f1 int(11), f3 varchar(10)) ;
+INSERT IGNORE INTO t4 VALUES ('8','n'),('9','nwzcerzsgx'),('10','c');
+
+CREATE TABLE t5 (f5 int(11), KEY (f5)) ;
+
+EXPLAIN
+SELECT t3.f2
+FROM t2
+LEFT JOIN t3
+LEFT JOIN t4
+LEFT JOIN t1 ON t4.f1 = t1.f1
+JOIN t5 ON t4.f3 ON t3.f1 = t5.f5 ON t2.f4 = t3.f4
+WHERE t3.f2 ;
+--echo # ^^ The above must not produce a QEP of t3,t5,t2,t4
+--echo # as that violates the "no interleaving of outer join nests" rule.
+
+DROP TABLE t1,t2,t3,t4,t5;
+