1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Manual merge

This commit is contained in:
igor@rurik.mysql.com
2005-07-28 13:39:06 -07:00
3 changed files with 64 additions and 1 deletions

View File

@@ -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