diff options
author | Sergei Golubchik <serg@mariadb.org> | 2014-12-02 22:25:16 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2014-12-02 22:25:16 +0100 |
commit | 853077ad7e81be1ade20b4beab1b95d5766d87b1 (patch) | |
tree | 4c158691947ba7beb4577f26b160f243eabf39ef /mysql-test/include | |
parent | bf3b4a23f75de50e0f1ab4a562e5801dabc7305b (diff) | |
parent | 2b5db1d5bcd7b46b654d59a07fc119ef6a6b8651 (diff) | |
download | mariadb-git-853077ad7e81be1ade20b4beab1b95d5766d87b1.tar.gz |
Merge branch '10.0' into bb-10.1-merge
Conflicts:
.bzrignore
VERSION
cmake/plugin.cmake
debian/dist/Debian/control
debian/dist/Ubuntu/control
mysql-test/r/join_outer.result
mysql-test/r/join_outer_jcl6.result
mysql-test/r/null.result
mysql-test/r/old-mode.result
mysql-test/r/union.result
mysql-test/t/join_outer.test
mysql-test/t/null.test
mysql-test/t/old-mode.test
mysql-test/t/union.test
packaging/rpm-oel/mysql.spec.in
scripts/mysql_config.sh
sql/ha_ndbcluster.cc
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_cond.cc
sql/item_cmpfunc.h
sql/lock.cc
sql/sql_select.cc
sql/sql_show.cc
sql/sql_update.cc
sql/sql_yacc.yy
storage/innobase/buf/buf0flu.cc
storage/innobase/fil/fil0fil.cc
storage/innobase/include/srv0srv.h
storage/innobase/lock/lock0lock.cc
storage/tokudb/CMakeLists.txt
storage/xtradb/buf/buf0flu.cc
storage/xtradb/fil/fil0fil.cc
storage/xtradb/include/srv0srv.h
storage/xtradb/lock/lock0lock.cc
support-files/mysql.spec.sh
Diffstat (limited to 'mysql-test/include')
-rw-r--r-- | mysql-test/include/ctype_like_cond_propagation.inc | 39 | ||||
-rw-r--r-- | mysql-test/include/ctype_like_cond_propagation_utf8_german.inc | 16 | ||||
-rw-r--r-- | mysql-test/include/function_defaults.inc | 26 | ||||
-rw-r--r-- | mysql-test/include/not_embedded.inc | 7 | ||||
-rw-r--r-- | mysql-test/include/restart_mysqld.inc | 1 | ||||
-rw-r--r-- | mysql-test/include/rpl_connect.inc | 2 | ||||
-rw-r--r-- | mysql-test/include/show_events.inc | 1 | ||||
-rw-r--r-- | mysql-test/include/wait_innodb_all_purged.inc | 59 |
8 files changed, 139 insertions, 12 deletions
diff --git a/mysql-test/include/ctype_like_cond_propagation.inc b/mysql-test/include/ctype_like_cond_propagation.inc new file mode 100644 index 00000000000..023cf2b1b30 --- /dev/null +++ b/mysql-test/include/ctype_like_cond_propagation.inc @@ -0,0 +1,39 @@ +--echo # +--echo # MDEV-7149 Constant condition propagation erroneously applied for LIKE +--echo # + +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE CONCAT(c1)='a'; +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a '; +SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1); +SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '% '=CONCAT(c1); +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '%'=CONCAT(c1); +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +DROP TABLE t1; diff --git a/mysql-test/include/ctype_like_cond_propagation_utf8_german.inc b/mysql-test/include/ctype_like_cond_propagation_utf8_german.inc new file mode 100644 index 00000000000..2cfa89448bc --- /dev/null +++ b/mysql-test/include/ctype_like_cond_propagation_utf8_german.inc @@ -0,0 +1,16 @@ +--echo # +--echo # MDEV-7149 Constant condition propagation erroneously applied for LIKE +--echo # + +CREATE TABLE t1 AS SELECT REPEAT('a',10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('ae'),('ä'); +SELECT * FROM t1 WHERE c1='ä'; +SELECT * FROM t1 WHERE c1 LIKE 'ae'; +SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; +EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; +SELECT * FROM t1 WHERE CONCAT(c1)='ä'; +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'ae'; +SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'; +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'; +DROP TABLE IF EXISTS t1; diff --git a/mysql-test/include/function_defaults.inc b/mysql-test/include/function_defaults.inc index e588c82df1b..cb8e8f86f93 100644 --- a/mysql-test/include/function_defaults.inc +++ b/mysql-test/include/function_defaults.inc @@ -408,15 +408,28 @@ UPDATE t1 SET c = 2; SELECT * FROM t1; --echo # +--echo # Test that ON UPDATE CURRENT_TIMESTAMP works after non-changing UPDATE. +--echo # + +--echo # 2011-04-20 09:54:13 UTC +SET TIMESTAMP = 1303293253.794613; + +UPDATE t1 SET c = 2, b = '2011-04-20 09:53:41.794613'; +SELECT * FROM t1; + +UPDATE t1 SET c = 3; +SELECT * FROM t1; + +--echo # --echo # Test of multiple-table UPDATE for ON UPDATE CURRENT_TIMESTAMP --echo # --echo # 2011-04-20 15:06:13 UTC SET TIMESTAMP = 1303311973.534231; -UPDATE t1 t11, t1 t12 SET t11.c = 2; +UPDATE t1 t11, t1 t12 SET t11.c = 3; SELECT * FROM t1; -UPDATE t1 t11, t1 t12 SET t11.c = 3; +UPDATE t1 t11, t1 t12 SET t11.c = 2; SELECT * FROM t1; DROP TABLE t1; @@ -1037,7 +1050,7 @@ SET TIME_ZONE = "+03:00"; --echo # 1970-01-01 03:16:40 SET TIMESTAMP = 1000.123456; -eval CREATE TABLE t1 ( a INT, b $timestamp NOT NULL DEFAULT $current_timestamp ON UPDATE $current_timestamp) ENGINE = INNODB; +eval CREATE TABLE t1 ( a INT, b $timestamp NOT NULL DEFAULT $current_timestamp ON UPDATE $current_timestamp); SHOW CREATE TABLE t1; @@ -1094,10 +1107,10 @@ eval CREATE TABLE t1 ( b INT, ts $timestamp NOT NULL DEFAULT $current_timestamp ON UPDATE $current_timestamp, PRIMARY KEY ( a, ts ) -) ENGINE = INNODB; +); INSERT INTO t1( a, b, ts ) VALUES ( 1, 0, '2000-09-28 17:44:34' ); -eval CREATE TABLE t2 ( a INT ) ENGINE = INNODB; +eval CREATE TABLE t2 ( a INT ); INSERT INTO t2 VALUES ( 1 ); UPDATE t1 STRAIGHT_JOIN t2 @@ -1133,8 +1146,7 @@ eval ALTER TABLE t1 ADD COLUMN c4 $datetime ON UPDATE $now AFTER c3; eval ALTER TABLE t1 ADD COLUMN c5 $datetime DEFAULT $now AFTER c4; eval ALTER TABLE t1 ADD COLUMN c6 $datetime DEFAULT $now ON UPDATE $now AFTER c5; -SELECT * FROM t1; - +query_vertical SELECT * FROM t1; DROP TABLE t1; diff --git a/mysql-test/include/not_embedded.inc b/mysql-test/include/not_embedded.inc index c3a9c3e12c8..88185af3b15 100644 --- a/mysql-test/include/not_embedded.inc +++ b/mysql-test/include/not_embedded.inc @@ -4,8 +4,7 @@ # # The test below is redundant --- require r/not_embedded.require -disable_query_log; -select version() like '%embedded%' as 'have_embedded'; -enable_query_log; +if (`select version() like '%embedded%'`) { + This should never happen; +} diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc index 49f6dfd5364..3d53fada870 100644 --- a/mysql-test/include/restart_mysqld.inc +++ b/mysql-test/include/restart_mysqld.inc @@ -1,3 +1,4 @@ +--source include/not_embedded.inc if ($rpl_inited) { diff --git a/mysql-test/include/rpl_connect.inc b/mysql-test/include/rpl_connect.inc index 95912d57469..11927833f53 100644 --- a/mysql-test/include/rpl_connect.inc +++ b/mysql-test/include/rpl_connect.inc @@ -42,7 +42,7 @@ if (!$rpl_connection_name) --let $_rpl_port= \$SERVER_MYPORT_$rpl_server_number if (!$_rpl_port) { - --echo Bug in test case: '\$SERVER_MYPORT_$rpl_server_number' not initialized. Check the test's .cfg file. + --echo Bug in test case: '\$SERVER_MYPORT_$rpl_server_number' not initialized. Check the test's .cnf file. --die Not all SERVER_MYPORT_* environment variables are setup correctly. } diff --git a/mysql-test/include/show_events.inc b/mysql-test/include/show_events.inc index 9a39ec67d0e..7917b6740cf 100644 --- a/mysql-test/include/show_events.inc +++ b/mysql-test/include/show_events.inc @@ -88,6 +88,7 @@ let $script= s{SQL_LOAD-[a-z,0-9,-]*.[a-z]*}{SQL_LOAD-<SERVER UUID>-<MASTER server-id>-<file-id>.<extension>}; s{rand_seed1=[0-9]*,rand_seed2=[0-9]*}{rand_seed1=<seed 1>,rand_seed2=<seed 2>}; s{((?:master|slave|slave-relay)-bin\.[0-9]{6};pos=)[0-9]+DOLLAR}{DOLLAR1POS}; + s{SONAME ".*"}{SONAME "LIB"}; s{DOLLARmysqltest_vardir}{MYSQLTEST_VARDIR}g; || --let $pre_script= my DOLLARmysqltest_vardir = DOLLARENV{'MYSQLTEST_VARDIR'}; diff --git a/mysql-test/include/wait_innodb_all_purged.inc b/mysql-test/include/wait_innodb_all_purged.inc new file mode 100644 index 00000000000..97b038acc44 --- /dev/null +++ b/mysql-test/include/wait_innodb_all_purged.inc @@ -0,0 +1,59 @@ +# include/wait_innodb_all_purged.inc +# +# SUMMARY +# +# Waits until purged all undo records of innodb, or operation times out. +# +# USAGE +# +# --source include/wait_innodb_all_purged.inc +# +--source include/have_innodb.inc +--source include/have_debug.inc + +--disable_query_log + +let $wait_counter_init= 300; +if ($wait_timeout) +{ + let $wait_counter_init= `SELECT $wait_timeout * 10`; +} +# Reset $wait_timeout so that its value won't be used on subsequent +# calls, and default will be used instead. +let $wait_timeout= 0; + +let $wait_counter= $wait_counter_init; + +# Keep track of how many times the wait condition is tested +let $wait_condition_reps= 0; +let $prev_trx_age= 0; +while ($wait_counter) +{ + let $trx_age = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS +WHERE VARIABLE_NAME = 'INNODB_PURGE_TRX_ID_AGE';`; + + if ($trx_age != $prev_trx_age) + { + let $wait_counter= $wait_counter_init; + let $prev_trx_age= $trx_age; + } + + let $success= `SELECT $trx_age < 1`; + inc $wait_condition_reps; + if ($success) + { + let $wait_counter= 0; + } + if (!$success) + { + set global innodb_purge_run_now=ON; + real_sleep 0.1; + dec $wait_counter; + } +} +if (!$success) +{ + echo Timeout in wait_innodb_all_purged.inc for INNODB_PURGE_TRX_ID_AGE = $trx_age; +} + +--enable_query_log |