diff options
Diffstat (limited to 'mysql-test')
42 files changed, 502 insertions, 79 deletions
diff --git a/mysql-test/r/analyze_stmt.result b/mysql-test/r/analyze_stmt.result index c3c98593210..3ae49c5eeb6 100644 --- a/mysql-test/r/analyze_stmt.result +++ b/mysql-test/r/analyze_stmt.result @@ -247,7 +247,7 @@ drop table t1; # create table t1 (i int); insert into t1 values (1); -analyze select * from t1 into @var; +analyze select * into @var from t1 ; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 NULL 100.00 NULL drop table t1; @@ -281,10 +281,10 @@ drop table t1; # create table t1(a int); insert into t1 values (1),(2); -analyze select a from t1 where a <2 into @var; +analyze select a into @var from t1 where a <2 ; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 2.00 100.00 50.00 Using where -analyze select a from t1 into @var; +analyze select a into @var from t1 ; ERROR 42000: Result consisted of more than one row analyze insert into t1 select * from t1; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 16acf3fcbea..d2cee26cfb1 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -3421,6 +3421,36 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1,t2; # +# MDEV-14926 AddressSanitizer: heap-use-after-free in make_date_time on weird combination of functions +# +DO INET_ATON( FROM_UNIXTIME( @@timestamp, ( TRIM( UNHEX(HEX('%m.%d.%Y') ) ) ) ) ); +CREATE TABLE t1 (d DATE); +INSERT INTO t1 VALUES ('1989-03-10'); +SELECT TIME_FORMAT('23:59:43', BINARY d) AS f FROM t1 GROUP BY 'foo'; +f +1989-03-10 +DROP TABLE t1; +CREATE TABLE t1 (d DATE) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('1900-01-01'); +SELECT LENGTH( DATE_FORMAT( d, BINARY DATABASE() ) ) AS f FROM t1 GROUP BY d; +f +4 +DROP TABLE t1; +# +# MDEV-18667 ASAN heap-use-after-free in make_date_time / Arg_comparator::compare_string / Item_func_nullif::compare +# +SELECT NULLIF('foo', FROM_UNIXTIME('2012-12-12 12:12:12', TRIM(0))); +NULLIF('foo', FROM_UNIXTIME('2012-12-12 12:12:12', TRIM(0))) +foo +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '2012-12-12 12:12:12' +# +# MDEV-18626 ASAN stack-buffer-overflow in int10_to_str / make_date_time upon DATE_FORMAT +# +SELECT DATE_FORMAT(100000000000, '%j'); +DATE_FORMAT(100000000000, '%j') +NULL +# # End of 10.1 tests # # diff --git a/mysql-test/r/log_slow_debug.result b/mysql-test/r/log_slow_debug.result new file mode 100644 index 00000000000..a823f4c2b98 --- /dev/null +++ b/mysql-test/r/log_slow_debug.result @@ -0,0 +1,137 @@ +SET @org_slow_query_log= @@global.slow_query_log; +SET @org_log_output= @@global.log_output; +SET @org_log_slow_admin_statements= @@global.log_slow_admin_statements; +SET @@GLOBAL.slow_query_log=OFF; +SET @@GLOBAL.log_output='TABLE'; +FLUSH SLOW LOGS; +SET @@GLOBAL.slow_query_log=ON; +SET @@GLOBAL.log_slow_admin_statements=ON; +SET SESSION debug_dbug="+d,simulate_slow_query"; +CREATE PROCEDURE show_slow_log() +BEGIN +SELECT CONCAT('[slow] ', sql_text) AS sql_text +FROM mysql.slow_log +WHERE sql_text NOT LIKE '%debug_dbug%'; +END +$$ +# +# Expect all admin statements in the slow log (ON,DEFAULT) +# +SET @@GLOBAL.log_slow_admin_statements=ON; +SET log_slow_filter=DEFAULT; +TRUNCATE TABLE mysql.slow_log; +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; +CALL show_slow_log(); +sql_text +[slow] TRUNCATE TABLE mysql.slow_log +[slow] CREATE TABLE t1 (a INT) +[slow] CREATE INDEX t1a ON t1 (a) +[slow] DROP INDEX t1a ON t1 +[slow] DROP TABLE t1 +[slow] CREATE TABLE t2 (a INT) +[slow] ALTER TABLE t2 RENAME t2 +[slow] RENAME TABLE t2 TO t3 +[slow] DROP TABLE t3 +[slow] CREATE TABLE t4 (a INT) +[slow] PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1' +[slow] ALTER TABLE t4 MODIFY a INT DEFAULT 1 +[slow] DEALLOCATE PREPARE stmt +[slow] DROP TABLE t4 +# +# Expect all admin statements in the slow log (ON,admin) +# +SET @@GLOBAL.log_slow_admin_statements=ON; +SET log_slow_filter=admin; +TRUNCATE TABLE mysql.slow_log; +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; +CALL show_slow_log(); +sql_text +[slow] CREATE INDEX t1a ON t1 (a) +[slow] DROP INDEX t1a ON t1 +[slow] ALTER TABLE t2 RENAME t2 +[slow] RENAME TABLE t2 TO t3 +[slow] ALTER TABLE t4 MODIFY a INT DEFAULT 1 +# +# Expect none of admin DDL statements in the slow log (ON,filesort) +# +SET @@GLOBAL.log_slow_admin_statements=ON; +SET log_slow_filter=filesort; +TRUNCATE TABLE mysql.slow_log; +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; +CALL show_slow_log(); +sql_text +# +# Expect none of admin statements in the slow log (OFF,DEFAULT) +# +SET @@GLOBAL.log_slow_admin_statements=OFF; +SET log_slow_filter=DEFAULT; +TRUNCATE TABLE mysql.slow_log; +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; +CALL show_slow_log(); +sql_text +[slow] TRUNCATE TABLE mysql.slow_log +[slow] CREATE TABLE t1 (a INT) +[slow] DROP TABLE t1 +[slow] CREATE TABLE t2 (a INT) +[slow] DROP TABLE t3 +[slow] CREATE TABLE t4 (a INT) +[slow] PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1' +[slow] DEALLOCATE PREPARE stmt +[slow] DROP TABLE t4 +# +# Clean up +# +SET SESSION debug_dbug="-d,simulate_slow_query"; +TRUNCATE mysql.slow_log; +SET @@global.slow_query_log= @org_slow_query_log; +SET @@global.log_output= @org_log_output; +SET @@global.log_slow_admin_statements= @org_log_slow_admin_statements; +DROP PROCEDURE show_slow_log; diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 8059923e117..af22654e330 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1318,7 +1318,7 @@ partition p2 values in (1)); end// call p()// drop procedure p// -drop table t1; +drop table t1// create procedure p () begin create table t1 (a int not null,b int not null,c int not null,primary key (a,b)) diff --git a/mysql-test/r/sp-ucs2.result b/mysql-test/r/sp-ucs2.result index b8cc5dfd73d..ca448efa535 100644 --- a/mysql-test/r/sp-ucs2.result +++ b/mysql-test/r/sp-ucs2.result @@ -32,61 +32,55 @@ RETURNS VARCHAR(64) UNICODE BINARY BEGIN RETURN ''; END| -SHOW CREATE FUNCTION f; -DROP FUNCTION f; +SHOW CREATE FUNCTION f| +Function sql_mode Create Function character_set_client collation_connection Database Collation +f STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin +BEGIN +RETURN ''; +END latin1 latin1_swedish_ci latin1_swedish_ci +DROP FUNCTION f| CREATE FUNCTION f() RETURNS VARCHAR(64) BINARY UNICODE BEGIN RETURN ''; END| +SHOW CREATE FUNCTION f| Function sql_mode Create Function character_set_client collation_connection Database Collation f STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin BEGIN RETURN ''; END latin1 latin1_swedish_ci latin1_swedish_ci -SHOW CREATE FUNCTION f; -DROP FUNCTION f; -# -# Testing keywords ASCII + BINARY -# +DROP FUNCTION f| CREATE FUNCTION f() RETURNS VARCHAR(64) ASCII BINARY BEGIN RETURN ''; END| +SHOW CREATE FUNCTION f| Function sql_mode Create Function character_set_client collation_connection Database Collation -f STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin +f STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin BEGIN RETURN ''; END latin1 latin1_swedish_ci latin1_swedish_ci -SHOW CREATE FUNCTION f; -DROP FUNCTION f; +DROP FUNCTION f| CREATE FUNCTION f() RETURNS VARCHAR(64) BINARY ASCII BEGIN RETURN ''; END| +SHOW CREATE FUNCTION f| Function sql_mode Create Function character_set_client collation_connection Database Collation f STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin BEGIN RETURN ''; END latin1 latin1_swedish_ci latin1_swedish_ci -SHOW CREATE FUNCTION f; -DROP FUNCTION f; -# -# Testing COLLATE in OUT parameter -# +DROP FUNCTION f| CREATE PROCEDURE p1(IN f1 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_czech_ci, OUT f2 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_polish_ci) BEGIN SET f2= f1; SET f2= concat(collation(f1), ' ', collation(f2)); END| -Function sql_mode Create Function character_set_client collation_connection Database Collation -f STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin -BEGIN -RETURN ''; -END latin1 latin1_swedish_ci latin1_swedish_ci CREATE FUNCTION f1() RETURNS VARCHAR(64) CHARACTER SET ucs2 BEGIN diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 422a76921f3..5dc3c2584a2 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -6798,7 +6798,7 @@ ERROR 42S02: Table 'test.t1' doesn't exist create table t1 (a integer)$ call p1$ a -alter table t1 add b integer; +alter table t1 add b integer$ call p1$ a drop table t1; diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result index 8edb9e79b70..d337d50e18a 100644 --- a/mysql-test/r/sp_notembedded.result +++ b/mysql-test/r/sp_notembedded.result @@ -74,7 +74,7 @@ select res; end| create table t3 (a int)| insert into t3 values (0)| -create view v1 as select a from t3; +create view v1 as select a from t3| create procedure bug10100pt(level int, lim int) begin if level < lim then diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index ef802279c9c..deb0d6797fe 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -640,7 +640,7 @@ TRUNCATE TABLE t1; END| LOCK TABLES t1 WRITE| CALL p1()| -FLUSH TABLES; +FLUSH TABLES| UNLOCK TABLES| CALL p1()| DROP PROCEDURE p1| diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result index c4b72483c99..99c3c50ea8c 100644 --- a/mysql-test/r/type_year.result +++ b/mysql-test/r/type_year.result @@ -444,6 +444,15 @@ Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010 DROP TABLE t1; # +# MDEV-16958 Assertion `field_length < 5' failed in Field_year::val_str or data corruption upon SELECT with UNION and aggregate functions +# +CREATE TABLE t1 (f YEAR); +INSERT IGNORE INTO t1 VALUES (1971),(1972); +SELECT MAX( NULLIF( f, '1900' ) ) AS f FROM t1 UNION SELECT MAX( NULLIF( f, '1900' ) ) AS f FROM t1; +f +1972 +DROP TABLE t1; +# # End of 10.1 tests # # diff --git a/mysql-test/r/userstat.result b/mysql-test/r/userstat.result index 37d07439fee..01a66aa78ec 100644 --- a/mysql-test/r/userstat.result +++ b/mysql-test/r/userstat.result @@ -145,7 +145,7 @@ show table_statistics; Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes show index_statistics; Table_schema Table_name Index_name Rows_read -select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;; +select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;; TOTAL_CONNECTIONS 2 TOTAL_SSL_CONNECTIONS 1 CONCURRENT_CONNECTIONS 0 @@ -156,14 +156,13 @@ ROWS_INSERTED 7 ROWS_UPDATED 5 SELECT_COMMANDS 4 UPDATE_COMMANDS 11 -OTHER_COMMANDS 7 COMMIT_TRANSACTIONS 19 ROLLBACK_TRANSACTIONS 2 DENIED_CONNECTIONS 0 LOST_CONNECTIONS 0 ACCESS_DENIED 0 EMPTY_QUERIES 1 -select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics;; +select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics;; TOTAL_CONNECTIONS 2 TOTAL_SSL_CONNECTIONS 1 CONCURRENT_CONNECTIONS 0 @@ -174,13 +173,18 @@ ROWS_INSERTED 7 ROWS_UPDATED 5 SELECT_COMMANDS 4 UPDATE_COMMANDS 11 -OTHER_COMMANDS 7 COMMIT_TRANSACTIONS 19 ROLLBACK_TRANSACTIONS 2 DENIED_CONNECTIONS 0 LOST_CONNECTIONS 0 ACCESS_DENIED 0 EMPTY_QUERIES 1 +select OTHER_COMMANDS IN (7,8) from information_schema.client_statistics; +OTHER_COMMANDS IN (7,8) +1 +select OTHER_COMMANDS IN (7,8) from information_schema.user_statistics; +OTHER_COMMANDS IN (7,8) +1 flush table_statistics; flush index_statistics; select * from information_schema.index_statistics; diff --git a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc index cd060e7a370..a2e701cc5fa 100644 --- a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc +++ b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc @@ -156,6 +156,7 @@ WHERE DB = 'information_schema' AND COMMAND = 'Sleep' AND USER = 'ddicttestuser1 --source include/wait_condition.inc --replace_result ENGINE=MyISAM "" ENGINE=Aria "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" "" eval SHOW CREATE TABLE $table; +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS eval SHOW $table; --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID @@ -176,6 +177,7 @@ connection con100; # but "ddicttestuser1" must not see anything of the root session. --replace_result ENGINE=MyISAM "" ENGINE=Aria "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" "" eval SHOW CREATE TABLE $table; +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS eval SHOW $table; --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID @@ -202,6 +204,7 @@ GRANT PROCESS ON *.* TO ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass'; --echo #################################################################################### connection con100; SHOW GRANTS; +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID @@ -214,6 +217,7 @@ SELECT * FROM information_schema.processlist; --echo #################################################################################### connect (con101,localhost,ddicttestuser1,ddictpass,information_schema); SHOW GRANTS; +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID @@ -237,6 +241,7 @@ GRANT PROCESS ON *.* TO ''@'localhost'; --echo #################################################################################### connect (anonymous1,localhost,"''",,information_schema); SHOW GRANTS; +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID @@ -259,6 +264,7 @@ connect (con102,localhost,ddicttestuser1,ddictpass,information_schema); --echo ddicttestuser1 are visible. --echo #################################################################################### SHOW GRANTS; +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID @@ -284,6 +290,7 @@ SHOW GRANTS FOR ''@'localhost'; if ($fixed_bug_30395) { # Bug#30395 strange results after REVOKE PROCESS ON *.* FROM ... +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; } @@ -306,6 +313,7 @@ connect (con103,localhost,ddicttestuser1,ddictpass,information_schema); --echo Only the processes of ddicttestuser1 user are visible. --echo #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID @@ -328,6 +336,7 @@ connect (con104,localhost,ddicttestuser1,ddictpass,information_schema); --echo Only the processes of ddicttestuser1 are visible. --echo #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID @@ -375,6 +384,7 @@ connect (con200,localhost,ddicttestuser2,ddictpass,information_schema); --echo ddicttestuser2 has now the PROCESS privilege and sees all connections --echo #################################################################################### SHOW GRANTS FOR 'ddicttestuser2'@'localhost'; +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID @@ -396,6 +406,7 @@ connect (con201,localhost,ddicttestuser2,ddictpass,information_schema); --echo ddicttestuser2 has no more the PROCESS privilege and can only see own connects --echo #################################################################################### SHOW GRANTS; +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID @@ -419,6 +430,7 @@ connect (con107,localhost,ddicttestuser1,ddictpass,information_schema); SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; --error ER_ACCESS_DENIED_ERROR GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost'; +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID @@ -443,6 +455,7 @@ connect (con108,localhost,ddicttestuser1,ddictpass,information_schema); --echo Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST. --echo #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; +--replace_result Execute Query --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc index cfc3c5e751a..a3e3bf57a99 100644 --- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc +++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc @@ -94,6 +94,7 @@ echo # 1. Just dump what we get --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; +--replace_result Execute Query --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> SHOW FULL PROCESSLIST; # @@ -161,6 +162,7 @@ let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST # 1. Just dump what we get --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; +--replace_result Execute Query --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> SHOW FULL PROCESSLIST; # @@ -203,6 +205,7 @@ echo connection con1; --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; +--replace_result Execute Query --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> SHOW FULL PROCESSLIST; @@ -228,6 +231,7 @@ connection con2; # Just dump what we get --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; +--replace_result Execute Query --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> SHOW FULL PROCESSLIST; # @@ -279,6 +283,7 @@ WHERE ID = @test_user_con2_id AND Command IN('Query','Execute') # 1. Just dump what we get --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; +--replace_result Execute Query --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> SHOW FULL PROCESSLIST; # @@ -385,8 +390,10 @@ echo ; --replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; +--replace_result Execute Query --replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> SHOW FULL PROCESSLIST; +--replace_result Execute Query --replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> SHOW PROCESSLIST; UNLOCK TABLES; diff --git a/mysql-test/suite/galera/r/galera_kill_largechanges.result b/mysql-test/suite/galera/r/galera_kill_largechanges.result index f4de101fef8..b6393590629 100644 --- a/mysql-test/suite/galera/r/galera_kill_largechanges.result +++ b/mysql-test/suite/galera/r/galera_kill_largechanges.result @@ -1,8 +1,7 @@ -call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*"); connection node_1; SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; -CREATE TABLE ten (f1 INTEGER); -INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10),(11); CREATE TABLE t1 (f1 VARCHAR(128)) ENGINE=InnoDB; connection node_2; Killing server ... @@ -10,12 +9,11 @@ connection node_1; INSERT INTO t1 SELECT REPEAT('a', 128) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6; connection node_2; connection node_2a; -SELECT COUNT(*) = 1000000 FROM t1; -COUNT(*) = 1000000 -1 -SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -VARIABLE_VALUE = 2 -1 -connection node_1; +SELECT COUNT(*) FROM t1; +COUNT(*) +1771561 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +VARIABLE_VALUE +2 DROP TABLE t1; DROP TABLE ten; diff --git a/mysql-test/suite/galera/r/galera_kill_nochanges.result b/mysql-test/suite/galera/r/galera_kill_nochanges.result index 3ccf73f0d46..8795608a303 100644 --- a/mysql-test/suite/galera/r/galera_kill_nochanges.result +++ b/mysql-test/suite/galera/r/galera_kill_nochanges.result @@ -10,10 +10,10 @@ SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_sync_wait = DEFAULT; connection node_2; connection node_2a; -SELECT COUNT(*) = 1 FROM t1; -COUNT(*) = 1 -1 -SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -VARIABLE_VALUE = 2 +SELECT COUNT(*) FROM t1; +COUNT(*) 1 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +VARIABLE_VALUE +2 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_kill_smallchanges.result b/mysql-test/suite/galera/r/galera_kill_smallchanges.result index 2ee291004b0..f500db8871b 100644 --- a/mysql-test/suite/galera/r/galera_kill_smallchanges.result +++ b/mysql-test/suite/galera/r/galera_kill_smallchanges.result @@ -1,4 +1,5 @@ -call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*"); +connection node_1; +connection node_2; connection node_1; SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; @@ -8,8 +9,8 @@ connection node_1; INSERT INTO t1 VALUES (1); connection node_2; connection node_2a; -SELECT COUNT(*) = 1 FROM t1; -COUNT(*) = 1 +SELECT COUNT(*) FROM t1; +COUNT(*) 1 SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm index 8b7b7034fac..6e53e6e2e31 100644 --- a/mysql-test/suite/galera/suite.pm +++ b/mysql-test/suite/galera/suite.pm @@ -75,6 +75,7 @@ push @::global_suppressions, qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored.|, qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled. Expect abort.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), + qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), qr(WSREP: discarding established .*), qr|WSREP: .*core_handle_uuid_msg.*|, qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on), diff --git a/mysql-test/suite/galera/t/galera_kill_largechanges.test b/mysql-test/suite/galera/t/galera_kill_largechanges.test index 2803a43d85a..c671764fa9e 100644 --- a/mysql-test/suite/galera/t/galera_kill_largechanges.test +++ b/mysql-test/suite/galera/t/galera_kill_largechanges.test @@ -4,9 +4,11 @@ --source include/big_test.inc --source include/galera_cluster.inc ---source include/have_innodb.inc -call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*"); +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc --connection node_1 # Enable the master to continue running during the split-brain situation that @@ -14,8 +16,8 @@ call mtr.add_suppression("WSREP: Last Applied Action message in non-primary conf --let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; -CREATE TABLE ten (f1 INTEGER); -INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10),(11); CREATE TABLE t1 (f1 VARCHAR(128)) ENGINE=InnoDB; --connection node_2 @@ -33,13 +35,16 @@ INSERT INTO t1 SELECT REPEAT('a', 128) FROM ten AS a1, ten AS a2, ten AS a3, ten --source include/galera_connect.inc --connection node_2a -SELECT COUNT(*) = 1000000 FROM t1; -SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +SELECT COUNT(*) FROM t1; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; --connection node_1 --disable_query_log --eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; --enable_query_log +--let $node_2=node_2a +--source include/auto_increment_offset_restore.inc + DROP TABLE t1; DROP TABLE ten; diff --git a/mysql-test/suite/galera/t/galera_kill_nochanges.test b/mysql-test/suite/galera/t/galera_kill_nochanges.test index 9360ad542f6..aa1648ca3ae 100644 --- a/mysql-test/suite/galera/t/galera_kill_nochanges.test +++ b/mysql-test/suite/galera/t/galera_kill_nochanges.test @@ -20,6 +20,7 @@ INSERT INTO t1 VALUES (1); SET SESSION wsrep_sync_wait = 0; --let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status' --source include/wait_condition.inc + SET SESSION wsrep_sync_wait = DEFAULT; --connection node_2 @@ -30,8 +31,8 @@ SET SESSION wsrep_sync_wait = DEFAULT; --source include/galera_connect.inc --connection node_2a -SELECT COUNT(*) = 1 FROM t1; -SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +SELECT COUNT(*) FROM t1; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; --let $node_2=node_2a --source include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera/t/galera_kill_smallchanges.test b/mysql-test/suite/galera/t/galera_kill_smallchanges.test index 148c3dbc132..15e1727de03 100644 --- a/mysql-test/suite/galera/t/galera_kill_smallchanges.test +++ b/mysql-test/suite/galera/t/galera_kill_smallchanges.test @@ -3,9 +3,11 @@ # --source include/galera_cluster.inc ---source include/have_innodb.inc -call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*"); +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc --connection node_1 @@ -30,7 +32,7 @@ INSERT INTO t1 VALUES (1); --source include/galera_connect.inc --connection node_2a -SELECT COUNT(*) = 1 FROM t1; +SELECT COUNT(*) FROM t1; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; --connection node_1 @@ -38,4 +40,7 @@ SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N --eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; --enable_query_log +--let $node_2=node_2a +--source include/auto_increment_offset_restore.inc + DROP TABLE t1; diff --git a/mysql-test/suite/handler/ps.test b/mysql-test/suite/handler/ps.test index 68091190c85..783d862435e 100644 --- a/mysql-test/suite/handler/ps.test +++ b/mysql-test/suite/handler/ps.test @@ -7,5 +7,7 @@ flush status; handler handler_a read first; # handler...read must be prepared in --ps-protocol mode --replace_result $PS_PROTOCOL OK +--disable_ps_protocol show status like 'Com_stmt_prepare%'; +--enable_ps_protocol drop table t1; diff --git a/mysql-test/suite/innodb/t/innodb-corrupted-table.test b/mysql-test/suite/innodb/t/innodb-corrupted-table.test index 60da461a33c..a7f4ad4afd4 100644 --- a/mysql-test/suite/innodb/t/innodb-corrupted-table.test +++ b/mysql-test/suite/innodb/t/innodb-corrupted-table.test @@ -34,6 +34,7 @@ alter table t1 add primary key (pk); --enable_reconnect --source include/wait_until_connected_again.inc +--enable_prepare_warnings show create table t1; select * from t1; alter table t1 add j int; diff --git a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_func.test b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_func.test index 6617c4ad2ea..c37fc7ab114 100644 --- a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_func.test +++ b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_func.test @@ -19,7 +19,7 @@ # option_mysqld_max_prepared_stmt_count # # # ################################################################################ - +--source include/no_protocol.inc --echo ** Setup ** --echo diff --git a/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test b/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test index 0f6084b65f6..380f2568b9c 100644 --- a/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test +++ b/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test @@ -46,17 +46,23 @@ INSERT INTO t1 VALUES('aa','bb'); SET SESSION sql_buffer_result = 1; +--disable_ps_protocol SHOW STATUS LIKE 'Created_tmp_tables'; +--enable_ps_protocol --echo Expected value : 0. SELECT * FROM t1; +--disable_ps_protocol SHOW STATUS LIKE 'Created_tmp_tables'; +--enable_ps_protocol --echo Expected value : 1. SELECT * FROM t1; +--disable_ps_protocol SHOW STATUS LIKE 'Created_tmp_tables'; +--enable_ps_protocol --echo Expected value : 2. --echo '#--------------------FN_DYNVARS_156_02-------------------------#' @@ -66,12 +72,16 @@ SHOW STATUS LIKE 'Created_tmp_tables'; SET SESSION sql_buffer_result = 0; +--disable_ps_protocol SHOW STATUS LIKE 'Created_tmp_tables'; +--enable_ps_protocol --echo Expected value : 2. SELECT * FROM t1; +--disable_ps_protocol SHOW STATUS LIKE 'Created_tmp_tables'; +--enable_ps_protocol --echo Expected value : 2. --echo '#--------------------FN_DYNVARS_156_03-------------------------#' diff --git a/mysql-test/suite/vcol/t/wrong_arena.test b/mysql-test/suite/vcol/t/wrong_arena.test index 3d65dac9219..8ac1af5c36b 100644 --- a/mysql-test/suite/vcol/t/wrong_arena.test +++ b/mysql-test/suite/vcol/t/wrong_arena.test @@ -14,7 +14,9 @@ create table t1 (a datetime, # other issues e int as ((a,1) in ((1,1),(2,1),(NULL,1))) # cmp_item_row::alloc_comparators() ); +enable_prepare_warnings; show create table t1; +disable_prepare_warnings; connect con1, localhost, root; disable_warnings; insert t1 (a) values ('2010-10-10 10:10:10'); diff --git a/mysql-test/t/analyze_stmt.test b/mysql-test/t/analyze_stmt.test index d02139fe0c8..15fc00a321d 100644 --- a/mysql-test/t/analyze_stmt.test +++ b/mysql-test/t/analyze_stmt.test @@ -196,7 +196,7 @@ drop table t1; --echo # create table t1 (i int); insert into t1 values (1); -analyze select * from t1 into @var; +analyze select * into @var from t1 ; drop table t1; --echo # @@ -223,9 +223,9 @@ drop table t1; create table t1(a int); insert into t1 values (1),(2); -analyze select a from t1 where a <2 into @var; +analyze select a into @var from t1 where a <2 ; --error ER_TOO_MANY_ROWS -analyze select a from t1 into @var; +analyze select a into @var from t1 ; analyze insert into t1 select * from t1; diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index d391e5f5059..6c5b1cab95f 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -1907,6 +1907,36 @@ SELECT * FROM t2; SHOW CREATE TABLE t2; DROP TABLE t1,t2; + +--echo # +--echo # MDEV-14926 AddressSanitizer: heap-use-after-free in make_date_time on weird combination of functions +--echo # + +DO INET_ATON( FROM_UNIXTIME( @@timestamp, ( TRIM( UNHEX(HEX('%m.%d.%Y') ) ) ) ) ); + +CREATE TABLE t1 (d DATE); +INSERT INTO t1 VALUES ('1989-03-10'); +SELECT TIME_FORMAT('23:59:43', BINARY d) AS f FROM t1 GROUP BY 'foo'; +DROP TABLE t1; + +CREATE TABLE t1 (d DATE) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('1900-01-01'); +SELECT LENGTH( DATE_FORMAT( d, BINARY DATABASE() ) ) AS f FROM t1 GROUP BY d; +DROP TABLE t1; + +--echo # +--echo # MDEV-18667 ASAN heap-use-after-free in make_date_time / Arg_comparator::compare_string / Item_func_nullif::compare +--echo # + +SELECT NULLIF('foo', FROM_UNIXTIME('2012-12-12 12:12:12', TRIM(0))); + +--echo # +--echo # MDEV-18626 ASAN stack-buffer-overflow in int10_to_str / make_date_time upon DATE_FORMAT +--echo # + +SELECT DATE_FORMAT(100000000000, '%j'); + + --echo # --echo # End of 10.1 tests --echo # diff --git a/mysql-test/t/kill_processlist-6619.test b/mysql-test/t/kill_processlist-6619.test index d984924f9db..c272e68a877 100644 --- a/mysql-test/t/kill_processlist-6619.test +++ b/mysql-test/t/kill_processlist-6619.test @@ -6,6 +6,7 @@ --connect (con1,localhost,root,,) --let $con_id = `SELECT CONNECTION_ID()` +--replace_result Execute Query --replace_column 1 # 3 # 6 # 7 # SHOW PROCESSLIST; SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go'; @@ -29,5 +30,6 @@ let $wait_condition= WHERE info is NULL; --source include/wait_condition.inc +--replace_result Execute Query --replace_column 1 # 3 # 6 # 7 # SHOW PROCESSLIST; diff --git a/mysql-test/t/log_slow_debug.test b/mysql-test/t/log_slow_debug.test new file mode 100644 index 00000000000..35b5b93423d --- /dev/null +++ b/mysql-test/t/log_slow_debug.test @@ -0,0 +1,126 @@ +-- source include/have_debug.inc + +SET @org_slow_query_log= @@global.slow_query_log; +SET @org_log_output= @@global.log_output; +SET @org_log_slow_admin_statements= @@global.log_slow_admin_statements; + +SET @@GLOBAL.slow_query_log=OFF; +SET @@GLOBAL.log_output='TABLE'; +FLUSH SLOW LOGS; +SET @@GLOBAL.slow_query_log=ON; +SET @@GLOBAL.log_slow_admin_statements=ON; +SET SESSION debug_dbug="+d,simulate_slow_query"; + +DELIMITER $$; +CREATE PROCEDURE show_slow_log() +BEGIN + SELECT CONCAT('[slow] ', sql_text) AS sql_text + FROM mysql.slow_log + WHERE sql_text NOT LIKE '%debug_dbug%'; +END +$$ +DELIMITER ;$$ + + +--echo # +--echo # Expect all admin statements in the slow log (ON,DEFAULT) +--echo # + +SET @@GLOBAL.log_slow_admin_statements=ON; +SET log_slow_filter=DEFAULT; +TRUNCATE TABLE mysql.slow_log; +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; +CALL show_slow_log(); + + +--echo # +--echo # Expect all admin statements in the slow log (ON,admin) +--echo # + +SET @@GLOBAL.log_slow_admin_statements=ON; +SET log_slow_filter=admin; +TRUNCATE TABLE mysql.slow_log; +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; +CALL show_slow_log(); + + +--echo # +--echo # Expect none of admin DDL statements in the slow log (ON,filesort) +--echo # + +SET @@GLOBAL.log_slow_admin_statements=ON; +SET log_slow_filter=filesort; +TRUNCATE TABLE mysql.slow_log; +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; +CALL show_slow_log(); + + +--echo # +--echo # Expect none of admin statements in the slow log (OFF,DEFAULT) +--echo # + +SET @@GLOBAL.log_slow_admin_statements=OFF; +SET log_slow_filter=DEFAULT; +TRUNCATE TABLE mysql.slow_log; +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; +CALL show_slow_log(); + + +--echo # +--echo # Clean up +--echo # + +SET SESSION debug_dbug="-d,simulate_slow_query"; +TRUNCATE mysql.slow_log; +SET @@global.slow_query_log= @org_slow_query_log; +SET @@global.log_output= @org_log_output; +SET @@global.log_slow_admin_statements= @org_log_slow_admin_statements; +DROP PROCEDURE show_slow_log; diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test index a4158ba6a24..f822ec8d758 100644 --- a/mysql-test/t/log_tables.test +++ b/mysql-test/t/log_tables.test @@ -855,7 +855,9 @@ SET GLOBAL slow_query_log = @old_slow_query_log; # select CONNECTION_ID() into @thread_id; +--disable_ps_protocol truncate table mysql.general_log; +--enable_ps_protocol set global general_log = on; --disable_result_log set @lparam = "000 001 002 003 004 005 006 007 008 009" diff --git a/mysql-test/t/old-mode.test b/mysql-test/t/old-mode.test index d7e8ce8ee55..e092ee78a2e 100644 --- a/mysql-test/t/old-mode.test +++ b/mysql-test/t/old-mode.test @@ -22,7 +22,8 @@ drop table t1,t2; --replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State> # Embedded server is hardcoded to show "Writing to net" as STATE. ---replace_result "Writing to net" "NULL" +# ps-protocol will have Execute not Query +--replace_result "Writing to net" "NULL" "Execute" "Query" --replace_regex /localhost[:0-9]*/localhost/ SHOW PROCESSLIST; diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 3b2445ad83d..0f965cc810a 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1197,7 +1197,7 @@ end// call p()// drop procedure p// -drop table t1; +drop table t1// create procedure p () begin diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 13ca9a528c6..3adbe95f837 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -47,7 +47,9 @@ insert into t1 values (5,5,5); check table t1 changed; check table t1 medium; check table t1 extended; +--disable_ps_protocol show index from t1; +--enable_ps_protocol --disable_metadata --error ER_DUP_ENTRY insert into t1 values (5,5,5); @@ -72,7 +74,9 @@ drop table t1; show variables like "wait_timeout%"; show variables like "WAIT_timeout%"; show variables like "this_doesn't_exists%"; +--disable_ps_protocol show table status from test like "this_doesn't_exists%"; +--enable_ps_protocol show databases; show databases like "test%"; --disable_metadata @@ -409,7 +413,9 @@ CREATE TABLE t1( PRIMARY KEY(field1(1000)) ); --enable_metadata +--disable_ps_protocol show index from t1; +--enable_ps_protocol --disable_metadata drop table t1; @@ -707,11 +713,15 @@ set names utf8; --echo ---------------------------------------------------------------- +--disable_ps_protocol SHOW CHARACTER SET LIKE 'utf8'; +--enable_ps_protocol --echo ---------------------------------------------------------------- +--disable_ps_protocol SHOW COLLATION LIKE 'latin1_bin'; +--enable_ps_protocol --echo ---------------------------------------------------------------- @@ -727,7 +737,9 @@ SHOW CREATE TABLE t1; --echo ---------------------------------------------------------------- +--disable_ps_protocol SHOW INDEX FROM t1; +--enable_ps_protocol --echo ---------------------------------------------------------------- @@ -774,8 +786,10 @@ SHOW COLUMNS FROM t1; --echo ---------------------------------------------------------------- +--disable_ps_protocol --replace_column 6 # SHOW TRIGGERS LIKE 't1'; +--enable_ps_protocol --echo ---------------------------------------------------------------- @@ -1364,9 +1378,11 @@ let $wait_timeout= 10; let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%GET_LOCK%' AND ID != CONNECTION_ID(); --source include/wait_condition.inc --replace_column 1 ### 3 ### 6 ### 7 ### +--replace_result "Execute" "Query" SHOW PROCESSLIST; SET NAMES utf8; --replace_column 1 ### 3 ### 6 ### 7 ### +--replace_result "Execute" "Query" SHOW PROCESSLIST; SELECT RELEASE_LOCK('t'); --connection con1 diff --git a/mysql-test/t/sp-ucs2.test b/mysql-test/t/sp-ucs2.test index 3532169e5a1..a1aec8071b4 100644 --- a/mysql-test/t/sp-ucs2.test +++ b/mysql-test/t/sp-ucs2.test @@ -52,16 +52,16 @@ CREATE FUNCTION f() BEGIN RETURN ''; END| -SHOW CREATE FUNCTION f; -DROP FUNCTION f; +SHOW CREATE FUNCTION f| +DROP FUNCTION f| CREATE FUNCTION f() RETURNS VARCHAR(64) BINARY UNICODE BEGIN RETURN ''; END| -SHOW CREATE FUNCTION f; -DROP FUNCTION f; +SHOW CREATE FUNCTION f| +DROP FUNCTION f| # @@ -72,16 +72,16 @@ CREATE FUNCTION f() BEGIN RETURN ''; END| -SHOW CREATE FUNCTION f; -DROP FUNCTION f; +SHOW CREATE FUNCTION f| +DROP FUNCTION f| CREATE FUNCTION f() RETURNS VARCHAR(64) BINARY ASCII BEGIN RETURN ''; END| -SHOW CREATE FUNCTION f; -DROP FUNCTION f; +SHOW CREATE FUNCTION f| +DROP FUNCTION f| # # Testing COLLATE in OUT parameter diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index cafcee0391e..ac80c6cbf87 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -8051,7 +8051,7 @@ create procedure p1() begin select * from t1; end$ call p1$ create table t1 (a integer)$ call p1$ -alter table t1 add b integer; +alter table t1 add b integer$ call p1$ delimiter ;$ diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test index 41bfd871c39..1b481767fbe 100644 --- a/mysql-test/t/sp_notembedded.test +++ b/mysql-test/t/sp_notembedded.test @@ -118,7 +118,7 @@ end| # a procedure which use tables and recursion create table t3 (a int)| insert into t3 values (0)| -create view v1 as select a from t3; +create view v1 as select a from t3| create procedure bug10100pt(level int, lim int) begin if level < lim then diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index a9759b99269..7d6faba9789 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -689,7 +689,7 @@ END| LOCK TABLES t1 WRITE| CALL p1()| -FLUSH TABLES; +FLUSH TABLES| UNLOCK TABLES| CALL p1()| diff --git a/mysql-test/t/subselect_sj_mat.test b/mysql-test/t/subselect_sj_mat.test index 7853b528e8f..4bd8dfdf058 100644 --- a/mysql-test/t/subselect_sj_mat.test +++ b/mysql-test/t/subselect_sj_mat.test @@ -1570,7 +1570,9 @@ INSERT INTO t2 values(1),(2); EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a HAVING a > 1); flush status; CREATE TABLE t3 SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a HAVING a > 1); +--disable_ps_protocol SHOW STATUS LIKE 'Created_tmp_tables'; +--enable_ps_protocol DROP TABLE t1,t2,t3; --echo # diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index fb44362b537..b44ae2a0a76 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -115,8 +115,10 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES ('2002-10-24 14:50:32'),('2002-10-24 14:50:33'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40'); flush status; +--disable_ps_protocol select * from t1 group by d; show status like "created_tmp%tables"; +--enable_ps_protocol drop table t1; # Fix for BUG#8921: Check that temporary table is ingored by view commands. diff --git a/mysql-test/t/tmp_table_count-7586.test b/mysql-test/t/tmp_table_count-7586.test index e7bac127815..8bfb0e7c5cf 100644 --- a/mysql-test/t/tmp_table_count-7586.test +++ b/mysql-test/t/tmp_table_count-7586.test @@ -9,12 +9,16 @@ create view v2 as select a from t2; flush status; select * from v2; +--disable_ps_protocol show status like '%Created_tmp%'; +--enable_ps_protocol explain select * from v2; select * from (select * from t2) T1; +--disable_ps_protocol show status like '%Created_tmp%'; +--enable_ps_protocol explain select * from (select * from t2) T1; diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test index 5a02c038caa..af26a69c581 100644 --- a/mysql-test/t/type_year.test +++ b/mysql-test/t/type_year.test @@ -214,6 +214,17 @@ SELECT * FROM t1 WHERE a=10 AND a>=10; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND a>=10; DROP TABLE t1; + +--echo # +--echo # MDEV-16958 Assertion `field_length < 5' failed in Field_year::val_str or data corruption upon SELECT with UNION and aggregate functions +--echo # + +CREATE TABLE t1 (f YEAR); +INSERT IGNORE INTO t1 VALUES (1971),(1972); +SELECT MAX( NULLIF( f, '1900' ) ) AS f FROM t1 UNION SELECT MAX( NULLIF( f, '1900' ) ) AS f FROM t1; +DROP TABLE t1; + + --echo # --echo # End of 10.1 tests --echo # diff --git a/mysql-test/t/userstat.test b/mysql-test/t/userstat.test index 9ce3a32c442..547138cfeaa 100644 --- a/mysql-test/t/userstat.test +++ b/mysql-test/t/userstat.test @@ -73,8 +73,11 @@ select * from information_schema.index_statistics; select * from information_schema.table_statistics; show table_statistics; show index_statistics; ---query_vertical select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics; ---query_vertical select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics; +--query_vertical select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics; +--query_vertical select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics; +# different values in --ps-protocol +select OTHER_COMMANDS IN (7,8) from information_schema.client_statistics; +select OTHER_COMMANDS IN (7,8) from information_schema.user_statistics; flush table_statistics; flush index_statistics; select * from information_schema.index_statistics; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 76c47be3efc..7fa7807d19a 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2433,6 +2433,7 @@ DROP TABLE t1; # Bug#15943 mysql_next_result hangs on invalid SHOW CREATE VIEW # +--disable_ps_protocol delimiter //; drop table if exists t1; drop view if exists v1; @@ -2443,6 +2444,7 @@ show create view v1; drop view v1; // delimiter ;// +--enable_ps_protocol # @@ -3953,7 +3955,9 @@ CREATE VIEW v1 AS SELECT f1() FROM t1; let $MYSQLD_DATADIR= `SELECT @@datadir`; copy_file std_data/bug48449.frm $MYSQLD_DATADIR/test/v2.frm; +enable_prepare_warnings; SHOW CREATE VIEW v1; +disable_prepare_warnings; DROP VIEW v1,v2; DROP TABLE t1,t2; |