summaryrefslogtreecommitdiff
path: root/mysql-test/t/null_key.test
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-07-28 13:39:06 -0700
committerunknown <igor@rurik.mysql.com>2005-07-28 13:39:06 -0700
commit0cd0a4630118de6852780214d97a2acb8401b238 (patch)
tree525416d5dbb9d3497b821dda0b72fcd903e0c4e4 /mysql-test/t/null_key.test
parent4456ae328d5d9b1cf7077ff1eb7707ebf03472dc (diff)
parent74e523d259552645067155e2acb87e30d6068d87 (diff)
downloadmariadb-git-0cd0a4630118de6852780214d97a2acb8401b238.tar.gz
Manual merge
sql/sql_select.cc: Auto merged
Diffstat (limited to 'mysql-test/t/null_key.test')
-rw-r--r--mysql-test/t/null_key.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/null_key.test b/mysql-test/t/null_key.test
index 37a1dc439a7..4952d6ac8e2 100644
--- a/mysql-test/t/null_key.test
+++ b/mysql-test/t/null_key.test
@@ -192,4 +192,29 @@ delete from t1 where id <=> NULL;
select * from t1;
drop table t1;
+#
+# Test for bug #12144: optimizations for key access with null keys
+# used for outer joins
+#
+
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int, b int, INDEX idx(a));
+CREATE TABLE t3 (b int, INDEX idx(b));
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+INSERT INTO t2 VALUES (1, 1), (3, 1);
+INSERT INTO t3 VALUES
+ (NULL), (NULL), (NULL), (NULL), (NULL),
+ (NULL), (NULL), (NULL), (NULL), (NULL),
+ (2);
+ANALYZE table t1, t2, t3;
+
+EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
+ LEFT JOIN t3 ON t2.b=t3.b;
+
+SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
+ LEFT JOIN t3 ON t2.b=t3.b;
+
+SELECT FOUND_ROWS();
+
+DROP TABLE t1,t2,t3;
# End of 4.1 tests