diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_str.result | 7 | ||||
-rw-r--r-- | mysql-test/r/outfile.result | bin | 1130 -> 1159 bytes | |||
-rw-r--r-- | mysql-test/r/rpl_temporary.result | 2 | ||||
-rw-r--r-- | mysql-test/r/select.result | 19 | ||||
-rw-r--r-- | mysql-test/t/func_str.test | 9 | ||||
-rw-r--r-- | mysql-test/t/outfile.test | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl_temporary.test | 14 | ||||
-rw-r--r-- | mysql-test/t/select.test | 21 |
8 files changed, 67 insertions, 6 deletions
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 0b706b24488..960a5178fd8 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1017,6 +1017,13 @@ t 1000000 1 drop table t1; +select load_file("lkjlkj"); +load_file("lkjlkj") +NULL +select ifnull(load_file("lkjlkj"),"it's null"); +ifnull(load_file("lkjlkj"),"it's null") +it's null +End of 4.1 tests create table t1 (d decimal default null); insert into t1 values (null); select format(d, 2) from t1; diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result Binary files differindex ee8c3249c9d..040dff576f8 100644 --- a/mysql-test/r/outfile.result +++ b/mysql-test/r/outfile.result diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/r/rpl_temporary.result index 929dc33c447..7f6fa17e11c 100644 --- a/mysql-test/r/rpl_temporary.result +++ b/mysql-test/r/rpl_temporary.result @@ -94,8 +94,6 @@ create temporary table t102 (id int); set @session.pseudo_thread_id=200; create temporary table t201 (id int); create temporary table `#not_user_table_prefixed_with_hash_sign_no_harm` (id int); -set @con1_id=connection_id(); -kill @con1_id; create table t1(f int); insert into t1 values (1); select * from t1 /* must be 1 */; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 19e1b67fd74..f45e16f66c1 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3427,3 +3427,22 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE A range PRIMARY PRIMARY 12 NULL 3 Using where 1 SIMPLE B ref PRIMARY PRIMARY 8 const,test.A.e 10 drop table t1, t2; +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), +(3,1), (5,1), (8,9), (2,2), (0,9); +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES +(1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), +(5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), +(0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY,b b 5 NULL 3 Using where +1 SIMPLE t2 ref c c 5 test.t1.a 2 Using where +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY,b b 5 NULL 3 Using where +1 SIMPLE t2 ref c c 5 test.t1.a 2 Using where +DROP TABLE t1, t2; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 85cedee0f4a..dee06231deb 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -666,7 +666,14 @@ select rpad(i, 7, ' ') as t from t1; --disable_metadata drop table t1; -# End of 4.1 tests +# +# Bug #10418: LOAD_FILE does not behave like in manual if file does not exist +# + +select load_file("lkjlkj"); +select ifnull(load_file("lkjlkj"),"it's null"); + +--echo End of 4.1 tests # # Bug #13361: SELECT FORMAT(<decimal field with null>, 2) crashes diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test index d404a6fff9f..c48e6c9730d 100644 --- a/mysql-test/t/outfile.test +++ b/mysql-test/t/outfile.test @@ -40,7 +40,6 @@ eval select * into dumpfile "../tmp/outfile-test.2" from t1; --error 1086 eval select * into dumpfile "../tmp/outfile-test.3" from t1; enable_query_log; ---error 13,2 select load_file(concat(@tmpdir,"/outfile-test.not-exist")); --exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.1 --exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.2 diff --git a/mysql-test/t/rpl_temporary.test b/mysql-test/t/rpl_temporary.test index 612ab54dff1..93e22e74597 100644 --- a/mysql-test/t/rpl_temporary.test +++ b/mysql-test/t/rpl_temporary.test @@ -171,8 +171,18 @@ create temporary table t102 (id int); set @session.pseudo_thread_id=200; create temporary table t201 (id int); create temporary table `#not_user_table_prefixed_with_hash_sign_no_harm` (id int); -set @con1_id=connection_id(); -kill @con1_id; + +# +# Don't kill our own connection to the server as +# the result code differs depending on platform. +# +# Select the id to kill into a variable of mysqltest +let $con1_id= `select connection_id()`; +# Switch connection to avoid killing our own connection +connection master; +--disable_query_log +eval kill $con1_id; +--enable_query_log #now do something to show that slave is ok after DROP temp tables connection master; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 033350d138a..4b6ae921b9b 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2899,3 +2899,24 @@ select 'In next EXPLAIN, B.rows must be exactly 10:' Z; explain select * from t2 A, t2 B where A.a=5 and A.b=5 and A.C<5 and B.a=5 and B.b=A.e and (B.b =1 or B.b = 3 or B.b=5); drop table t1, t2; + +# +#Bug #18940: selection of optimal execution plan caused by equality +# propagation (the bug was fixed by the patch for bug #17379) + +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), + (3,1), (5,1), (8,9), (2,2), (0,9); + +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES + (1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), + (5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), + (0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); + +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; + +DROP TABLE t1, t2; |