diff options
author | unknown <igor@rurik.mysql.com> | 2005-07-28 21:28:20 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2005-07-28 21:28:20 -0700 |
commit | 48abe1d664a196fedca8964eecc40cd76ae1203b (patch) | |
tree | 0133743f252d5786309a3f6e0655b935d21c7100 /mysql-test/t/null_key.test | |
parent | 90b2daa7133cfab02017ff9ffc44d5e8089c0c31 (diff) | |
parent | 21d2fb6287347659dd6ce5835ddf16cd3be50279 (diff) | |
download | mariadb-git-48abe1d664a196fedca8964eecc40cd76ae1203b.tar.gz |
Manual merge
configure.in:
Auto merged
mysql-test/r/null_key.result:
Auto merged
mysql-test/t/null_key.test:
Auto merged
sql/sql_select.cc:
Auto merged
support-files/mysql.spec.sh:
Auto merged
Diffstat (limited to 'mysql-test/t/null_key.test')
-rw-r--r-- | mysql-test/t/null_key.test | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/t/null_key.test b/mysql-test/t/null_key.test index 318e1fa6b9b..ff8a4ff924c 100644 --- a/mysql-test/t/null_key.test +++ b/mysql-test/t/null_key.test @@ -194,4 +194,49 @@ 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)); +CREATE TABLE t4 (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); +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t3 VALUES (2), (3); + +ANALYZE table t1, t2, t3; + +SELECT COUNT(*) FROM 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; +FLUSH STATUS ; +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a + LEFT JOIN t3 ON t2.b=t3.b; +SHOW STATUS LIKE "handler_read%"; +SELECT FOUND_ROWS(); + +DROP TABLE t1,t2,t3,t4; # End of 4.1 tests |