From a54ddda4c826a4142f9fb779a58577528f525d73 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 16:04:47 -0700 Subject: [PATCH] null_key.test, null_key.result: Modified the test case for patch of the bug #12144 to display status of Handler_read_next before and after the tested query. mysql-test/r/null_key.result: Modified the test case for patch of the bug #12144 to display status of Handler_read_next before and after the tested query. mysql-test/t/null_key.test: Modified the test case for patch of the bug #12144 to display status of Handler_read_next before and after the tested query. --- mysql-test/r/null_key.result | 42 +++++++++++++++++++++++++++++++++--- mysql-test/t/null_key.test | 30 +++++++++++++++++++++++--- 2 files changed, 66 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index 9f11a0129cd..89f9663f527 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -367,23 +367,51 @@ drop table t1; 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), -(2); +(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; Table Op Msg_type Msg_text test.t1 analyze status OK test.t2 analyze status OK test.t3 analyze status OK +SELECT COUNT(*) FROM t3; +COUNT(*) +15972 EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 1 SIMPLE t2 ref idx idx 5 test.t1.a 1 1 SIMPLE t3 ref idx idx 5 test.t2.b 1 Using index +SHOW STATUS LIKE "handler_read%"; +Variable_name Value +Handler_read_first 25 +Handler_read_key 63 +Handler_read_next 25979 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 147 SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b; a a b b @@ -391,7 +419,15 @@ a a b b 2 NULL NULL NULL 3 3 1 NULL 4 NULL NULL NULL +SHOW STATUS LIKE "handler_read%"; +Variable_name Value +Handler_read_first 25 +Handler_read_key 69 +Handler_read_next 25981 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 152 SELECT FOUND_ROWS(); FOUND_ROWS() 4 -DROP TABLE t1,t2,t3; +DROP TABLE t1,t2,t3,t4; diff --git a/mysql-test/t/null_key.test b/mysql-test/t/null_key.test index 4952d6ac8e2..228b00d528a 100644 --- a/mysql-test/t/null_key.test +++ b/mysql-test/t/null_key.test @@ -200,21 +200,45 @@ drop table t1; 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), - (2); + (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; +SHOW STATUS LIKE "handler_read%"; + 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; +DROP TABLE t1,t2,t3,t4; # End of 4.1 tests