summaryrefslogtreecommitdiff
path: root/mysql-test/r/join.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-08-28 09:14:57 -0700
committerIgor Babaev <igor@askmonty.org>2013-08-28 09:14:57 -0700
commit1906f1388e4d13b8a3328b58489dae862c6c8595 (patch)
tree3ece378d39331d450b6a71365aac4fe7cbb3bef4 /mysql-test/r/join.result
parent34aa69564d611b11a0df7cce85a9c4f82f1c6b9f (diff)
downloadmariadb-git-1906f1388e4d13b8a3328b58489dae862c6c8595.tar.gz
Fixed bug mdev-4959.
The fix for mdev-4420 was not quite correct. This patch corrects it.
Diffstat (limited to 'mysql-test/r/join.result')
-rw-r--r--mysql-test/r/join.result19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index a1796d7fa3b..1e51d55f012 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -1477,4 +1477,23 @@ DROP TABLE t1,t2,t3,t4,t5;
#
SELECT * FROM t5 JOIN (t1 JOIN t2 UNION SELECT * FROM t3 JOIN t4);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
+#
+# MDEV-4959: join of const table with NULL fields
+#
+CREATE TABLE t1 (i1 int) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (NULL);
+CREATE TABLE t2 (i2 int, a int, b int) ENGINE=MyISAM;
+CREATE ALGORITHM=TEMPTABLE VIEW v2 AS SELECT * FROM t2;
+INSERT INTO t2 VALUES (NULL,1,2),(NULL,2,3);
+SELECT * FROM t1 JOIN v2 ON i1 = i2 WHERE a < b;
+i1 i2 a b
+EXPLAIN EXTENDED
+SELECT * FROM t1 JOIN v2 ON i1 = i2 WHERE a < b;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00
+Warnings:
+Note 1003 select NULL AS `i1`,`v2`.`i2` AS `i2`,`v2`.`a` AS `a`,`v2`.`b` AS `b` from `test`.`v2` where ((`v2`.`i2` = NULL) and (`v2`.`a` < `v2`.`b`))
+DROP VIEW v2;
+DROP TABLE t1,t2;
SET optimizer_switch=@save_optimizer_switch;