diff options
Diffstat (limited to 'mysql-test/include')
81 files changed, 654 insertions, 346 deletions
diff --git a/mysql-test/include/big_test.inc b/mysql-test/include/big_test.inc index 6b149540c96..6bc6776d3bb 100644 --- a/mysql-test/include/big_test.inc +++ b/mysql-test/include/big_test.inc @@ -1,4 +1,4 @@ ---require r/big_test.require +--require include/big_test.require disable_query_log; eval select $BIG_TEST as using_big_test; enable_query_log; diff --git a/mysql-test/include/big_test.require b/mysql-test/include/big_test.require new file mode 100644 index 00000000000..001b903496b --- /dev/null +++ b/mysql-test/include/big_test.require @@ -0,0 +1,2 @@ +using_big_test +1 diff --git a/mysql-test/include/case_insensitive_file_system.require b/mysql-test/include/case_insensitive_file_system.require new file mode 100644 index 00000000000..062ac610ddd --- /dev/null +++ b/mysql-test/include/case_insensitive_file_system.require @@ -0,0 +1,2 @@ +Variable_name Value +lower_case_file_system ON diff --git a/mysql-test/include/case_insensitive_fs.require b/mysql-test/include/case_insensitive_fs.require new file mode 100644 index 00000000000..062ac610ddd --- /dev/null +++ b/mysql-test/include/case_insensitive_fs.require @@ -0,0 +1,2 @@ +Variable_name Value +lower_case_file_system ON diff --git a/mysql-test/include/case_sensitive_file_system.require b/mysql-test/include/case_sensitive_file_system.require new file mode 100644 index 00000000000..d0bdc6bf4ce --- /dev/null +++ b/mysql-test/include/case_sensitive_file_system.require @@ -0,0 +1,2 @@ +Variable_name Value +lower_case_file_system OFF diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test index a21acee624b..44aa4472cba 100644 --- a/mysql-test/include/check-testcase.test +++ b/mysql-test/include/check-testcase.test @@ -70,10 +70,13 @@ if ($tmp) --echo SQL_Delay 0 --echo SQL_Remaining_Delay NULL --echo Slave_SQL_Running_State + --echo Slave_DDL_Groups # + --echo Slave_Non_Transactional_Groups # + --echo Slave_Transactional_Groups # } if (!$tmp) { # Note: after WL#5177, fields 13-18 shall not be filtered-out. - --replace_column 4 # 5 # 6 # 7 # 8 # 9 # 10 # 13 # 14 # 15 # 16 # 17 # 18 # 22 # 23 # 24 # 25 # 26 # 40 # 41 # 42 # 44 # + --replace_column 4 # 5 # 6 # 7 # 8 # 9 # 10 # 13 # 14 # 15 # 16 # 17 # 18 # 22 # 23 # 24 # 25 # 26 # 40 # 41 # 42 # 44 # 51 # 52 # 53 # query_vertical SHOW SLAVE STATUS; } @@ -83,7 +86,7 @@ call mtr.check_testcase(); let $datadir=`select @@datadir`; list_files $datadir mysql_upgrade_info; list_files_write_file $datadir.tempfiles.txt $datadir/test #sql*; ---replace_regex /#sql-ib[0-9a-f-]+\.ibd\n// +--replace_regex /#sql-ib[0-9a-f]+\.ibd\n// cat_file $datadir.tempfiles.txt; remove_file $datadir.tempfiles.txt; list_files $datadir/mysql #sql*; diff --git a/mysql-test/include/check-warnings.test b/mysql-test/include/check-warnings.test index b2f73c32e35..be347ba46ec 100644 --- a/mysql-test/include/check-warnings.test +++ b/mysql-test/include/check-warnings.test @@ -36,7 +36,7 @@ create temporary table error_log ( let $log_error= $MTR_LOG_ERROR; let $log_warning= $log_error.warnings; -# Try tload the warnings into a temporary table, +# Try to load the warnings into a temporary table, # it might fail with error saying "The MySQL server is # running with the --secure-file-priv" in which case # an attempt to load the file using LOAD DATA LOCAL is made diff --git a/mysql-test/include/check_var_limit.inc b/mysql-test/include/check_var_limit.inc index f955aeb345e..7fd886c6aba 100644 --- a/mysql-test/include/check_var_limit.inc +++ b/mysql-test/include/check_var_limit.inc @@ -3,7 +3,7 @@ # This is useful to check that a variable from SHOW_VARIABLES is within # certain limits. Check query_cache_merge.test for an example of using this. # --- require r/check_var_limit.require +-- require include/check_var_limit.require disable_query_log; eval select SUBSTRING_INDEX("$LIMIT", "\\t", -1) BETWEEN $MIN_LIMIT AND $MAX_LIMIT as "limit"; enable_query_log; diff --git a/mysql-test/include/check_var_limit.require b/mysql-test/include/check_var_limit.require new file mode 100644 index 00000000000..01a59782180 --- /dev/null +++ b/mysql-test/include/check_var_limit.require @@ -0,0 +1,2 @@ +limit +1 diff --git a/mysql-test/include/column_compression_rpl.inc b/mysql-test/include/column_compression_rpl.inc new file mode 100644 index 00000000000..7c8931a491f --- /dev/null +++ b/mysql-test/include/column_compression_rpl.inc @@ -0,0 +1,260 @@ + +--connection slave + +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; + +--connection master +if (!$engine_type) {let $engine_type=`SELECT @@storage_engine`; let $engine_type2=`SELECT @@storage_engine`;} + +--disable_warnings +DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +--enable_warnings + +echo --------------------------------------------------------------------------------------------------------------; +echo --------------------------------------------COMPRESSED TO COMPRESSED------------------------------------------; +echo --------------------------------------------------------------------------------------------------------------; + +--sync_slave_with_master +eval CREATE TABLE t1 (a BLOB COMPRESSED default "1111111111") ENGINE=$engine_type2; +eval CREATE TABLE t2 (a TINYBLOB COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t3 (a MEDIUMBLOB COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t4 (a LONGBLOB COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t5 (a TEXT COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t6 (a TINYTEXT COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t7 (a MEDIUMTEXT COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t8 (a LONGTEXT COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t9 (a VARCHAR(10000) COMPRESSED default "0") ENGINE=$engine_type2; +eval CREATE TABLE t10 (a VARBINARY(10000) COMPRESSED) ENGINE=$engine_type2; + +--connection master +eval CREATE TABLE t1 (a BLOB COMPRESSED default "1111111111") ENGINE=$engine_type; +eval CREATE TABLE t2 (a TINYBLOB COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE t3 (a MEDIUMBLOB COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE t4 (a LONGBLOB COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE t5 (a TEXT COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE t6 (a TINYTEXT COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE t7 (a MEDIUMTEXT COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE t8 (a LONGTEXT COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE t9 (a VARCHAR(10000) COMPRESSED default "0") ENGINE=$engine_type; +eval CREATE TABLE t10 (a VARBINARY(10000) COMPRESSED) ENGINE=$engine_type; + +INSERT INTO t1(a) VALUES(REPEAT('a',1000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL),(default); +INSERT INTO t2(a) VALUES(REPEAT('a',100)),(REPEAT('v',200)),(REPEAT('r',254)),(NULL); +INSERT INTO t3(a) VALUES(REPEAT('a',100)),(REPEAT('v',2000)),("April"),(NULL); +INSERT INTO t4(a) VALUES(REPEAT('a',10000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL),("00-00-00"); +INSERT INTO t5(a) VALUES(REPEAT('a',1000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL); +INSERT INTO t6(a) VALUES(REPEAT('a',100)),(REPEAT('v',200)),(REPEAT('r',254)),(NULL); +INSERT INTO t7(a) VALUES(REPEAT('a',100)),(REPEAT('v',200)),(REPEAT('r',3000)),(NULL); +INSERT INTO t8(a) VALUES(REPEAT('a',10000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL),("qwerty"); +INSERT INTO t9(a) VALUES(REPEAT('a',1000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL),("12-12-2009"),(default); +INSERT INTO t10(a) VALUES(REPEAT('a',1000)),(REPEAT('v',2000)),(REPEAT('r',300)),(NULL), (""); + +echo --------------------------------------------------data on master------------------------------------------------; + +let $a= 10; +while ($a) +{ + --sorted_result + eval SELECT LENGTH(a), SUBSTRING(a,1,10), "M,compressed" from t$a; + --sorted_result + eval SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t$a'; + dec $a; +} +SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_compressions', 'Column_decompressions'); + +echo --------------------------------------------------data on slave-------------------------------------------------; + +--sync_slave_with_master +let $a= 10; +while ($a) +{ + --sorted_result + eval SELECT LENGTH(a), SUBSTRING(a,1,10), "S,compressed" from t$a; + --sorted_result + eval SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t$a'; + dec $a; +} + +SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_compressions', 'Column_decompressions'); + +--connection master +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +FLUSH STATUS; + +echo -----------------------------------------------------------------------------------------------------------------; +echo ---------------------------------------COMPRESSED TO NOT COMPRESSED----------------------------------------------; +echo -----------------------------------------------------------------------------------------------------------------; + +--sync_slave_with_master +FLUSH STATUS; +eval CREATE TABLE t1 (a BLOB) ENGINE=$engine_type2; +eval CREATE TABLE t2 (a TINYBLOB) ENGINE=$engine_type2; +eval CREATE TABLE t3 (a MEDIUMBLOB) ENGINE=$engine_type2; +eval CREATE TABLE t4 (a LONGBLOB) ENGINE=$engine_type2; +eval CREATE TABLE t5 (a TEXT) ENGINE=$engine_type2; +eval CREATE TABLE t6 (a TINYTEXT) ENGINE=$engine_type2; +eval CREATE TABLE t7 (a MEDIUMTEXT) ENGINE=$engine_type2; +eval CREATE TABLE t8 (a LONGTEXT) ENGINE=$engine_type2; +eval CREATE TABLE t9 (a VARCHAR(10000)) ENGINE=$engine_type2; +eval CREATE TABLE t10 (a VARBINARY(10000)) ENGINE=$engine_type2; + +--connection master +eval CREATE TABLE IF NOT EXISTS t1 (a BLOB COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t2 (a TINYBLOB COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t3 (a MEDIUMBLOB COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t4 (a LONGBLOB COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t5 (a TEXT COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t6 (a TINYTEXT COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t7 (a MEDIUMTEXT COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t8 (a LONGTEXT COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t9 (a VARCHAR(10000) COMPRESSED) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t10 (a VARBINARY(10000) COMPRESSED) ENGINE=$engine_type; + +INSERT INTO t1(a) VALUES(REPEAT('a',1000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL); +INSERT INTO t2(a) VALUES(REPEAT('a',100)),(REPEAT('v',200)),(REPEAT('r',254)),(NULL); +INSERT INTO t3(a) VALUES(REPEAT('a',100)),(REPEAT('v',2000)),("April"),(NULL); +INSERT INTO t4(a) VALUES(REPEAT('a',10000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL),("00-00-00"); +INSERT INTO t5(a) VALUES(REPEAT('a',1000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL); +INSERT INTO t6(a) VALUES(REPEAT('a',100)),(REPEAT('v',200)),(REPEAT('r',254)),(NULL); +INSERT INTO t7(a) VALUES(REPEAT('a',100)),(REPEAT('v',200)),(REPEAT('r',3000)),(NULL); +INSERT INTO t8(a) VALUES(REPEAT('a',10000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL),("qwerty"); +INSERT INTO t9(a) VALUES(REPEAT('a',1000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL),("12-12-2009"); +INSERT INTO t10(a) VALUES(REPEAT('a',1000)),(REPEAT('v',2000)),(REPEAT('r',300)),(NULL), (""); + +echo ---------------------------------------data on master-----------------------------------------------------------; + +let $a= 10; +while ($a) +{ + --sorted_result + eval SELECT LENGTH(a),SUBSTRING(a,1,10), "M,compressed" from t$a; + --sorted_result + eval SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t$a'; + dec $a; +} +SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_compressions', 'Column_decompressions'); + +echo ---------------------------------------data on slave-------------------------------------------------------------; + +--sync_slave_with_master +let $a= 10; +while ($a) +{ + --sorted_result + eval SELECT LENGTH(a), SUBSTRING(a,1,10), "S,not compressed" from t$a; + --sorted_result + eval SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t$a'; + dec $a; +} + +SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_compressions', 'Column_decompressions'); +--connection master +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +FLUSH STATUS; + +echo -----------------------------------------------------------------------------------------------------------------; +echo -----------------------------------NOT COMPRESSED to COMPRESSED--------------------------------------------------; +echo -----------------------------------------------------------------------------------------------------------------; + +--sync_slave_with_master +FLUSH STATUS; +eval CREATE TABLE t1 (a BLOB COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t2 (a TINYBLOB COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t3 (a MEDIUMBLOB COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t4 (a LONGBLOB COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t5 (a TEXT COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t6 (a TINYTEXT COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t7 (a MEDIUMTEXT COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t8 (a LONGTEXT COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t9 (a VARCHAR(10000) COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t10 (a VARBINARY(10000) COMPRESSED) ENGINE=$engine_type2; + +--connection master +eval CREATE TABLE IF NOT EXISTS t1 (a BLOB) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t2 (a TINYBLOB) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t3 (a MEDIUMBLOB) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t4 (a LONGBLOB) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t5 (a TEXT) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t6 (a TINYTEXT) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t7 (a MEDIUMTEXT) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t8 (a LONGTEXT) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t9 (a VARCHAR(10000)) ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t10 (a VARBINARY(10000)) ENGINE=$engine_type; + +INSERT INTO t1(a) VALUES(REPEAT('a',1000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL); +INSERT INTO t2(a) VALUES(REPEAT('a',100)),(REPEAT('v',200)),(REPEAT('r',254)),(NULL); +INSERT INTO t3(a) VALUES(REPEAT('a',100)),(REPEAT('v',2000)),("April"),(NULL); +INSERT INTO t4(a) VALUES(REPEAT('a',10000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL),("00-00-00"); +INSERT INTO t5(a) VALUES(REPEAT('a',1000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL); +INSERT INTO t6(a) VALUES(REPEAT('a',100)),(REPEAT('v',200)),(REPEAT('r',254)),(NULL); +INSERT INTO t7(a) VALUES(REPEAT('a',100)),(REPEAT('v',200)),(REPEAT('r',3000)),(NULL); +INSERT INTO t8(a) VALUES(REPEAT('a',10000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL),("qwerty"); +INSERT INTO t9(a) VALUES(REPEAT('a',1000)),(REPEAT('v',200)),(REPEAT('r',300)),(NULL),("12-12-2009"); +INSERT INTO t10(a) VALUES(REPEAT('a',1000)),(REPEAT('v',2000)),(REPEAT('r',300)),(NULL), (""); + +echo -----------------------------------data on master---------------------------------------------------------------; + +let $a= 10; +while ($a) +{ + --sorted_result + eval SELECT LENGTH(a),SUBSTRING(a,1,10), "M,not compressed" from t$a; + --sorted_result + eval SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t$a'; + dec $a; +} +SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_compressions', 'Column_decompressions'); + +echo -----------------------------------data on slave-----------------------------------------------------------------; + +--sync_slave_with_master +let $a= 10; +while ($a) +{ + --sorted_result + eval SELECT LENGTH(a), SUBSTRING(a,1,10), "S,compressed" from t$a; + --sorted_result + eval SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t$a'; + dec $a; +} +SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_compressions', 'Column_decompressions'); + +--connection master +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; + +echo -----------------------------------------------------------------------------------------------------------------; +echo ------varchar(1000)->varchar(999) compressed, varchar(1000) compressed->varchar(999) ----------------------------; +echo -----------------------------------------------------------------------------------------------------------------; + +--sync_slave_with_master +eval CREATE TABLE t1 (a VARCHAR(999) COMPRESSED) ENGINE=$engine_type2; +eval CREATE TABLE t2 (a VARCHAR(999)) ENGINE=$engine_type2; +show warnings; +call mtr.add_suppression("Slave: Data too long for column 'a' at row 1 Error_code: 1406"); +call mtr.add_suppression("Slave: Table 't2' already exists Error_code: 1050"); + +--connection master +eval CREATE TABLE IF NOT EXISTS t1 (a VARCHAR(1000))ENGINE=$engine_type; +eval CREATE TABLE IF NOT EXISTS t2 (a VARCHAR(1000) COMPRESSED)ENGINE=$engine_type; + +INSERT INTO t1(a) VALUES(REPEAT('a',1000)); +--connection slave +--let $slave_sql_errno= 1406,1677 +--source include/wait_for_slave_sql_error_and_skip.inc +show warnings; + +--connection master + INSERT INTO t2(a) VALUES(REPEAT('a',1000)); +--connection slave +--let $slave_sql_errno= 1406,1677 +--source include/wait_for_slave_sql_error_and_skip.inc +show warnings; + +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; + +--connection master +DROP TABLE t1,t2; +--sync_slave_with_master + + diff --git a/mysql-test/include/ctype_utf8mb4.inc b/mysql-test/include/ctype_utf8mb4.inc index 2d48f9373f6..cb422f66947 100644 --- a/mysql-test/include/ctype_utf8mb4.inc +++ b/mysql-test/include/ctype_utf8mb4.inc @@ -191,8 +191,10 @@ drop table t1; # if(!$is_heap) { ---error ER_TOO_LONG_KEY +--error 0,ER_TOO_LONG_KEY eval create table t1 (a text character set utf8mb4, primary key(a(371))) engine $engine; +show warnings; +drop table if exists t1; } # diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index 568881ef57e..3107b61cbdf 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -17,7 +17,7 @@ # Default values that applies to all MySQL Servers [mysqld] disable-getopt-prefix-matching - +plugin-maturity=unknown open-files-limit= 1024 local-infile character-set-server= latin1 diff --git a/mysql-test/include/empty_string_literal.inc b/mysql-test/include/empty_string_literal.inc new file mode 100644 index 00000000000..f02b626a484 --- /dev/null +++ b/mysql-test/include/empty_string_literal.inc @@ -0,0 +1,113 @@ +SET SESSION character_set_connection=latin2; +SET SESSION character_set_client=cp1250; + +--echo # +--echo # Test litteral +--echo # +SET sql_mode=@mode; +select @@sql_mode; +SELECT '',CHARSET(''), null, CHARSET(null), CAST(null as char(10)), CHARSET(CAST(null as char(10))), 'x', CHARSET('x'); +SELECT CHARSET(NULLIF('','')),NULLIF('',''); +SET sql_mode=default; +SELECT '',CHARSET(''), null, CHARSET(null), CAST(null as char(10)), CHARSET(CAST(null as char(10))), 'x', CHARSET('x'); +SELECT CHARSET(NULLIF('','')),NULLIF('',''); + +--echo # +--echo # Test NCHAR litteral +--echo # +SET sql_mode=@mode; +SELECT N'',CHARSET(N''), N'x', CHARSET(N'x'); +SELECT CHARSET(NULLIF(N'',N'')),NULLIF(N'',N''); +SET sql_mode=default; +SELECT N'',CHARSET(N''), N'x', CHARSET(N'x'); +SELECT CHARSET(NULLIF(N'',N'')),NULLIF(N'',N''); + +--echo # +--echo # Test CHARSET prefix litteral +--echo # +SET sql_mode=@mode; +SELECT _cp1250 '',CHARSET(_cp1250 ''), _cp1250 'x', CHARSET(_cp1250 'x'); +SELECT CHARSET(NULLIF(_cp1250 '',_cp1250 '')),NULLIF(_cp1250 '',_cp1250 ''); +SET sql_mode=default; +SELECT _cp1250 '',CHARSET(_cp1250 ''), _cp1250 'x', CHARSET(_cp1250 'x'); +SELECT CHARSET(NULLIF(_cp1250 '',_cp1250 '')),NULLIF(_cp1250 '',_cp1250 ''); + + +SET sql_mode=@mode; + +--echo # +--echo # Test litteral concat +--echo # +SELECT 'a' 'b'; +SELECT 'a' ''; +SELECT '' 'b'; +SELECT '' ''; +SELECT '' 'b' 'c'; +SELECT '' '' 'c'; +SELECT 'a' '' 'c'; +SELECT 'a' '' ''; +SELECT '' '' ''; + +SELECT '' '' '',CHARSET('' '' ''); +SELECT _latin1'' '' '',CHARSET(_latin1'' '' ''); +SELECT N'' '' '',CHARSET(N'' '' ''); + +--echo # +--echo # UNION - implicit group by +--echo # +SELECT 1, null +UNION +SELECT 1 , '' +ORDER BY 1; + +SELECT 1, null +UNION +SELECT 1 , N'' +ORDER BY 1; + +SELECT 1, null +UNION +SELECT 1 , _cp1250 '' +ORDER BY 1; + +SELECT NULLIF(_cp1250 '',_cp1250 '') +UNION +SELECT NULLIF(N'',N''); + +--error ER_CANT_AGGREGATE_2COLLATIONS +SELECT 1 , _latin2 '' +UNION +SELECT 1 , _cp1250 ''; + +SELECT 1, null +UNION +SELECT 1 , '' +UNION +SELECT 1 , N''; + +CREATE TABLE t1 (c1 INT,c2 VARCHAR(10)); +INSERT INTO t1 VALUES (1,'one'); +INSERT INTO t1 VALUES (1,''); +INSERT INTO t1 VALUES (1,null); + +--echo # +--echo # Test in a view +--echo # +CREATE VIEW v1 + AS SELECT c1, c2 + FROM t1 + UNION + SELECT c1 , '' + FROM t1 + ORDER BY 1,2; +SELECT * FROM v1; + +SHOW CREATE VIEW v1; + +DROP VIEW v1; +DROP TABLE t1; + +EXPLAIN EXTENDED SELECT ''; +EXPLAIN EXTENDED SELECT _latin1''; +EXPLAIN EXTENDED SELECT N''; +EXPLAIN EXTENDED SELECT '' ''; diff --git a/mysql-test/include/gis_generic.inc b/mysql-test/include/gis_generic.inc index 59acf04dfa2..8209240614e 100644 --- a/mysql-test/include/gis_generic.inc +++ b/mysql-test/include/gis_generic.inc @@ -236,7 +236,7 @@ SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; -SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersects FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; diff --git a/mysql-test/include/have_case_insensitive_file_system.inc b/mysql-test/include/have_case_insensitive_file_system.inc index 78bb7c229ca..1d731ffdb01 100644 --- a/mysql-test/include/have_case_insensitive_file_system.inc +++ b/mysql-test/include/have_case_insensitive_file_system.inc @@ -1,4 +1,4 @@ ---require r/case_insensitive_file_system.require +--require include/case_insensitive_file_system.require --disable_query_log show variables like "lower_case_file_system"; --enable_query_log diff --git a/mysql-test/include/have_case_insensitive_fs.inc b/mysql-test/include/have_case_insensitive_fs.inc index de4ad73d780..16474842700 100644 --- a/mysql-test/include/have_case_insensitive_fs.inc +++ b/mysql-test/include/have_case_insensitive_fs.inc @@ -1,4 +1,4 @@ ---require r/case_insensitive_fs.require +--require include/case_insensitive_fs.require --disable_query_log show variables like 'lower_case_file_system'; --enable_query_log diff --git a/mysql-test/include/have_case_sensitive_file_system.inc b/mysql-test/include/have_case_sensitive_file_system.inc index 7bb1bef93fd..c4df83d333c 100644 --- a/mysql-test/include/have_case_sensitive_file_system.inc +++ b/mysql-test/include/have_case_sensitive_file_system.inc @@ -1,4 +1,4 @@ ---require r/case_sensitive_file_system.require +--require include/case_sensitive_file_system.require --disable_query_log show variables like 'lower_case_file_system'; --enable_query_log diff --git a/mysql-test/include/have_compress.inc b/mysql-test/include/have_compress.inc index 150c7f3448d..d99c1021a1f 100644 --- a/mysql-test/include/have_compress.inc +++ b/mysql-test/include/have_compress.inc @@ -1,4 +1,4 @@ --- require r/have_compress.require +-- require include/have_compress.require disable_query_log; show variables like 'have_compress'; enable_query_log; diff --git a/mysql-test/include/have_compress.require b/mysql-test/include/have_compress.require new file mode 100644 index 00000000000..8bda2190fbe --- /dev/null +++ b/mysql-test/include/have_compress.require @@ -0,0 +1,2 @@ +Variable_name Value +have_compress YES diff --git a/mysql-test/include/have_csv.inc b/mysql-test/include/have_csv.inc index 410caa95285..4b43d41f22f 100644 --- a/mysql-test/include/have_csv.inc +++ b/mysql-test/include/have_csv.inc @@ -1,4 +1,4 @@ disable_query_log; ---require r/true.require +--require include/true.require select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'csv'; enable_query_log; diff --git a/mysql-test/include/have_geometry.inc b/mysql-test/include/have_geometry.inc index f1836469017..ff07eaf395b 100644 --- a/mysql-test/include/have_geometry.inc +++ b/mysql-test/include/have_geometry.inc @@ -1,4 +1,4 @@ ---require r/have_geometry.require +--require include/have_geometry.require --disable_query_log show variables like 'have_geometry'; --enable_query_log diff --git a/mysql-test/include/have_geometry.require b/mysql-test/include/have_geometry.require new file mode 100644 index 00000000000..ba515a4bbb6 --- /dev/null +++ b/mysql-test/include/have_geometry.require @@ -0,0 +1,2 @@ +Variable_name Value +have_geometry YES diff --git a/mysql-test/include/have_innodb.combinations b/mysql-test/include/have_innodb.combinations index 7e9e6b9e3b0..f1131c448f3 100644 --- a/mysql-test/include/have_innodb.combinations +++ b/mysql-test/include/have_innodb.combinations @@ -6,6 +6,7 @@ innodb-cmpmem innodb-cmp-per-index innodb-trx innodb-locks +innodb-lock-waits innodb-buffer-pool-stats innodb-buffer-page innodb-buffer-page-lru @@ -18,42 +19,13 @@ innodb-sys-tables innodb-sys-virtual innodb-metrics -[xtradb_plugin] -ignore-builtin-innodb -plugin-load-add=$HA_XTRADB_SO -innodb -innodb-cmpmem -innodb-cmp-per-index -innodb-trx -innodb-locks -innodb-buffer-pool-stats -innodb-buffer-page -innodb-buffer-page-lru -innodb-sys-foreign -innodb-sys-foreign-cols -innodb-sys-tables -innodb-metrics - -[xtradb] -innodb -innodb-cmpmem -innodb-cmp-per-index -innodb-trx -innodb-locks -innodb-metrics -innodb-buffer-pool-stats -innodb-buffer-page -innodb-buffer-page-lru -innodb-sys-foreign -innodb-sys-foreign-cols -innodb-sys-tables - [innodb] innodb innodb-cmpmem innodb-cmp-per-index innodb-trx innodb-locks +innodb-lock-waits innodb-metrics innodb-buffer-pool-stats innodb-buffer-page diff --git a/mysql-test/include/have_innodb.inc b/mysql-test/include/have_innodb.inc index b89797d5828..69ffdb5b284 100644 --- a/mysql-test/include/have_innodb.inc +++ b/mysql-test/include/have_innodb.inc @@ -1,4 +1,4 @@ # # suite.pm will make sure that all tests including this file -# will be skipped unless innodb or xtradb is enabled +# will be skipped unless innodb is enabled # diff --git a/mysql-test/include/have_local_infile.inc b/mysql-test/include/have_local_infile.inc index 4a1362c6e30..e42343e628b 100644 --- a/mysql-test/include/have_local_infile.inc +++ b/mysql-test/include/have_local_infile.inc @@ -1,4 +1,4 @@ ---require r/have_local_infile.require +--require include/have_local_infile.require disable_query_log; show variables like 'local_infile'; enable_query_log; diff --git a/mysql-test/include/have_local_infile.require b/mysql-test/include/have_local_infile.require new file mode 100644 index 00000000000..124540f7b77 --- /dev/null +++ b/mysql-test/include/have_local_infile.require @@ -0,0 +1,2 @@ +Variable_name Value +local_infile ON diff --git a/mysql-test/include/have_log_bin.inc b/mysql-test/include/have_log_bin.inc index e51205d25ad..eb2529dae3b 100644 --- a/mysql-test/include/have_log_bin.inc +++ b/mysql-test/include/have_log_bin.inc @@ -8,7 +8,7 @@ source include/not_embedded.inc; --- require r/have_log_bin.require +-- require include/have_log_bin.require disable_query_log; show variables like 'log_bin'; enable_query_log; diff --git a/mysql-test/include/have_log_bin.require b/mysql-test/include/have_log_bin.require new file mode 100644 index 00000000000..d4fd77e4f8d --- /dev/null +++ b/mysql-test/include/have_log_bin.require @@ -0,0 +1,2 @@ +Variable_name Value +log_bin ON diff --git a/mysql-test/include/have_lowercase0.inc b/mysql-test/include/have_lowercase0.inc index 9cd21a42f6a..850e3a4cd39 100644 --- a/mysql-test/include/have_lowercase0.inc +++ b/mysql-test/include/have_lowercase0.inc @@ -1,4 +1,4 @@ ---require r/lowercase0.require +--require include/lowercase0.require --disable_query_log show variables like "lower_case_table_names"; --enable_query_log diff --git a/mysql-test/include/have_lowercase1.inc b/mysql-test/include/have_lowercase1.inc index 1b33432dbe3..5be06cf4d6b 100644 --- a/mysql-test/include/have_lowercase1.inc +++ b/mysql-test/include/have_lowercase1.inc @@ -1,4 +1,4 @@ ---require r/lowercase1.require +--require include/lowercase1.require --disable_query_log show variables like 'lower_case_table_names'; --enable_query_log diff --git a/mysql-test/include/have_lowercase2.inc b/mysql-test/include/have_lowercase2.inc index 43b34653f54..1816cd89611 100644 --- a/mysql-test/include/have_lowercase2.inc +++ b/mysql-test/include/have_lowercase2.inc @@ -1,4 +1,4 @@ ---require r/lowercase2.require +--require include/lowercase2.require --disable_query_log show variables like 'lower_case_table_names'; --enable_query_log diff --git a/mysql-test/include/have_met_timezone.require b/mysql-test/include/have_met_timezone.require new file mode 100644 index 00000000000..b3fde075ebd --- /dev/null +++ b/mysql-test/include/have_met_timezone.require @@ -0,0 +1,2 @@ +FROM_UNIXTIME(24*3600) +1970-01-02 01:00:00 diff --git a/mysql-test/include/have_moscow_leap_timezone.require b/mysql-test/include/have_moscow_leap_timezone.require new file mode 100644 index 00000000000..f27452d7770 --- /dev/null +++ b/mysql-test/include/have_moscow_leap_timezone.require @@ -0,0 +1,2 @@ +from_unixtime(1072904422) +2004-01-01 00:00:00 diff --git a/mysql-test/include/have_not_innodb_plugin.inc b/mysql-test/include/have_not_innodb_plugin.inc deleted file mode 100644 index e40fd811021..00000000000 --- a/mysql-test/include/have_not_innodb_plugin.inc +++ /dev/null @@ -1,4 +0,0 @@ -disable_query_log; ---require r/not_true.require -select (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%' OR PLUGIN_DESCRIPTION LIKE '%xtradb%') as `TRUE` from information_schema.plugins where PLUGIN_NAME='InnoDB'; -enable_query_log; diff --git a/mysql-test/include/have_outfile.inc b/mysql-test/include/have_outfile.inc index d1d4e1a0fee..705d394b206 100644 --- a/mysql-test/include/have_outfile.inc +++ b/mysql-test/include/have_outfile.inc @@ -1,4 +1,4 @@ --- require r/have_outfile.require +-- require include/have_outfile.require disable_query_log; select load_file(concat(@tmpdir,'/outfile.test')); --remove_file $MYSQLTEST_VARDIR/tmp/outfile.test diff --git a/mysql-test/include/have_outfile.require b/mysql-test/include/have_outfile.require new file mode 100644 index 00000000000..71137a69a91 --- /dev/null +++ b/mysql-test/include/have_outfile.require @@ -0,0 +1,3 @@ +load_file(concat(@tmpdir,'/outfile.test')) +Outfile OK + diff --git a/mysql-test/include/have_perror.require b/mysql-test/include/have_perror.require new file mode 100644 index 00000000000..260687c87f0 --- /dev/null +++ b/mysql-test/include/have_perror.require @@ -0,0 +1,2 @@ +have_perror +1 diff --git a/mysql-test/include/have_plugin_interface.inc b/mysql-test/include/have_plugin_interface.inc index afe8ffad40d..203fb807204 100644 --- a/mysql-test/include/have_plugin_interface.inc +++ b/mysql-test/include/have_plugin_interface.inc @@ -1,5 +1,5 @@ --disable_query_log ---require r/true.require +--require include/true.require select (PLUGIN_LIBRARY LIKE 'qa_auth_interface%') as `TRUE` FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='qa_auth_interface'; --enable_query_log diff --git a/mysql-test/include/have_plugin_server.inc b/mysql-test/include/have_plugin_server.inc index aad1f026b44..8d85bec8114 100644 --- a/mysql-test/include/have_plugin_server.inc +++ b/mysql-test/include/have_plugin_server.inc @@ -1,5 +1,5 @@ --disable_query_log ---require r/true.require +--require include/true.require select (PLUGIN_LIBRARY LIKE 'qa_auth_server%') as `TRUE` FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='qa_auth_server'; --enable_query_log diff --git a/mysql-test/include/have_pool_of_threads.inc b/mysql-test/include/have_pool_of_threads.inc index ab93a62d568..432c6216804 100644 --- a/mysql-test/include/have_pool_of_threads.inc +++ b/mysql-test/include/have_pool_of_threads.inc @@ -1,4 +1,4 @@ --- require r/have_pool_of_threads.require +-- require include/have_pool_of_threads.require disable_query_log; show variables like 'thread_handling'; enable_query_log; diff --git a/mysql-test/include/have_pool_of_threads.require b/mysql-test/include/have_pool_of_threads.require new file mode 100644 index 00000000000..04e46a71903 --- /dev/null +++ b/mysql-test/include/have_pool_of_threads.require @@ -0,0 +1,2 @@ +Variable_name Value +thread_handling pool-of-threads diff --git a/mysql-test/include/have_profiling.inc b/mysql-test/include/have_profiling.inc index 48f6668ff92..4048555debc 100644 --- a/mysql-test/include/have_profiling.inc +++ b/mysql-test/include/have_profiling.inc @@ -1,4 +1,4 @@ ---require r/have_profiling.require +--require include/have_profiling.require --disable_query_log show variables like 'have_profiling'; --enable_query_log diff --git a/mysql-test/include/have_profiling.require b/mysql-test/include/have_profiling.require new file mode 100644 index 00000000000..54caeba1dae --- /dev/null +++ b/mysql-test/include/have_profiling.require @@ -0,0 +1,2 @@ +Variable_name Value +have_profiling YES diff --git a/mysql-test/include/have_query_cache.inc b/mysql-test/include/have_query_cache.inc index 09602fd2dd5..d90669737bd 100644 --- a/mysql-test/include/have_query_cache.inc +++ b/mysql-test/include/have_query_cache.inc @@ -1,4 +1,4 @@ --- require r/have_query_cache.require +-- require include/have_query_cache.require disable_query_log; show variables like 'have_query_cache'; enable_query_log; diff --git a/mysql-test/include/have_query_cache.require b/mysql-test/include/have_query_cache.require new file mode 100644 index 00000000000..312d837fed3 --- /dev/null +++ b/mysql-test/include/have_query_cache.require @@ -0,0 +1,2 @@ +Variable_name Value +have_query_cache YES diff --git a/mysql-test/include/have_rbr_triggers.inc b/mysql-test/include/have_rbr_triggers.inc deleted file mode 100644 index 9ccfc18bfde..00000000000 --- a/mysql-test/include/have_rbr_triggers.inc +++ /dev/null @@ -1,5 +0,0 @@ -if (`select count(*) = 0 from information_schema.session_variables where variable_name = 'slave_run_triggers_for_rbr'`) -{ - skip RBR triggers are not available; -} - diff --git a/mysql-test/include/have_semisync.inc b/mysql-test/include/have_semisync.inc deleted file mode 100644 index 243fad83717..00000000000 --- a/mysql-test/include/have_semisync.inc +++ /dev/null @@ -1,4 +0,0 @@ -if (`select count(*) < 2 from information_schema.plugins where plugin_name like 'rpl_semi_sync_%'`) -{ - --skip Test requires semisync plugins -} diff --git a/mysql-test/include/have_semisync.opt b/mysql-test/include/have_semisync.opt deleted file mode 100644 index 19e29c7e4de..00000000000 --- a/mysql-test/include/have_semisync.opt +++ /dev/null @@ -1,4 +0,0 @@ ---plugin-load-add=$SEMISYNC_MASTER_SO ---plugin-load-add=$SEMISYNC_SLAVE_SO ---loose-rpl-semi-sync-master ---loose-rpl-semi-sync-slave diff --git a/mysql-test/include/have_semisync_plugin.inc b/mysql-test/include/have_semisync_plugin.inc deleted file mode 100644 index 8a1679de636..00000000000 --- a/mysql-test/include/have_semisync_plugin.inc +++ /dev/null @@ -1,15 +0,0 @@ -# -# Check if server has support for loading plugins -# -if (`SELECT @@have_dynamic_loading != 'YES'`) { - --skip Requires dynamic loading -} - -# -# Check if the variable SEMISYNC_MASTER_SO is set -# -if (!$SEMISYNC_MASTER_SO) -{ - skip Need semisync plugins; -} - diff --git a/mysql-test/include/have_symlink.inc b/mysql-test/include/have_symlink.inc index ec4743531fd..945fc96f25f 100644 --- a/mysql-test/include/have_symlink.inc +++ b/mysql-test/include/have_symlink.inc @@ -3,7 +3,7 @@ # symlink support, and so does not test correctly under valgrind. See the # comment in mysqld.cc for the --symbolic-links option. --- require r/have_symlink.require +-- require include/have_symlink.require disable_query_log; show variables like 'have_symlink'; diff --git a/mysql-test/include/have_symlink.require b/mysql-test/include/have_symlink.require new file mode 100644 index 00000000000..55ad9437034 --- /dev/null +++ b/mysql-test/include/have_symlink.require @@ -0,0 +1,2 @@ +Variable_name Value +have_symlink YES diff --git a/mysql-test/include/have_utf16.inc b/mysql-test/include/have_utf16.inc index ab22c255c88..0dfe8e9ced4 100644 --- a/mysql-test/include/have_utf16.inc +++ b/mysql-test/include/have_utf16.inc @@ -1,4 +1,4 @@ --- require r/have_utf16.require +-- require include/have_utf16.require disable_query_log; show collation like 'utf16_general_ci'; enable_query_log; diff --git a/mysql-test/include/have_utf16.require b/mysql-test/include/have_utf16.require new file mode 100644 index 00000000000..a1b5469cad7 --- /dev/null +++ b/mysql-test/include/have_utf16.require @@ -0,0 +1,2 @@ +Collation Charset Id Default Compiled Sortlen +utf16_general_ci utf16 54 Yes Yes 1 diff --git a/mysql-test/include/have_utf32.inc b/mysql-test/include/have_utf32.inc index f5b5353c9fd..7d3b2b6938a 100644 --- a/mysql-test/include/have_utf32.inc +++ b/mysql-test/include/have_utf32.inc @@ -1,4 +1,4 @@ --- require r/have_utf32.require +-- require include/have_utf32.require disable_query_log; show collation like 'utf32_general_ci'; enable_query_log; diff --git a/mysql-test/include/have_utf32.require b/mysql-test/include/have_utf32.require new file mode 100644 index 00000000000..710ddb8090c --- /dev/null +++ b/mysql-test/include/have_utf32.require @@ -0,0 +1,2 @@ +Collation Charset Id Default Compiled Sortlen +utf32_general_ci utf32 60 Yes Yes 1 diff --git a/mysql-test/include/have_utf8mb4.inc b/mysql-test/include/have_utf8mb4.inc index 6eb91b1c23c..42e7d32a26c 100644 --- a/mysql-test/include/have_utf8mb4.inc +++ b/mysql-test/include/have_utf8mb4.inc @@ -1,4 +1,4 @@ ---require r/have_utf8mb4.require +--require include/have_utf8mb4.require --disable_query_log diff --git a/mysql-test/include/have_utf8mb4.require b/mysql-test/include/have_utf8mb4.require new file mode 100644 index 00000000000..1669b332d0d --- /dev/null +++ b/mysql-test/include/have_utf8mb4.require @@ -0,0 +1,2 @@ +Collation Charset Id Default Compiled Sortlen +utf8mb4_general_ci utf8mb4 45 Yes Yes 1 diff --git a/mysql-test/include/have_working_dns.inc b/mysql-test/include/have_working_dns.inc index 8fed5cd3df5..6118d48946f 100644 --- a/mysql-test/include/have_working_dns.inc +++ b/mysql-test/include/have_working_dns.inc @@ -5,7 +5,7 @@ # The actual check for working DNS is done in Perl, and the result available # in an environment variable. # ---require r/have_working_dns.require +--require include/have_working_dns.require disable_query_log; eval SELECT LENGTH('$HAVE_BROKEN_DNS') = 0 AS 'have_working_dns'; enable_query_log; diff --git a/mysql-test/include/have_working_dns.require b/mysql-test/include/have_working_dns.require new file mode 100644 index 00000000000..67b5a22ce19 --- /dev/null +++ b/mysql-test/include/have_working_dns.require @@ -0,0 +1,2 @@ +have_working_dns +1 diff --git a/mysql-test/include/have_xtradb.combinations b/mysql-test/include/have_xtradb.combinations deleted file mode 100644 index 0419dc91171..00000000000 --- a/mysql-test/include/have_xtradb.combinations +++ /dev/null @@ -1,13 +0,0 @@ -[xtradb_plugin] -ignore-builtin-innodb -plugin-load-add=$HA_XTRADB_SO -innodb -innodb-cmpmem -innodb-trx -innodb-sys-indexes - -[xtradb] -innodb -innodb-cmpmem -innodb-trx -innodb-sys-indexes diff --git a/mysql-test/include/have_xtradb.inc b/mysql-test/include/have_xtradb.inc deleted file mode 100644 index d12802e057d..00000000000 --- a/mysql-test/include/have_xtradb.inc +++ /dev/null @@ -1,4 +0,0 @@ -# -# suite.pm will make sure that all tests including this file -# will be skipped unless xtradb is enabled -# diff --git a/mysql-test/include/install_semisync.inc b/mysql-test/include/install_semisync.inc deleted file mode 100644 index 9cc6df2072a..00000000000 --- a/mysql-test/include/install_semisync.inc +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. -# ---let $include_filename= install_semisync.inc ---source include/begin_include_file.inc - ---source include/not_embedded.inc ---source include/have_semisync_plugin.inc - ---connection master - ---disable_query_log ---let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1) -if ($value == No such row) -{ - SET sql_log_bin = 0; - install plugin rpl_semi_sync_master soname 'semisync_master'; - SET GLOBAL rpl_semi_sync_master_enabled = 1; - SET sql_log_bin = 1; -} ---enable_query_log - ---connection slave ---source include/stop_slave_io.inc - ---disable_query_log ---let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1) -if ($value == No such row) -{ - SET sql_log_bin = 0; - install plugin rpl_semi_sync_slave soname 'semisync_slave'; - SET GLOBAL rpl_semi_sync_slave_enabled = 1; - SET sql_log_bin = 1; -} -START SLAVE IO_THREAD; ---source include/wait_for_slave_io_to_start.inc ---enable_query_log - ---source include/end_include_file.inc diff --git a/mysql-test/include/log_slow_debug_common.inc b/mysql-test/include/log_slow_debug_common.inc new file mode 100644 index 00000000000..f8c9075e1e2 --- /dev/null +++ b/mysql-test/include/log_slow_debug_common.inc @@ -0,0 +1,20 @@ +CREATE TABLE t1 (a INT); +CREATE INDEX t1a ON t1 (a); +DROP INDEX t1a ON t1; +DROP TABLE t1; +CREATE TABLE t2 (a INT); +ALTER TABLE t2 RENAME t2; +RENAME TABLE t2 TO t3; +DROP TABLE t3; +CREATE TABLE t4 (a INT); +PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1'; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +DROP TABLE t4; + +CREATE SEQUENCE s4; +ALTER SEQUENCE s4 MAXVALUE 100; +PREPARE stmt FROM 'ALTER SEQUENCE s4 MAXVALUE=101'; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +DROP SEQUENCE s4; diff --git a/mysql-test/include/lowercase0.require b/mysql-test/include/lowercase0.require new file mode 100644 index 00000000000..5550a2e93b8 --- /dev/null +++ b/mysql-test/include/lowercase0.require @@ -0,0 +1,2 @@ +Variable_name Value +lower_case_table_names 0 diff --git a/mysql-test/include/lowercase1.require b/mysql-test/include/lowercase1.require new file mode 100644 index 00000000000..0341f838f7b --- /dev/null +++ b/mysql-test/include/lowercase1.require @@ -0,0 +1,2 @@ +Variable_name Value +lower_case_table_names 1 diff --git a/mysql-test/include/lowercase2.require b/mysql-test/include/lowercase2.require new file mode 100644 index 00000000000..522eac63e81 --- /dev/null +++ b/mysql-test/include/lowercase2.require @@ -0,0 +1,2 @@ +Variable_name Value +lower_case_table_names 2 diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql index 95f0f5420a4..0f6d3c6f1e5 100644 --- a/mysql-test/include/mtr_check.sql +++ b/mysql-test/include/mtr_check.sql @@ -28,7 +28,7 @@ BEGIN -- Dump all global variables except those -- that are supposed to change SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE variable_name NOT IN ('timestamp', 'innodb_file_format_max') + WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' @@ -39,12 +39,14 @@ BEGIN -- Dump all databases, there should be none -- except those that was created during bootstrap - SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; + SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; -- and the mtr_wsrep_notify schema which is populated by the std_data/wsrep_notify.sh script -- and the suite/galera/t/galera_var_notify_cmd.test -- and the wsrep_schema schema that may be created by Galera - SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema'); + SELECT * FROM INFORMATION_SCHEMA.SCHEMATA + WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') + ORDER BY BINARY SCHEMA_NAME; -- The test database should not contain any tables SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index d5d4952f28c..577d2a78b47 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -224,6 +224,12 @@ INSERT INTO global_suppressions VALUES ("Slave I/O: Setting @slave_gtid_ignore_duplicates failed with error.*"), ("Slave I/O: Setting @slave_until_gtid failed with error.*"), ("Slave I/O: Get master GTID position failed with error.*"), + + /* + MDEV-12501 -- set --maturity-level by default + */ + ("Plugin .* is of maturity level .* while the server is .*"), + ("THE_LAST_SUPPRESSION")|| @@ -236,7 +242,7 @@ BEGIN DECLARE `pos` bigint unsigned; -- Don't write these queries to binlog - SET SQL_LOG_BIN=0; + SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; -- -- Remove mark from lines that are suppressed by global suppressions diff --git a/mysql-test/include/not_staging.inc b/mysql-test/include/not_staging.inc index bd3813ead2f..bf93c2cbb87 100644 --- a/mysql-test/include/not_staging.inc +++ b/mysql-test/include/not_staging.inc @@ -1,4 +1,4 @@ ---require r/not_staging.require +--require include/not_staging.require disable_query_log; eval select $STAGING_RUN as using_staging_run; enable_query_log; diff --git a/mysql-test/include/not_staging.require b/mysql-test/include/not_staging.require new file mode 100644 index 00000000000..3073f02c045 --- /dev/null +++ b/mysql-test/include/not_staging.require @@ -0,0 +1,2 @@ +using_staging_run +0 diff --git a/mysql-test/include/not_true.require b/mysql-test/include/not_true.require new file mode 100644 index 00000000000..0032832f3d1 --- /dev/null +++ b/mysql-test/include/not_true.require @@ -0,0 +1,2 @@ +TRUE +NULL diff --git a/mysql-test/include/not_valgrind.inc b/mysql-test/include/not_valgrind.inc index bdddaf534ca..8bda3497878 100644 --- a/mysql-test/include/not_valgrind.inc +++ b/mysql-test/include/not_valgrind.inc @@ -1,4 +1,4 @@ ---require r/not_valgrind.require +--require include/not_valgrind.require --disable_query_log eval select $VALGRIND_TEST as using_valgrind; --enable_query_log diff --git a/mysql-test/include/not_valgrind.require b/mysql-test/include/not_valgrind.require new file mode 100644 index 00000000000..5d779c6bfcb --- /dev/null +++ b/mysql-test/include/not_valgrind.require @@ -0,0 +1,2 @@ +using_valgrind +0 diff --git a/mysql-test/include/one_thread_per_connection.inc b/mysql-test/include/one_thread_per_connection.inc index 4b38800733b..08b47fbf435 100644 --- a/mysql-test/include/one_thread_per_connection.inc +++ b/mysql-test/include/one_thread_per_connection.inc @@ -1,4 +1,4 @@ --- require r/one_thread_per_connection.require +-- require include/one_thread_per_connection.require disable_query_log; select @@thread_handling; enable_query_log; diff --git a/mysql-test/include/one_thread_per_connection.require b/mysql-test/include/one_thread_per_connection.require new file mode 100644 index 00000000000..b2efbca6441 --- /dev/null +++ b/mysql-test/include/one_thread_per_connection.require @@ -0,0 +1,2 @@ +@@thread_handling +one-thread-per-connection diff --git a/mysql-test/include/rpl_events.inc b/mysql-test/include/rpl_events.inc deleted file mode 100644 index 0effa8c4e5c..00000000000 --- a/mysql-test/include/rpl_events.inc +++ /dev/null @@ -1,159 +0,0 @@ -################################################################## -# Author: Giuseppe, Chuck Bell # -# Date: 17-January-2007 # -# Purpose: To test that event effects are replicated # -# in both row based and statement based format # -################################################################## - ---disable_warnings -DROP EVENT IF EXISTS test.justonce; -drop table if exists t1,t2; ---enable_warnings - -# first, we need a table to record something from an event - -eval CREATE TABLE `t1` ( - `id` INT(10) UNSIGNED NOT NULL, - `c` VARCHAR(50) NOT NULL, - `ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -) ENGINE=$engine_type DEFAULT CHARSET=utf8; - -INSERT INTO t1 (id, c) VALUES (1, 'manually'); - -# We create the event so that it inserts exactly 1 row in the table -# A recuring event is used so that we can be sure the event will -# fire regardless of timing delays on the server. Otherwise, it is -# possible for the event to timeout before it has inserted a row. ---echo "Creating event test.justonce on the master" -CREATE EVENT test.justonce ON SCHEDULE EVERY 2 SECOND DO - INSERT IGNORE INTO t1 (id, c) VALUES (2, 'from justonce'); - -# Show the event is alive and present on master ---echo "Checking event is active on master" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce'; - -# Wait until event has fired. We know this because t1 will contain -# the row from the event. -let $wait_condition= - SELECT COUNT(*) = 1 FROM t1 WHERE c = 'from justonce'; ---source include/wait_condition.inc - -# check that table t1 contains something ---echo "Checking event data on the master" -let $events_done=`SELECT count(*) FROM t1 id`; ---disable_query_log -eval SELECT $events_done > 0 as ONE; ---enable_query_log - -sync_slave_with_master; - ---echo "Checking event data on the slave" ---disable_query_log -eval SELECT count(*) - $events_done as ZERO FROM t1 id; ---enable_query_log - ---echo "Checking event is inactive on slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce'; - -# Create an event on the slave and check to see what the originator is. ---echo "Dropping event test.slave_once on the slave" ---disable_warnings -DROP EVENT IF EXISTS test.slave_once; ---enable_warnings - -# Create an event on slave and check its state. An event shouldn't be executed -# so set start time in 1 hour. -CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO - INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once'); - ---echo "Checking event status on the slave for originator value = slave's server_id" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once'; - ---echo "Dropping event test.slave_once on the slave" ---disable_warnings -DROP EVENT IF EXISTS test.slave_once; ---enable_warnings - -connection master; - -# BUG#20384 - disable events on slave ---echo "Dropping event test.justonce on the master" ---disable_warnings -DROP EVENT IF EXISTS test.justonce; ---enable_warnings - -# Create an event on master and check its state on slave. An event shouldn't be executed -# so set start time in 1 hour. Check that changes of event statement replicated to slave - ---echo "Creating event test.er on the master" -CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO - INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er'); - ---echo "Checking event status on the master" -SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; - -sync_slave_with_master; - ---echo "Checking event status on the slave" -SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; - -connection master; ---echo "Altering event test.er on the master" -ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO - INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er'); - ---echo "Checking event status on the master" -SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; - -sync_slave_with_master; - ---echo "Checking event status on the slave" -SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; - -connection master; ---echo "Dropping event test.er on the master" -DROP EVENT test.er; - ---echo "Checking event status on the master" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; - ---disable_info - -sync_slave_with_master; - ---echo "Checking event status on the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; - -# test the DISABLE ON SLAVE for setting event SLAVESIDE_DISABLED as status -# on CREATE EVENT - -# Create an event on slave and check its status. An event shouldn't be executed -# so set start time in 1 hour. - ---echo "Creating event test.slave_terminate on the slave" -CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO - INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate'); - ---echo "Checking event status on the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate'; - ---echo "Dropping event test.slave_terminate on the slave" -DROP EVENT test.slave_terminate; - ---echo "Creating event test.slave_terminate with DISABLE ON SLAVE on the slave" -CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DISABLE ON SLAVE DO - INSERT IGNORE INTO t1(c) VALUES (7, 'from slave_terminate'); - ---echo "Checking event status on the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate'; - ---echo "Dropping event test.slave_terminate on the slave" -DROP EVENT test.slave_terminate; - ---echo "Cleanup" -connection master; -DROP TABLE t1; -sync_slave_with_master; -connection master; - diff --git a/mysql-test/include/rpl_row_img_general_loop.inc b/mysql-test/include/rpl_row_img_general_loop.inc index 3c7749e5135..1e3e42f893c 100644 --- a/mysql-test/include/rpl_row_img_general_loop.inc +++ b/mysql-test/include/rpl_row_img_general_loop.inc @@ -12,7 +12,7 @@ # the name of the test script to include in every combination # # Sample usage: -# -- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test +# -- let $row_img_test_script= suite/rpl/include/rpl_row_img.test # -- source include/rpl_row_img_general_loop.test diff --git a/mysql-test/include/show_delayed_slave_state.inc b/mysql-test/include/show_delayed_slave_state.inc index 8eb7232a206..53a9aa828de 100644 --- a/mysql-test/include/show_delayed_slave_state.inc +++ b/mysql-test/include/show_delayed_slave_state.inc @@ -5,7 +5,7 @@ # ==== Usage ==== # # --let $verbose_delayed_slave_state= [0|1] -# --source extra/rpl_tests/show_delayed_slave_state.inc +# --source suite/rpl/include/show_delayed_slave_state.inc # # By default, the output is normalized so that it does not depend on # exact timing or exact binlog positions. If diff --git a/mysql-test/include/true.require b/mysql-test/include/true.require new file mode 100644 index 00000000000..09aae1ed1d0 --- /dev/null +++ b/mysql-test/include/true.require @@ -0,0 +1,2 @@ +TRUE +1 diff --git a/mysql-test/include/uninstall_semisync.inc b/mysql-test/include/uninstall_semisync.inc deleted file mode 100644 index 0a4c55fa4f2..00000000000 --- a/mysql-test/include/uninstall_semisync.inc +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. -# ---let $include_filename= uninstall_semisync.inc ---source include/begin_include_file.inc - ---disable_query_log ---connection slave ---source include/stop_slave_io.inc - -# Uninstall rpl_semi_sync_slave first ---disable_warnings -UNINSTALL PLUGIN rpl_semi_sync_slave; - ---connection master -# After BUG#17638477 fix, uninstallation of rpl_semi_sync_master -# is not allowed when there are semi sync slaves. Hence kill -# all dump threads before uninstalling it. -SET GLOBAL rpl_semi_sync_master_enabled = OFF; ---source include/stop_dump_threads.inc -UNINSTALL PLUGIN rpl_semi_sync_master; ---enable_warnings - ---connection slave -START SLAVE IO_THREAD; ---source include/wait_for_slave_io_to_start.inc ---enable_query_log - ---source include/end_include_file.inc diff --git a/mysql-test/include/update_use_source.inc b/mysql-test/include/update_use_source.inc new file mode 100644 index 00000000000..864b58e5d7f --- /dev/null +++ b/mysql-test/include/update_use_source.inc @@ -0,0 +1,147 @@ +# Include to test update with same table as source and target + +--echo # +--echo # Update a with value from subquery on the same table, no search clause. ALL access +--echo # + +start transaction; +--enable_info ONCE +update t1 + set c1=(select a.c3 + from t1 a + where a.c3 = t1.c3); +select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ; +rollback; + +--echo # +--echo # Update with search clause on the same table +--echo # + +start transaction; +--enable_info ONCE +update t1 + set c1=10 + where c1 <2 + and exists (select 'X' + from t1 a + where a.c1 = t1.c1); +select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ; +rollback; + +--echo # +--echo # Update via RANGE or INDEX access if an index or a primary key exists +--echo # + +explain update t1 set c1=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 > 3; +start transaction; +--enable_info ONCE +update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3; +select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1; +rollback; + +--echo # +--echo # Update with order by +--echo # + +start transaction; +update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; +select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1; +rollback; + +--echo # +--echo Update using a view in subquery +--echo # + +start transaction; +--enable_info ONCE +update t1 + set c1=c1 +(select max(a.c2) + from v1 a + where a.c1 = t1.c1) ; +select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1; +rollback; + +--echo # +--echo # Update throw a view +--echo # + +start transaction; +--enable_info ONCE +update v1 + set c1=c1 + (select max(a.c2) + from t1 a + where a.c1 = v1.c1) +10 +where c3 > 3; +select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1; +rollback; + +--echo # +--echo # Update through a view and using the view in subquery +--echo # + +start transaction; +--enable_info ONCE +update v1 + set c1=c1 + 1 + where c1 <2 + and exists (select 'X' + from v1 a + where a.c1 = v1.c1); +select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1; +rollback; + +--echo # +--echo # Update through a view and using the view in subquery +--echo # + +start transaction; +--enable_info ONCE +update v1 + set c1=(select max(a.c1)+10 + from v1 a + where a.c1 = v1.c1) + where c1 <10 + and exists (select 'X' + from v1 a + where a.c2 = v1.c2); +select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1; +rollback; + +--echo # +--echo # Update of the index or primary key (c3) +--echo # + +start transaction; +explain update t1 set c3=c3+10 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1); +--enable_info ONCE +update t1 set c3=c3+10 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1); +select c3 from t1; +rollback; + +--echo # +--echo # update with a limit +--echo # + +start transaction; +--enable_info ONCE +update t1 + set c1=(select a.c3 + from t1 a + where a.c3 = t1.c3) + limit 2; +select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ; +rollback; + +--echo # +--echo # update with a limit and an order by +--echo # + +start transaction; +--enable_info ONCE +update t1 + set c1=(select a.c3 + from t1 a + where a.c3 = t1.c3) + order by c3 desc limit 2; +select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ; +rollback; |