diff options
Diffstat (limited to 'mysql-test')
129 files changed, 1768 insertions, 189 deletions
diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index 1ab9cd9b1e7..a16e82f2364 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -33,6 +33,7 @@ debug-no-sync # Retry bind as this may fail on busy server port-open-timeout=10 +bind-address=127.0.0.1 log-bin-trust-function-creators=1 key_buffer_size= 1M diff --git a/mysql-test/include/have_ipv6.inc b/mysql-test/include/have_ipv6.inc deleted file mode 100644 index 752dd0db53e..00000000000 --- a/mysql-test/include/have_ipv6.inc +++ /dev/null @@ -1,20 +0,0 @@ -# Check if ipv6 is available. -# ---disable_query_log ---disable_result_log ---disable_abort_on_error -connect (checkcon123456789,::1,root,,test); -if($mysql_errno) -{ - skip No IPv6 support; -} -connection default; -if(!$mysql_errno) -{ - disconnect checkcon123456789; -} ---enable_abort_on_error ---enable_result_log ---enable_query_log -# end check - diff --git a/mysql-test/suite/perfschema/include/no_protocol.inc b/mysql-test/include/no_protocol.inc index 451c22f62e3..8ffd3509afc 100644 --- a/mysql-test/suite/perfschema/include/no_protocol.inc +++ b/mysql-test/include/no_protocol.inc @@ -1,5 +1,3 @@ -# Tests for the performance schema - # The file with expected results fits only to a run without # ps-protocol/sp-protocol/cursor-protocol/view-protocol. if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 6dae1c2838d..43d0ace3d96 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1488,6 +1488,17 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; DROP TABLE t1; +CREATE TABLE t1 ( +`transaction_id` int(11) NOT NULL DEFAULT '0', +KEY `transaction_id` (`transaction_id`)); +ALTER TABLE t1 DROP KEY IF EXISTS transaction_id, ADD PRIMARY KEY IF NOT EXISTS (transaction_id); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `transaction_id` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`transaction_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; # Bug#11748057 (formerly known as 34972): ALTER TABLE statement doesn't # identify correct column name. # diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 5a990fda971..4b519e213ef 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -6040,6 +6040,21 @@ DROP TABLE t1; # End of ctype_utf8_ilseq.inc # # +# MDEV-8067 correct fix for MySQL Bug # 19699237: UNINITIALIZED VARIABLE IN ITEM_FIELD::STR_RESULT +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8); +CREATE TABLE t2 (a VARCHAR(10) CHARACTER SET latin1); +INSERT INTO t1 VALUES ('aaa'); +INSERT INTO t2 VALUES ('aaa'); +SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); +(SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2) +1 +INSERT INTO t1 VALUES ('aaa'); +INSERT INTO t2 VALUES ('aaa'); +SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1, t2; +# # End of 5.5 tests # # diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index cc4e8074395..04ab385bca6 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -1455,6 +1455,12 @@ Warnings: Warning 1918 Encountered illegal value '18446744073709552001' when converting to INT Note 1105 Cast to signed converted positive out-of-range integer to it's negative complement # +# MDEV-7505 - Too large scale in DECIMAL dynamic column getter crashes +# mysqld +# +SELECT COLUMN_GET(`x`, 'y' AS DECIMAL(5,34)); +ERROR 42000: Too big scale 34 specified for ''y''. Maximum is 30. +# # test of symbolic names # # creation test (names) diff --git a/mysql-test/r/empty_server_name-8224.result b/mysql-test/r/empty_server_name-8224.result new file mode 100644 index 00000000000..6423114470d --- /dev/null +++ b/mysql-test/r/empty_server_name-8224.result @@ -0,0 +1 @@ +create server '' foreign data wrapper w2 options (host '127.0.0.1'); diff --git a/mysql-test/r/func_regexp_pcre.result b/mysql-test/r/func_regexp_pcre.result index 641c4fddbf7..aa090c9faf6 100644 --- a/mysql-test/r/func_regexp_pcre.result +++ b/mysql-test/r/func_regexp_pcre.result @@ -845,3 +845,32 @@ SET default_regex_flags=DEFAULT; SELECT REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that'); REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that') 1 this and that +# +# MDEV-8102 REGEXP function fails to match hex values when expression is stored as a variable +# +# Testing a warning +SET NAMES latin1; +SET @regCheck= '\\xE0\\x01'; +SELECT 0xE001 REGEXP @regCheck; +0xE001 REGEXP @regCheck +0 +Warnings: +Warning 1139 Got error 'pcre_exec: Invalid utf8 byte sequence in the subject string' from regexp +# Testing workaround N1: This makes the pattern to be a binary string: +SET NAMES latin1; +SET @regCheck= X'E001'; +SELECT 0xE001 REGEXP @regCheck; +0xE001 REGEXP @regCheck +1 +# Testing workaround N2: This also makes the pattern to be a binary string, using a different syntax: +SET NAMES latin1; +SET @regCheck= _binary '\\xE0\\x01'; +SELECT 0xE001 REGEXP @regCheck; +0xE001 REGEXP @regCheck +1 +# Testing workarond N3: This makes derivation of the subject string stronger (IMLICIT instead of COERCIBLE) +SET NAMES latin1; +SET @regCheck= '\\xE0\\x01'; +SELECT CAST(0xE001 AS BINARY) REGEXP @regCheck; +CAST(0xE001 AS BINARY) REGEXP @regCheck +1 diff --git a/mysql-test/r/func_regexp_pcre_debug.result b/mysql-test/r/func_regexp_pcre_debug.result new file mode 100644 index 00000000000..e44492fca72 --- /dev/null +++ b/mysql-test/r/func_regexp_pcre_debug.result @@ -0,0 +1,10 @@ +SET debug_dbug='+d,pcre_exec_error_123'; +SELECT 'a' RLIKE 'a'; +'a' RLIKE 'a' +0 +Warnings: +Warning 1139 Got error 'pcre_exec: Internal error (-123)' from regexp +SET debug_dbug=''; +SELECT 'a' RLIKE 'a'; +'a' RLIKE 'a' +1 diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 1943c511853..0a2bbc97e25 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -2701,3 +2701,45 @@ id date1 date2 DATE_ADD(a.date1,INTERVAL -10 DAY) TO_DAYS(a.date1)-10 17 NULL NULL NULL NULL 18 2010-10-13 2010-10-03 2010-10-03 734413 DROP TABLE t1; +# +# Start of 10.0 tests +# +# +# MDEV-8205 timediff returns null when comparing decimal time to time string value +# +SELECT +TIMEDIFF('2014-01-01 00:00:00' , '2014-01-01 01:00:00' ) AS str_str, +TIMEDIFF('2014-01-01 00:00:00' , 20140101010000.000 ) AS str_dec, +TIMEDIFF(20140101000000.000 , 20140101010000.000 ) AS dec_dec, +TIMEDIFF(20140101000000.000 , '2014-01-01 01:00:00' ) AS dec_str; +str_str str_dec dec_dec dec_str +-01:00:00 -01:00:00.000 -01:00:00.000 -01:00:00.000 +SELECT +TIMEDIFF('2014-01-01 00:00:00' , '2014-01-02 01:00:00' ) AS str_str, +TIMEDIFF('2014-01-01 00:00:00' , 20140102010000.000 ) AS str_dec, +TIMEDIFF(20140101000000.000 , 20140102010000.000 ) AS dec_dec, +TIMEDIFF(20140101000000.000 , '2014-01-02 01:00:00' ) AS dec_str; +str_str str_dec dec_dec dec_str +-25:00:00 -25:00:00.000 -25:00:00.000 -25:00:00.000 +SELECT +TIMEDIFF('2014-01-01 00:00:00' , '2014-02-02 01:00:00' ) AS str_str, +TIMEDIFF('2014-01-01 00:00:00' , 20140202010000.000 ) AS str_dec, +TIMEDIFF(20140101000000.000 , 20140202010000.000 ) AS dec_dec, +TIMEDIFF(20140101000000.000 , '2014-02-02 01:00:00' ) AS dec_str; +str_str str_dec dec_dec dec_str +-769:00:00 -769:00:00.000 -769:00:00.000 -769:00:00.000 +SELECT +TIMEDIFF('2014-01-01 00:00:00' , '2014-03-02 01:00:00' ) AS str_str, +TIMEDIFF('2014-01-01 00:00:00' , 20140302010000.000 ) AS str_dec, +TIMEDIFF(20140101000000.000 , 20140302010000.000 ) AS dec_dec, +TIMEDIFF(20140101000000.000 , '2014-03-02 01:00:00' ) AS dec_str; +str_str str_dec dec_dec dec_str +-838:59:59 -838:59:59.999 -838:59:59.999 -838:59:59.999 +Warnings: +Warning 1292 Truncated incorrect time value: '-1441:00:00' +Warning 1292 Truncated incorrect time value: '-1441:00:00' +Warning 1292 Truncated incorrect time value: '-1441:00:00' +Warning 1292 Truncated incorrect time value: '-1441:00:00' +# +# End of 10.0 tests +# diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 9f5eb053cb7..38abbfef261 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -2342,7 +2342,7 @@ DROP TABLE t1; create table t1 (a int, b int); insert into t1 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); create table t2 (c int, d int); -insert into t2 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); +insert into t2 values (1,11), (2,22), (4,44); select distinct a,sum(b), (select d from t2 where c=a order by max(b) limit 1) from t1 group by a order by max(b); a sum(b) (select d from t2 where c=a order by max(b) limit 1) 1 23 11 diff --git a/mysql-test/r/information_schema2.result b/mysql-test/r/information_schema2.result index 60a20944839..f82301699a7 100644 --- a/mysql-test/r/information_schema2.result +++ b/mysql-test/r/information_schema2.result @@ -6,3 +6,15 @@ select variable_name from information_schema.session_variables where variable_na (select variable_name from information_schema.session_variables where variable_name = 'basedir'); variable_name BASEDIR +create table t1 (a char); +insert t1 values ('a'),('t'),('z'); +flush status; +select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1; +a exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) +a 0 +t 1 +z 0 +show status like 'created_tmp_tables'; +Variable_name Value +Created_tmp_tables 43 +drop table t1; diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index a99aed61cd9..093de1339f3 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -2527,6 +2527,17 @@ test.t1 check error Size of indexfile is: 1024 Should be: 2048 test.t1 check warning Size of datafile is: 14 Should be: 7 test.t1 check error Corrupt DROP TABLE t1; +# +# MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with +# disabled keys +# +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (4),(3),(1),(0); +ALTER TABLE t1 DISABLE KEYS; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +DROP TABLE t1; show variables like 'myisam_block_size'; Variable_name Value myisam_block_size 1024 diff --git a/mysql-test/r/mysql_tzinfo_to_sql_symlink.result b/mysql-test/r/mysql_tzinfo_to_sql_symlink.result index c00a0c73ce3..03543244105 100644 --- a/mysql-test/r/mysql_tzinfo_to_sql_symlink.result +++ b/mysql-test/r/mysql_tzinfo_to_sql_symlink.result @@ -76,3 +76,16 @@ set @toggle=1; execute set_wsrep_myisam using @toggle; TRUNCATE TABLE time_zone_leap_second; ALTER TABLE time_zone_leap_second ORDER BY Transition_time; set @toggle=0; execute set_wsrep_myisam using @toggle; +# +# MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL +# +set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?'); +prepare set_wsrep_myisam from @prep; +set @toggle=1; execute set_wsrep_myisam using @toggle; +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; +set @toggle=0; execute set_wsrep_myisam using @toggle; diff --git a/mysql-test/r/mysql_upgrade_view.result b/mysql-test/r/mysql_upgrade_view.result index 9490544e4d5..ef54ab6c9a5 100644 --- a/mysql-test/r/mysql_upgrade_view.result +++ b/mysql-test/r/mysql_upgrade_view.result @@ -3,6 +3,41 @@ drop table if exists t1,v1,v2,v3,v4,v1badcheck; drop view if exists t1,v1,v2,v3,v4,v1badcheck; create table t1(a int); create table kv(k varchar(30) NOT NULL PRIMARY KEY,v varchar(50)); +create view v1 as select 1; +repair table t1 quick; +Table Op Msg_type Msg_text +test.t1 repair status OK +repair table t1 extended; +Table Op Msg_type Msg_text +test.t1 repair status OK +repair table t1 use_frm; +Table Op Msg_type Msg_text +test.t1 repair status OK +repair table t1 from mysql; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'from mysql' at line 1 +repair view v1 quick; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'quick' at line 1 +repair view v1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'extended' at line 1 +repair view v1 use_frm; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'use_frm' at line 1 +repair view v1 from mysql; +Table Op Msg_type Msg_text +test.v1 repair status OK +check view v1 quick; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'quick' at line 1 +check view v1 fast; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'fast' at line 1 +check view v1 medium; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'medium' at line 1 +check view v1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'extended' at line 1 +check view v1 changed; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'changed' at line 1 +check view v1 for upgrade; +Table Op Msg_type Msg_text +test.v1 check status OK +drop view v1; flush tables; check view v1; Table Op Msg_type Msg_text diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index adfc56fcd69..7d646dce596 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -347,3 +347,26 @@ CREATE TABLE test.`t.1` (id int); mysqlcheck test t.1 test.t.1 OK drop table test.`t.1`; +create view v1 as select 1; +mysqlcheck --process-views test +test.v1 OK +mysqlcheck --process-views --extended test +test.v1 OK +mysqlcheck --process-views --fast test +mysqlcheck --process-views --quick test +test.v1 OK +mysqlcheck --process-views --check-only-changed test +mysqlcheck --process-views --medium-check test +test.v1 OK +mysqlcheck --process-views --check-upgrade test +test.v1 OK +drop view v1; +create table t1(a int); +mysqlcheck --process-views --check-upgrade --auto-repair test +test.t1 OK +test.v1 Needs upgrade + +Repairing views +test.v1 OK +drop view v1; +drop table t1; diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index 92c9c01db2d..798e3b9a6bf 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -380,33 +380,33 @@ DROP TABLE t1; create table t1 (a int) engine=innodb partition by hash(a) ; show table status like 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (0), (1), (2), (3); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 4 4096 16384 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 4 4096 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int auto_increment primary key) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 2 8192 16384 0 0 # 1 NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 2 8192 16384 0 0 # 1 # NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 4 4096 16384 0 0 # 5 NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 4 4096 16384 0 0 # 5 # NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 8 2048 16384 0 0 # 9 NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 8 2048 16384 0 0 # 9 # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int) partition by key (a) @@ -588,6 +588,17 @@ a b 0 1 DROP TABLE t1; # +# Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE +# WRONG FOR PARTITIONED TABLES +# +CREATE TABLE t1 (a int, PRIMARY KEY (a)) ENGINE=InnoDB +PARTITION BY HASH (a) PARTITIONS 2; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE +CREATE_TIME IS NOT NULL AND TABLE_NAME='t1'; +COUNT(*) +1 +DROP TABLE t1; +# # BUG#12912171 - ASSERTION FAILED: QUICK->HEAD->READ_SET == # SAVE_READ_SET # diff --git a/mysql-test/r/partition_myisam.result b/mysql-test/r/partition_myisam.result index 80b3a9511ea..bb1a7b19a9d 100644 --- a/mysql-test/r/partition_myisam.result +++ b/mysql-test/r/partition_myisam.result @@ -90,7 +90,7 @@ ERROR HY000: Failed to read from the .par file # Note that it is currently impossible to drop a partitioned table # without the .par file DROP TABLE t1; -ERROR 42S02: Unknown table 'test.t1' +ERROR HY000: Got error 1 "Operation not permitted" from storage engine partition # # Bug#50392: insert_id is not reset for partitioned tables # auto_increment on duplicate entry diff --git a/mysql-test/r/partition_not_blackhole.result b/mysql-test/r/partition_not_blackhole.result index c5832d66da4..ff1e51df892 100644 --- a/mysql-test/r/partition_not_blackhole.result +++ b/mysql-test/r/partition_not_blackhole.result @@ -11,6 +11,6 @@ t1 SHOW CREATE TABLE t1; ERROR HY000: Failed to read from the .par file DROP TABLE t1; -ERROR 42S02: Unknown table 'test.t1' +ERROR HY000: Got error 1 "Operation not permitted" from storage engine partition t1.frm t1.par diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index 42a29f25432..74b312359a8 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -321,3 +321,16 @@ UNUSABLE uninstall soname 'ha_example'; select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; plugin_name +# +# MDEV-5309 - RENAME TABLE does not check for existence of the table's +# engine +# +INSTALL PLUGIN example SONAME 'ha_example'; +CREATE TABLE t1(a INT) ENGINE=EXAMPLE; +SELECT * FROM t1; +a +FLUSH TABLES; +UNINSTALL PLUGIN example; +RENAME TABLE t1 TO t2; +ERROR 42S02: Table 'test.t1' doesn't exist +DROP TABLE t1; diff --git a/mysql-test/r/range_innodb.result b/mysql-test/r/range_innodb.result new file mode 100644 index 00000000000..794e6c7b3cc --- /dev/null +++ b/mysql-test/r/range_innodb.result @@ -0,0 +1,39 @@ +# +# Range optimizer (and related) tests that need InnoDB. +# +drop table if exists t0, t1, t2; +# +# MDEV-6735: Range checked for each record used with key +# +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1(a int); +insert into t1 select A.a + B.a* 10 + C.a * 100 + D.a * 1000 +from t0 A, t0 B, t0 C, t0 D; +create table t2 ( +a int, +b int, +filler1 char(100), +filler2 char(100), +filler3 char(100), +filler4 char(100), +key(a), +key(b) +) engine=innodb; +insert into t2 +select +a,a, +repeat('0123456789', 10), +repeat('0123456789', 10), +repeat('0123456789', 10), +repeat('0123456789', 10) +from t1; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +# The following must not use "Range checked for each record": +explain select * from t0 left join t2 on t2.a <t0.a and t2.b between 50 and 250; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 +1 SIMPLE t2 range a,b b 5 NULL 201 Using where; Using join buffer (flat, BNL join) +drop table t0,t1,t2; diff --git a/mysql-test/r/ssl_7937,nossl.result b/mysql-test/r/ssl_7937,nossl.result new file mode 100644 index 00000000000..72693233bc8 --- /dev/null +++ b/mysql-test/r/ssl_7937,nossl.result @@ -0,0 +1,15 @@ +create procedure have_ssl() +select if(variable_value > '','yes','no') as 'have_ssl' + from information_schema.session_status +where variable_name='ssl_cipher'; +mysql --ssl-ca=cacert.pem -e "call test.have_ssl()" +have_ssl +no +mysql --ssl -e "call test.have_ssl()" +have_ssl +no +mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" +ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it +mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()" +ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it +drop procedure have_ssl; diff --git a/mysql-test/r/ssl_7937.result b/mysql-test/r/ssl_7937.result new file mode 100644 index 00000000000..a94ca3b3529 --- /dev/null +++ b/mysql-test/r/ssl_7937.result @@ -0,0 +1,16 @@ +create procedure have_ssl() +select if(variable_value > '','yes','no') as 'have_ssl' + from information_schema.session_status +where variable_name='ssl_cipher'; +mysql --ssl-ca=cacert.pem -e "call test.have_ssl()" +have_ssl +yes +mysql --ssl -e "call test.have_ssl()" +have_ssl +yes +mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" +have_ssl +yes +mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()" +ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate +drop procedure have_ssl; diff --git a/mysql-test/r/truncate-stale-6500.result b/mysql-test/r/truncate-stale-6500.result new file mode 100644 index 00000000000..b6222716953 --- /dev/null +++ b/mysql-test/r/truncate-stale-6500.result @@ -0,0 +1,33 @@ +SET GLOBAL query_cache_size=1024*1024*8; +CREATE TABLE `test` ( +`uniqueId` INT NOT NULL, +`partitionId` INT NOT NULL, +PRIMARY KEY (`uniqueId`,`partitionId`) +) ENGINE=InnoDB PARTITION BY LIST (partitionId) ( +PARTITION p01 VALUES IN (1), +PARTITION p02 VALUES IN (2) +); +INSERT INTO `test`(`uniqueId`,`partitionId`) VALUES(407237055, 2); +SELECT * FROM `test`; +uniqueId partitionId +407237055 2 +#Confirms 1 row in partition 'p02' +SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test'; +TABLE_NAME PARTITION_NAME TABLE_ROWS +test p01 0 +test p02 1 +ALTER TABLE `test` TRUNCATE PARTITION `p02`; +#Confirms no more rows in partition 'p02' +SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test'; +TABLE_NAME PARTITION_NAME TABLE_ROWS +test p01 0 +test p02 0 +#Before the patch, this returned the previously existing values. +SELECT * FROM `test`; +uniqueId partitionId +SELECT SQL_CACHE * FROM `test`; +uniqueId partitionId +SELECT SQL_NO_CACHE * FROM `test`; +uniqueId partitionId +DROP TABLE test; +SET GLOBAL query_cache_size=DEFAULT; diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index f8649f030bb..cde8816dee4 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -994,3 +994,24 @@ GROUP BY t2.col0 WHERE CONCAT(t1.col1, CAST(subq.col0 AS DECIMAL)); 1 DROP TABLE t1, t2; +# +# Start of 5.5 tests +# +# +# MDEV-8267 Add /*old*/ comment into I_S.COLUMN_TYPE for old DECIMAL +# +SHOW CREATE TABLE t1dec102; +Table Create Table +t1dec102 CREATE TABLE `t1dec102` ( + `a` decimal(10,2)/*old*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW COLUMNS FROM t1dec102; +Field Type Null Key Default Extra +a decimal(10,2)/*old*/ YES NULL +SELECT COLUMN_NAME, DATA_TYPE, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1dec102'; +COLUMN_NAME DATA_TYPE COLUMN_TYPE +a decimal decimal(10,2)/*old*/ +DROP TABLE t1dec102; +# +# End of 5.5 tests +# diff --git a/mysql-test/r/type_time_hires.result b/mysql-test/r/type_time_hires.result index 8096785dcc1..2620dac0794 100644 --- a/mysql-test/r/type_time_hires.result +++ b/mysql-test/r/type_time_hires.result @@ -115,7 +115,6 @@ NULL delete from t1 where a < 20110101; select * from t1; a -01:02:13.3332 NULL create table t2 select * from t1; create table t3 like t1; @@ -135,12 +134,11 @@ Warnings: Note 1265 Data truncated for column 'a' at row 1 select a, a+0, a-1, a*1, a/2 from t1; a a+0 a-1 a*1 a/2 -01:02:13.3332 10213.3332 10212.3332 10213.3332 5106.66660000 NULL NULL NULL NULL NULL 14:15:16.2222 141516.2222 141515.2222 141516.2222 70758.11110000 select max(a), min(a), sum(a), avg(a) from t1; max(a) min(a) sum(a) avg(a) -14:15:16.2222 01:02:13.3332 151729.5554 75864.77770000 +14:15:16.2222 14:15:16.2222 141516.2222 141516.22220000 create table t2 select a, a+0, a-1, a*1, a/2 from t1; create table t3 select max(a), min(a), sum(a), avg(a) from t1; show create table t2; diff --git a/mysql-test/r/update_innodb.result b/mysql-test/r/update_innodb.result new file mode 100644 index 00000000000..88c86c50625 --- /dev/null +++ b/mysql-test/r/update_innodb.result @@ -0,0 +1,31 @@ +CREATE TABLE `t1` ( +`c1` int(11) NOT NULL, +`c2` datetime DEFAULT NULL, +PRIMARY KEY (`c1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE `t2` ( +`c0` varchar(10) NOT NULL, +`c1` int(11) NOT NULL, +`c2` int(11) NOT NULL, +PRIMARY KEY (`c0`,`c1`), +KEY `c1` (`c1`), +KEY `c2` (`c2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE `t3` ( +`id` int(11) unsigned NOT NULL AUTO_INCREMENT, +`c1` datetime NOT NULL, +`c2` bigint(20) NOT NULL, +`c3` int(4) unsigned NOT NULL, +PRIMARY KEY (`id`), +KEY `c2` (`c2`), +KEY `c3` (`c3`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE `t4` ( +`c1` int(11) NOT NULL, +`c2` bigint(20) DEFAULT NULL, +`c3` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select `t4`.`c1` AS `c1`,`t4`.`c2` AS `c2`,`t4`.`c3` AS `c3` from `t4`; +UPDATE t1 a JOIN t2 b ON a.c1 = b.c1 JOIN v1 vw ON b.c2 = vw.c1 JOIN t3 del ON vw.c2 = del.c2 SET a.c2 = ( SELECT max(t.c1) FROM t3 t, v1 i WHERE del.c2 = t.c2 AND vw.c3 = i.c3 AND t.c3 = 4 ) WHERE a.c2 IS NULL OR a.c2 < '2011-05-01'; +drop view v1; +drop table t1,t2,t3,t4; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index abb9c6240d3..d8b71fb119c 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -5410,6 +5410,24 @@ create view v2 as select t2.* from (t2 left join v1 using (id)); update t3 left join v2 using (id) set flag=flag+1; drop view v2, v1; drop table t1, t2, t3; +# +# MDEV-7207 - ALTER VIEW does not change ALGORITM +# +create table t1 (a int, b int); +create algorithm=temptable view v2 (c) as select b+1 from t1; +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +alter algorithm=undefined view v2 (c) as select b+1 from t1; +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +alter algorithm=merge view v2 (c) as select b+1 from t1; +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +drop view v2; +drop table t1; # ----------------------------------------------------------------- # -- End of 5.5 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/std_data/old_decimal/t1dec102.MYD b/mysql-test/std_data/old_decimal/t1dec102.MYD new file mode 100644 index 00000000000..59e43854d4a --- /dev/null +++ b/mysql-test/std_data/old_decimal/t1dec102.MYD @@ -0,0 +1 @@ +ý 123.45ý 123.46ý 123.47
\ No newline at end of file diff --git a/mysql-test/std_data/old_decimal/t1dec102.MYI b/mysql-test/std_data/old_decimal/t1dec102.MYI Binary files differnew file mode 100644 index 00000000000..e0b2d4a003c --- /dev/null +++ b/mysql-test/std_data/old_decimal/t1dec102.MYI diff --git a/mysql-test/std_data/old_decimal/t1dec102.frm b/mysql-test/std_data/old_decimal/t1dec102.frm Binary files differnew file mode 100644 index 00000000000..652cfc3bbac --- /dev/null +++ b/mysql-test/std_data/old_decimal/t1dec102.frm diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result index 714c01d8426..0372d2749a8 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result @@ -327,6 +327,18 @@ INSERT INTO t2 SET a=1; INSERT INTO t2 SET b=1; UPDATE t1, t2 SET t1.a=10, t2.a=20; DROP TABLE t1,t2; +INSERT INTO t1dec102 VALUES (-999.99); +INSERT INTO t1dec102 VALUES (0); +INSERT INTO t1dec102 VALUES (999.99); +SELECT * FROM t1dec102 ORDER BY a; +a +-999.99 +0.00 +123.45 +123.46 +123.47 +999.99 +DROP TABLE t1dec102; flush logs; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; @@ -4555,6 +4567,62 @@ SET TIMESTAMP=1000000000/*!*/; DROP TABLE `t1`,`t2` /* generated by server */ /*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-317 +/*!100001 SET @@session.gtid_seq_no=317*//*!*/; +BEGIN +/*!*/; +# at # +# at # +#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number # +#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1dec102` +### SET +### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-318 +/*!100001 SET @@session.gtid_seq_no=318*//*!*/; +BEGIN +/*!*/; +# at # +# at # +#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number # +#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1dec102` +### SET +### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-319 +/*!100001 SET @@session.gtid_seq_no=319*//*!*/; +BEGIN +/*!*/; +# at # +# at # +#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number # +#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1dec102` +### SET +### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-320 ddl +/*!100001 SET @@session.gtid_seq_no=320*//*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +DROP TABLE `t1dec102` /* generated by server */ +/*!*/; +# at # #010909 4:46:40 server id 1 end_log_pos # Rotate to master-bin.000002 pos: 4 DELIMITER ; # End of log file diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test index 9b41c63d195..9609a9af384 100644 --- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test +++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test @@ -438,9 +438,20 @@ INSERT INTO t2 SET b=1; UPDATE t1, t2 SET t1.a=10, t2.a=20; DROP TABLE t1,t2; +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm +--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD +--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI + +INSERT INTO t1dec102 VALUES (-999.99); +INSERT INTO t1dec102 VALUES (0); +INSERT INTO t1dec102 VALUES (999.99); +SELECT * FROM t1dec102 ORDER BY a; +DROP TABLE t1dec102; + flush logs; -let $MYSQLD_DATADIR= `select @@datadir`; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ --exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001 diff --git a/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test b/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test index d6746d92250..88563b046df 100644 --- a/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test +++ b/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test @@ -25,10 +25,6 @@ let $fixed_bug_30395= 0; # The file with expected results fits only to a run without # ps-protocol/sp-protocol/cursor-protocol/view-protocol. -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL - + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} +--source include/no_protocol.inc --source suite/funcs_1/datadict/processlist_priv.inc diff --git a/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test b/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test index b92c963c79c..a03d3774484 100644 --- a/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test +++ b/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test @@ -20,10 +20,6 @@ # The file with expected results fits only to a run without # ps-protocol/sp-protocol/cursor-protocol/view-protocol. -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL - + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} +--source include/no_protocol.inc --source suite/funcs_1/datadict/processlist_val.inc diff --git a/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result b/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result new file mode 100644 index 00000000000..9f6b7ca6a23 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result @@ -0,0 +1,23 @@ +call mtr.add_suppression("InnoDB: The total blob data length"); +SET GLOBAL max_allowed_packet = 100*1024*1024; +# Connection big_packets: +CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB; +INSERT INTO t1 (a, b) VALUES (1, '1'); +INSERT INTO t1 (a, b) VALUES (2, '2'); +INSERT INTO t1 (a, b) VALUES (3, '3'); +INSERT INTO t1 (a, b) VALUES (4, '4'); +INSERT INTO t1 (a, b) VALUES (5, '5'); +start transaction; +INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024)); +ERROR 42000: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size. +# Connection default: +# Quick shutdown and restart server +# Connection default: +SELECT a FROM t1; +a +1 +2 +3 +4 +5 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/xa_recovery.result b/mysql-test/suite/innodb/r/xa_recovery.result new file mode 100644 index 00000000000..84cb37ef7c9 --- /dev/null +++ b/mysql-test/suite/innodb/r/xa_recovery.result @@ -0,0 +1,17 @@ +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +XA START 'x'; +UPDATE t1 set a=2; +XA END 'x'; +XA PREPARE 'x'; +call mtr.add_suppression("Found 1 prepared XA transactions"); +SELECT * FROM t1 LOCK IN SHARE MODE; +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT * FROM t1; +a +2 +XA ROLLBACK 'x'; +SELECT * FROM t1; +a +1 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/foreign-keys.test b/mysql-test/suite/innodb/t/foreign-keys.test index 8ee96347208..2d586e2d6be 100644 --- a/mysql-test/suite/innodb/t/foreign-keys.test +++ b/mysql-test/suite/innodb/t/foreign-keys.test @@ -1,11 +1,6 @@ --source include/have_innodb.inc --source include/have_debug.inc -if (`select plugin_auth_version <= "5.5.39-MariaDB-36.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB as of 5.5.39-MariaDB-36.0 or earlier -} - --echo # --echo # Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE --echo # ADD FOREIGN KEY diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test index 415ada2939a..ffe4ac9c3ae 100644 --- a/mysql-test/suite/innodb/t/innodb-autoinc.test +++ b/mysql-test/suite/innodb/t/innodb-autoinc.test @@ -1,8 +1,3 @@ -if (`select plugin_auth_version <= "5.5.37-MariaDB-34.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB as of 5.5.37-MariaDB-34.0 or earlier -} - --source include/have_innodb.inc # embedded server ignores 'delayed', so skip this -- source include/not_embedded.inc diff --git a/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test new file mode 100644 index 00000000000..16fb570737d --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test @@ -0,0 +1,55 @@ +--source include/not_embedded.inc +--source include/not_crashrep.inc +--source include/have_innodb.inc + +call mtr.add_suppression("InnoDB: The total blob data length"); + +let $old_max_allowed_packet = `select @@max_allowed_packet`; +SET GLOBAL max_allowed_packet = 100*1024*1024; + +--echo # Connection big_packets: +connect(big_packets,localhost,root,,); +connection big_packets; + +CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB; + +# Insert a few rows (it doesn't really matter how many). These transactions +# are committed once they are acked, so they should not be lost. +INSERT INTO t1 (a, b) VALUES (1, '1'); +INSERT INTO t1 (a, b) VALUES (2, '2'); +INSERT INTO t1 (a, b) VALUES (3, '3'); +INSERT INTO t1 (a, b) VALUES (4, '4'); +INSERT INTO t1 (a, b) VALUES (5, '5'); + +# The BLOB insert will fail, and should disappear. However all data committed +# up to this point should not be lost. +start transaction; +--replace_regex /\(> [0-9]*\)/(> ####)/ +--error ER_TOO_BIG_ROWSIZE +INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024)); + +--echo # Connection default: +connection default; + +# We expect a restart. +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +--echo # Quick shutdown and restart server +--shutdown_server 0 + +# Wait for the server to come back up, and reconnect. +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Connection default: +connection default; + +# We should see (1,2,3,4,5) here. +SELECT a FROM t1; + +# Clean up. +DROP TABLE t1; + +--disable_query_log +eval set global max_allowed_packet = $old_max_allowed_packet; +--enable_query_log diff --git a/mysql-test/suite/innodb/t/insert_debug.test b/mysql-test/suite/innodb/t/insert_debug.test index 666b634bef9..36ceba2ee8b 100644 --- a/mysql-test/suite/innodb/t/insert_debug.test +++ b/mysql-test/suite/innodb/t/insert_debug.test @@ -2,11 +2,6 @@ --source include/have_debug.inc --source include/have_partition.inc -if (`select plugin_auth_version < "5.6.22" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in InnoDB/XtraDB as of 5.6.21 or earlier -} - --echo # --echo # Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1 --echo # CAUSES INFINITE PAGE SPLIT diff --git a/mysql-test/suite/innodb/t/sp_temp_table.test b/mysql-test/suite/innodb/t/sp_temp_table.test index 9a6be85fd7e..b2883f551b9 100644 --- a/mysql-test/suite/innodb/t/sp_temp_table.test +++ b/mysql-test/suite/innodb/t/sp_temp_table.test @@ -1,11 +1,6 @@ --source include/have_innodb.inc --source include/big_test.inc -if (`select plugin_auth_version < "5.6.22" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in InnoDB/XtraDB as of 5.6.21 or earlier -} - --echo # --echo # Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE --echo # CALLED FROM A FUNCTION diff --git a/mysql-test/suite/innodb/t/strict_mode.test b/mysql-test/suite/innodb/t/strict_mode.test index 9b115091f84..86b56a09c0e 100644 --- a/mysql-test/suite/innodb/t/strict_mode.test +++ b/mysql-test/suite/innodb/t/strict_mode.test @@ -1,10 +1,5 @@ --source include/have_innodb.inc -if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier -} - --echo # --echo # Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN --echo # INNODB_STRICT_MODE = 1 diff --git a/mysql-test/suite/innodb/t/xa_recovery.test b/mysql-test/suite/innodb/t/xa_recovery.test new file mode 100644 index 00000000000..837b33cb3c4 --- /dev/null +++ b/mysql-test/suite/innodb/t/xa_recovery.test @@ -0,0 +1,47 @@ +if (`select plugin_auth_version <= "5.6.24" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in InnoDB as of 5.6.24 or earlier +} +--source include/have_innodb.inc +# Embedded server does not support restarting. +--source include/not_embedded.inc + +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +connect (con1,localhost,root); +XA START 'x'; UPDATE t1 set a=2; XA END 'x'; XA PREPARE 'x'; +connection default; + +call mtr.add_suppression("Found 1 prepared XA transactions"); + +# Kill and restart the server. +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +-- shutdown_server 0 +-- source include/wait_until_disconnected.inc + +-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +-- enable_reconnect +-- source include/wait_until_connected_again.inc +-- disable_reconnect + +disconnect con1; +connect (con1,localhost,root); +--send SELECT * FROM t1 LOCK IN SHARE MODE + +connection default; +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = 'Sending data' and + info = 'SELECT * FROM t1 LOCK IN SHARE MODE'; +--source include/wait_condition.inc + +--source include/restart_mysqld.inc + +disconnect con1; + +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT * FROM t1; +XA ROLLBACK 'x'; +SELECT * FROM t1; + +DROP TABLE t1; diff --git a/mysql-test/suite/maria/optimize.result b/mysql-test/suite/maria/optimize.result index 9cce55d6199..a78e8e469aa 100644 --- a/mysql-test/suite/maria/optimize.result +++ b/mysql-test/suite/maria/optimize.result @@ -6,3 +6,14 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK drop table t1; +# +# MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with +# disabled keys +# +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=Aria; +INSERT INTO t1 VALUES (4),(3),(1),(0); +ALTER TABLE t1 DISABLE KEYS; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +DROP TABLE t1; diff --git a/mysql-test/suite/maria/optimize.test b/mysql-test/suite/maria/optimize.test index 6b310b1d1a6..b1fc250cd29 100644 --- a/mysql-test/suite/maria/optimize.test +++ b/mysql-test/suite/maria/optimize.test @@ -160,3 +160,13 @@ INSERT /*! IGNORE */ INTO t1 VALUES ('urxjxqvwabikpugvexxbxdpxjkeqiuhhuadbcuhoz check table t1; OPTIMIZE TABLE t1; drop table t1; + +--echo # +--echo # MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with +--echo # disabled keys +--echo # +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=Aria; +INSERT INTO t1 VALUES (4),(3),(1),(0); +ALTER TABLE t1 DISABLE KEYS; +OPTIMIZE TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result index 268db30bda0..77129d6bebb 100644 --- a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result +++ b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result @@ -58,7 +58,10 @@ t1.frm t1.par SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish'; -SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; +SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION, +PARTITION_DESCRIPTION, TABLE_ROWS +FROM INFORMATION_SCHEMA.PARTITIONS +WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; SET DEBUG_SYNC = 'now WAIT_FOR parked'; # When waiting for the name lock in get_all_tables in sql_show.cc # this will not be concurrent any more, thus the TIMEOUT @@ -70,9 +73,9 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO PARTITION p10 VALUES LESS THAN MAXVALUE); Warnings: Warning 1639 debug sync point wait timed out -TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -def test t1 p0 NULL 1 NULL RANGE NULL a NULL 10 1 16384 16384 NULL 0 0 NULL NULL NULL NULL default NULL -def test t1 p10 NULL 2 NULL RANGE NULL a NULL MAXVALUE 3 5461 16384 NULL 0 0 NULL NULL NULL NULL default NULL +TABLE_SCHEMA TABLE_NAME PARTITION_NAME PARTITION_ORDINAL_POSITION PARTITION_DESCRIPTION TABLE_ROWS +test t1 p0 1 10 1 +test t1 p10 2 MAXVALUE 3 t1#P#p0.ibd t1#P#p10.ibd t1.frm diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test index fce26132030..df9c06011c2 100644 --- a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test +++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test @@ -62,7 +62,10 @@ SHOW CREATE TABLE t1; SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish'; send -SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; +SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION, + PARTITION_DESCRIPTION, TABLE_ROWS +FROM INFORMATION_SCHEMA.PARTITIONS +WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; connect (con1, localhost, root,,); SET DEBUG_SYNC = 'now WAIT_FOR parked'; diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes.result b/mysql-test/suite/percona/percona_innodb_fake_changes.result index 95f0c07cd11..1b870fdbb92 100644 --- a/mysql-test/suite/percona/percona_innodb_fake_changes.result +++ b/mysql-test/suite/percona/percona_innodb_fake_changes.result @@ -45,7 +45,7 @@ BEGIN; CREATE TABLE t2 (a INT) ENGINE=InnoDB; ERROR HY000: Can't create table `test`.`t2` (errno: 131 "Command not supported by database") DROP TABLE t1; -ERROR 42S02: Unknown table 'test.t1' +ERROR HY000: Storage engine InnoDB of the table `test`.`t1` doesn't have this option TRUNCATE TABLE t1; ERROR HY000: Got error 131 "Command not supported by database" during COMMIT ALTER TABLE t1 ENGINE=MyISAM; diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes.test b/mysql-test/suite/percona/percona_innodb_fake_changes.test index 5fa3ecc7b63..67f5450ba45 100644 --- a/mysql-test/suite/percona/percona_innodb_fake_changes.test +++ b/mysql-test/suite/percona/percona_innodb_fake_changes.test @@ -38,7 +38,7 @@ SET innodb_fake_changes=1; BEGIN; --error 1005 CREATE TABLE t2 (a INT) ENGINE=InnoDB; ---error 1051 +--error 1031 DROP TABLE t1; --error 1180 TRUNCATE TABLE t1; diff --git a/mysql-test/suite/perfschema/include/connection_setup.inc b/mysql-test/suite/perfschema/include/connection_setup.inc index da57b6dd388..a661d43d063 100644 --- a/mysql-test/suite/perfschema/include/connection_setup.inc +++ b/mysql-test/suite/perfschema/include/connection_setup.inc @@ -48,7 +48,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source ../include/wait_for_pfs_thread_count.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/include/digest_setup.inc b/mysql-test/suite/perfschema/include/digest_setup.inc index ed463f58d04..6efab880d32 100644 --- a/mysql-test/suite/perfschema/include/digest_setup.inc +++ b/mysql-test/suite/perfschema/include/digest_setup.inc @@ -1,5 +1,5 @@ # Making sure not to run when ps-protocol is set. ---source ../include/no_protocol.inc +--source include/no_protocol.inc --echo #################################### --echo # SETUP diff --git a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc index 769ba5f8607..ec35e60d463 100644 --- a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc +++ b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc @@ -62,7 +62,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source ../include/wait_for_pfs_thread_count.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/include/stage_setup.inc b/mysql-test/suite/perfschema/include/stage_setup.inc index 3558e43652e..639b1df8c02 100644 --- a/mysql-test/suite/perfschema/include/stage_setup.inc +++ b/mysql-test/suite/perfschema/include/stage_setup.inc @@ -24,7 +24,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc index 8efdc8d2f24..522cdb9346d 100644 --- a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc +++ b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc @@ -67,7 +67,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source ../include/wait_for_pfs_thread_count.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/r/threads_mysql.result b/mysql-test/suite/perfschema/r/threads_mysql.result index 4da857f83fc..6ab0b0641b0 100644 --- a/mysql-test/suite/perfschema/r/threads_mysql.result +++ b/mysql-test/suite/perfschema/r/threads_mysql.result @@ -13,7 +13,7 @@ processlist_user NULL processlist_host NULL processlist_db NULL processlist_command NULL -processlist_info INTERNAL DDL LOG RECOVER IN PROGRESS +processlist_info NULL unified_parent_thread_id NULL role NULL instrumented YES diff --git a/mysql-test/suite/perfschema/t/digest_null_literal.test b/mysql-test/suite/perfschema/t/digest_null_literal.test index a3007ced1e2..91f1eec1f95 100644 --- a/mysql-test/suite/perfschema/t/digest_null_literal.test +++ b/mysql-test/suite/perfschema/t/digest_null_literal.test @@ -7,7 +7,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test index ae58f4089ed..c1af8516b79 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test index 8c408b160a6..a5ac18a8818 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test index ccd0ae383ee..ae1de4f032e 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Hostname 'santa.claus.ipv6.example.com' does not resolve to '2001:db8::6:6'. diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test index 72d5d693a1b..361a3ce6bd1 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Hostname 'santa.claus.ipv6.example.com' does not resolve to '2001:db8::6:6'. diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test index c253e4b77d5..9dbd682681e 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '192.0.2.4' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test index 096b4b11eb4..4836dfc2d36 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test index 575dab9a337..b675b5089a8 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test index f6e5fa118df..9ce4fb926e6 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test index 0e0e900405a..9c8168e573a 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test @@ -10,7 +10,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc --source include/have_plugin_auth.inc diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test index 9d4707dc027..cd78087dad1 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test @@ -10,7 +10,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test index d4adc3e0d00..0ced79544a3 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test @@ -10,7 +10,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test index e396dbbad3c..983a6e80ff7 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '2001:db8::6:6' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test index cc7eb0b566f..3cdd87e4cf9 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '2001:db8::6:6' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test index 80f07989212..3a30030413f 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '2001:db8::6:6' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test index 0d11e433b58..054940e4a02 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '2001:db8::6:6' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test index 6dd33b9bb5b..811c5c51c26 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test @@ -7,7 +7,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test index 2b30a4eaf41..c11922624c6 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test @@ -7,7 +7,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/nesting.test b/mysql-test/suite/perfschema/t/nesting.test index 21e7260222a..29819770645 100644 --- a/mysql-test/suite/perfschema/t/nesting.test +++ b/mysql-test/suite/perfschema/t/nesting.test @@ -5,7 +5,7 @@ # On windows, the socket instrumentation collects an extra "opt" # event, which changes the test output. --source include/not_windows.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source ../include/wait_for_pfs_thread_count.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/t/rpl_gtid_func.test b/mysql-test/suite/perfschema/t/rpl_gtid_func.test index f337f95bf84..6373d4284dc 100644 --- a/mysql-test/suite/perfschema/t/rpl_gtid_func.test +++ b/mysql-test/suite/perfschema/t/rpl_gtid_func.test @@ -1,7 +1,7 @@ --source include/not_embedded.inc --source include/have_innodb.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc -- source include/master-slave.inc diff --git a/mysql-test/suite/perfschema/t/rpl_statements.test b/mysql-test/suite/perfschema/t/rpl_statements.test index 479805edccc..4f65cdcbd7b 100644 --- a/mysql-test/suite/perfschema/t/rpl_statements.test +++ b/mysql-test/suite/perfschema/t/rpl_statements.test @@ -4,7 +4,7 @@ --source include/not_embedded.inc --source include/have_innodb.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source include/have_binlog_format_mixed.inc --source include/master-slave.inc diff --git a/mysql-test/suite/perfschema/t/socket_instances_func-master.opt b/mysql-test/suite/perfschema/t/socket_instances_func-master.opt index ab6ca1731f5..b12a8b3b70e 100644 --- a/mysql-test/suite/perfschema/t/socket_instances_func-master.opt +++ b/mysql-test/suite/perfschema/t/socket_instances_func-master.opt @@ -1 +1 @@ ---skip-name-resolve +--skip-name-resolve --bind-address=* diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test b/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test index 5ba3af1e408..c6860eb3213 100644 --- a/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test +++ b/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test @@ -26,7 +26,7 @@ # happens per SQL statement within our MTR tests. And there is a significant # difference between standard statement execution and execution via # prepared statement. ---source ../include/no_protocol.inc +--source include/no_protocol.inc # Set this to enable debugging output let $my_socket_debug_dbug= 0; diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test index ef5096d85ff..d06edb0d78f 100644 --- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test +++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test @@ -36,7 +36,7 @@ # happens per SQL statement within our MTR tests. And there is a significant # difference between standard statement execution and execution via # prepared statement. ---source ../include/no_protocol.inc +--source include/no_protocol.inc #=================================== diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test index 5d4b4209b6e..cefaf1de549 100644 --- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test +++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test @@ -38,7 +38,7 @@ # happens per SQL statement within our MTR tests. And there is a significant # difference between standard statement execution and execution via # prepared statement. ---source ../include/no_protocol.inc +--source include/no_protocol.inc #=================================== diff --git a/mysql-test/suite/perfschema/t/start_server_low_digest.test b/mysql-test/suite/perfschema/t/start_server_low_digest.test index 953f4d31656..6f06def169b 100644 --- a/mysql-test/suite/perfschema/t/start_server_low_digest.test +++ b/mysql-test/suite/perfschema/t/start_server_low_digest.test @@ -4,7 +4,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc USE performance_schema; truncate table events_statements_history_long; diff --git a/mysql-test/suite/perfschema/t/statement_digest_long_query.test b/mysql-test/suite/perfschema/t/statement_digest_long_query.test index be80917c9af..7a080f7a29f 100644 --- a/mysql-test/suite/perfschema/t/statement_digest_long_query.test +++ b/mysql-test/suite/perfschema/t/statement_digest_long_query.test @@ -4,7 +4,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc USE performance_schema; truncate table events_statements_summary_by_digest; diff --git a/mysql-test/suite/perfschema/t/unary_digest.test b/mysql-test/suite/perfschema/t/unary_digest.test index c4583484f36..d8daea70d38 100644 --- a/mysql-test/suite/perfschema/t/unary_digest.test +++ b/mysql-test/suite/perfschema/t/unary_digest.test @@ -7,7 +7,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result index 09dcc06c848..bf71e518f97 100644 --- a/mysql-test/suite/plugins/r/server_audit.result +++ b/mysql-test/suite/plugins/r/server_audit.result @@ -45,6 +45,11 @@ id 2 alter table t1 rename renamed_t1; set global server_audit_events='connect,query'; +select 1, +2, +3; +1 2 3 +1 2 3 insert into t2 values (1), (2); select * from t2; id @@ -157,6 +162,8 @@ id CREATE USER u1 IDENTIFIED BY 'pwd-123'; GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +SET PASSWORD FOR u1=<secret>; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=<secret>' at line 1 CREATE USER u3 IDENTIFIED BY ''; drop user u1, u2, u3; select 2; @@ -246,6 +253,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats, TIME,HOSTNAME,root,localhost,ID,ID,RENAME,test,t1|test.renamed_t1, TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'alter table t1 rename renamed_t1',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'connect,query\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1, 2, 3',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t_doesnt_exist',ID @@ -329,6 +337,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0 diff --git a/mysql-test/suite/plugins/r/thread_pool_server_audit.result b/mysql-test/suite/plugins/r/thread_pool_server_audit.result new file mode 100644 index 00000000000..bf71e518f97 --- /dev/null +++ b/mysql-test/suite/plugins/r/thread_pool_server_audit.result @@ -0,0 +1,367 @@ +install plugin server_audit soname 'server_audit'; +show variables like 'server_audit%'; +Variable_name Value +server_audit_events +server_audit_excl_users +server_audit_file_path server_audit.log +server_audit_file_rotate_now OFF +server_audit_file_rotate_size 1000000 +server_audit_file_rotations 9 +server_audit_incl_users +server_audit_logging OFF +server_audit_mode 0 +server_audit_output_type file +server_audit_query_log_limit 1024 +server_audit_syslog_facility LOG_USER +server_audit_syslog_ident mysql-server_auditing +server_audit_syslog_info +server_audit_syslog_priority LOG_INFO +set global server_audit_file_path=null; +set global server_audit_incl_users=null; +set global server_audit_file_path='server_audit.log'; +set global server_audit_output_type=file; +set global server_audit_logging=on; +connect(localhost,no_such_user,,mysql,MASTER_PORT,MASTER_SOCKET); +ERROR 28000: Access denied for user 'no_such_user'@'localhost' (using password: NO) +set global server_audit_incl_users='odin, dva, tri'; +create table t1 (id int); +set global server_audit_incl_users='odin, root, dva, tri'; +create table t2 (id int); +set global server_audit_excl_users='odin, dva, tri'; +Warnings: +Warning 1 User 'odin' is in the server_audit_incl_users, so wasn't added. +Warning 1 User 'dva' is in the server_audit_incl_users, so wasn't added. +Warning 1 User 'tri' is in the server_audit_incl_users, so wasn't added. +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +set global server_audit_incl_users='odin, root, dva, tri'; +insert into t2 values (1), (2); +select * from t2; +id +1 +2 +alter table t1 rename renamed_t1; +set global server_audit_events='connect,query'; +select 1, +2, +3; +1 2 3 +1 2 3 +insert into t2 values (1), (2); +select * from t2; +id +1 +2 +1 +2 +select * from t_doesnt_exist; +ERROR 42S02: Table 'test.t_doesnt_exist' doesn't exist +syntax_error_query; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'syntax_error_query' at line 1 +drop table renamed_t1, t2; +show variables like 'server_audit%'; +Variable_name Value +server_audit_events CONNECT,QUERY +server_audit_excl_users +server_audit_file_path server_audit.log +server_audit_file_rotate_now OFF +server_audit_file_rotate_size 1000000 +server_audit_file_rotations 9 +server_audit_incl_users odin, root, dva, tri +server_audit_logging ON +server_audit_mode 0 +server_audit_output_type file +server_audit_query_log_limit 1024 +server_audit_syslog_facility LOG_USER +server_audit_syslog_ident mysql-server_auditing +server_audit_syslog_info +server_audit_syslog_priority LOG_INFO +set global server_audit_mode=1; +set global server_audit_events=''; +create database sa_db; +create table t1 (id2 int); +insert into t1 values (1), (2); +select * from t1; +id2 +1 +2 +drop table t1; +use sa_db; +create table sa_t1(id int); +insert into sa_t1 values (1), (2); +drop table sa_t1; +drop database sa_db; +create database sa_db; +use sa_db; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +set global server_audit_events='query_ddl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; +set global server_audit_events='query_ddl,query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +select 2; +2 +2 +drop table t1; +set global server_audit_events='query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; +set global server_audit_events='query_dcl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +SET PASSWORD FOR u1=<secret>; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=<secret>' at line 1 +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; +set global server_audit_events=''; +set global server_audit_query_log_limit= 15; +select (1), (2), (3), (4); +1 2 3 4 +1 2 3 4 +select 'A', 'B', 'C', 'D'; +A B C D +A B C D +set global server_audit_query_log_limit= 1024; +drop database sa_db; +set global server_audit_file_path='.'; +show status like 'server_audit_current_log'; +Variable_name Value +Server_audit_current_log HOME_DIR/server_audit.log +set global server_audit_file_path=''; +show status like 'server_audit_current_log'; +Variable_name Value +Server_audit_current_log server_audit.log +set global server_audit_file_path=' '; +show status like 'server_audit_current_log'; +Variable_name Value +Server_audit_current_log server_audit.log +set global server_audit_file_path='nonexisting_dir/'; +Warnings: +Warning 1 SERVER AUDIT plugin can't create file 'nonexisting_dir/'. +show status like 'server_audit_current_log'; +Variable_name Value +Server_audit_current_log server_audit.log +show variables like 'server_audit%'; +Variable_name Value +server_audit_events +server_audit_excl_users +server_audit_file_path +server_audit_file_rotate_now OFF +server_audit_file_rotate_size 1000000 +server_audit_file_rotations 9 +server_audit_incl_users odin, root, dva, tri +server_audit_logging ON +server_audit_mode 1 +server_audit_output_type file +server_audit_query_log_limit 1024 +server_audit_syslog_facility LOG_USER +server_audit_syslog_ident mysql-server_auditing +server_audit_syslog_info +server_audit_syslog_priority LOG_INFO +uninstall plugin server_audit; +Warnings: +Warning 1620 Plugin is busy and will be uninstalled on shutdown +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_logging=on',0 +TIME,HOSTNAME,root,localhost,ID,0,CONNECT,mysql,,0 +TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,mysql,,0 +TIME,HOSTNAME,no_such_user,localhost,ID,0,FAILED_CONNECT,,,ID +TIME,HOSTNAME,no_such_user,localhost,ID,0,DISCONNECT,,,0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_incl_users=\'odin, root, dva, tri\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,CREATE,test,t2, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create table t2 (id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_excl_users=\'odin, dva, tri\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'SHOW WARNINGS',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_incl_users=\'odin, root, dva, tri\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,test,t2, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t2, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0 +TIME,HOSTNAME,root,localhost,ID,ID,ALTER,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,table_stats, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,column_stats, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats, +TIME,HOSTNAME,root,localhost,ID,ID,RENAME,test,t1|test.renamed_t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'alter table t1 rename renamed_t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'connect,query\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1, 2, 3',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t_doesnt_exist',ID +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'syntax_error_query',ID +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'drop table renamed_t1, t2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show variables like \'server_audit%\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_mode=1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,0,CONNECT,test,,0 +TIME,HOSTNAME,root,localhost,ID,ID,CREATE,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create table t1 (id2 int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,table_stats, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,column_stats, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats, +TIME,HOSTNAME,root,localhost,ID,ID,DROP,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'use sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,CREATE,sa_db,sa_t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table sa_t1(id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,sa_db,sa_t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into sa_t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,table_stats, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,column_stats, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats, +TIME,HOSTNAME,root,localhost,ID,ID,DROP,sa_db,sa_t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table sa_t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,sa_db,,0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'use sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'(select 2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*! select 2*/',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global serv',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select \'A\', ',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_query_log_limit= 1024',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\' \'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\' \'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SHOW WARNINGS',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show variables like \'server_audit%\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,plugin, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'uninstall plugin server_audit',0 diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index 787861d3327..52428909c3b 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -13,6 +13,7 @@ set global server_audit_incl_users=null; set global server_audit_file_path='server_audit.log'; set global server_audit_output_type=file; set global server_audit_logging=on; +--sleep 2 connect (con1,localhost,root,,mysql); connection default; disconnect con1; @@ -35,6 +36,9 @@ insert into t2 values (1), (2); select * from t2; alter table t1 rename renamed_t1; set global server_audit_events='connect,query'; +select 1, + 2, + 3; insert into t2 values (1), (2); select * from t2; --error ER_NO_SUCH_TABLE @@ -103,6 +107,8 @@ select * from t1; CREATE USER u1 IDENTIFIED BY 'pwd-123'; GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +--error 1064 +SET PASSWORD FOR u1=<secret>; CREATE USER u3 IDENTIFIED BY ''; drop user u1, u2, u3; select 2; diff --git a/mysql-test/suite/plugins/t/thread_pool_server_audit.opt b/mysql-test/suite/plugins/t/thread_pool_server_audit.opt new file mode 100644 index 00000000000..30953d0c574 --- /dev/null +++ b/mysql-test/suite/plugins/t/thread_pool_server_audit.opt @@ -0,0 +1,2 @@ +--thread_handling=pool-of-threads + diff --git a/mysql-test/suite/plugins/t/thread_pool_server_audit.test b/mysql-test/suite/plugins/t/thread_pool_server_audit.test new file mode 100644 index 00000000000..626d4136c47 --- /dev/null +++ b/mysql-test/suite/plugins/t/thread_pool_server_audit.test @@ -0,0 +1,144 @@ +--source include/not_embedded.inc +--source include/have_pool_of_threads.inc + +if (!$SERVER_AUDIT_SO) { + skip No SERVER_AUDIT plugin; +} + +install plugin server_audit soname 'server_audit'; + +show variables like 'server_audit%'; +set global server_audit_file_path=null; +set global server_audit_incl_users=null; +set global server_audit_file_path='server_audit.log'; +set global server_audit_output_type=file; +set global server_audit_logging=on; +--sleep 2 +connect (con1,localhost,root,,mysql); +connection default; +disconnect con1; +--sleep 2 +--sleep 2 +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +--error ER_ACCESS_DENIED_ERROR +connect (con1,localhost,no_such_user,,mysql); +connection default; +--sleep 2 +set global server_audit_incl_users='odin, dva, tri'; +create table t1 (id int); +set global server_audit_incl_users='odin, root, dva, tri'; +create table t2 (id int); +set global server_audit_excl_users='odin, dva, tri'; +insert into t1 values (1), (2); +select * from t1; +set global server_audit_incl_users='odin, root, dva, tri'; +insert into t2 values (1), (2); +select * from t2; +alter table t1 rename renamed_t1; +set global server_audit_events='connect,query'; +select 1, + 2, + 3; +insert into t2 values (1), (2); +select * from t2; +--error ER_NO_SUCH_TABLE +select * from t_doesnt_exist; +--error 1064 +syntax_error_query; +drop table renamed_t1, t2; +show variables like 'server_audit%'; +set global server_audit_mode=1; +set global server_audit_events=''; +create database sa_db; +--sleep 2 +connect (con1,localhost,root,,test); +connection con1; +--sleep 2 +--sleep 2 +create table t1 (id2 int); +insert into t1 values (1), (2); +select * from t1; +drop table t1; +use sa_db; +create table sa_t1(id int); +insert into sa_t1 values (1), (2); +drop table sa_t1; +drop database sa_db; +connection default; +disconnect con1; +--sleep 2 +--sleep 2 +create database sa_db; +use sa_db; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; + +set global server_audit_events='query_ddl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; +set global server_audit_events='query_ddl,query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +select 2; +drop table t1; +set global server_audit_events='query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; +set global server_audit_events='query_dcl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +--error 1064 +SET PASSWORD FOR u1=<secret>; +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; +set global server_audit_events=''; + +set global server_audit_query_log_limit= 15; +select (1), (2), (3), (4); +select 'A', 'B', 'C', 'D'; +set global server_audit_query_log_limit= 1024; +drop database sa_db; + +set global server_audit_file_path='.'; +--replace_regex /\.[\\\/]/HOME_DIR\// +show status like 'server_audit_current_log'; +set global server_audit_file_path=''; +show status like 'server_audit_current_log'; +set global server_audit_file_path=' '; +show status like 'server_audit_current_log'; +set global server_audit_file_path='nonexisting_dir/'; +show status like 'server_audit_current_log'; +show variables like 'server_audit%'; +uninstall plugin server_audit; + +let $MYSQLD_DATADIR= `SELECT @@datadir`; +# replace the timestamp and the hostname with constant values +--replace_regex /[0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\,[^,]*\,/TIME,HOSTNAME,/ /\,[1-9][0-9]*\,/,1,/ /\,[1-9][0-9]*/,ID/ +cat_file $MYSQLD_DATADIR/server_audit.log; +remove_file $MYSQLD_DATADIR/server_audit.log; + diff --git a/mysql-test/suite/rpl/r/rpl_old_decimal.result b/mysql-test/suite/rpl/r/rpl_old_decimal.result new file mode 100644 index 00000000000..3e2fa3bf241 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_old_decimal.result @@ -0,0 +1,9 @@ +include/master-slave.inc +[connection master] +CREATE TABLE t1dec102 (a DECIMAL(10,2)); +INSERT INTO t1dec102 VALUES(999.99); +call mtr.add_suppression("Slave SQL.*Column 0 of table .* cannot be converted from type.* Error_code: 1677"); +include/wait_for_slave_sql_error_and_skip.inc [errno=1677] +Last_SQL_Error = 'Column 0 of table 'test.t1dec102' cannot be converted from type 'decimal(0,?)/*old*/' to type 'decimal(10,2)'' +DROP TABLE t1dec102; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result index 550b3f596e5..0264c9421fc 100644 --- a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result +++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result @@ -182,6 +182,11 @@ DROP USER test_3@localhost; ERROR HY000: Table 'user' was not locked with LOCK TABLES INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked"); UNLOCK TABLE; +CREATE DATABASE db; +CREATE TABLE db.t1 LIKE t2; +CREATE TABLE t3 LIKE t2; +DROP TABLE t3; +DROP DATABASE db; DROP USER test_3@localhost; DROP FUNCTION f2; DROP PROCEDURE p2; diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result index e71bb2e29c9..c2a0498509b 100644 --- a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result +++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result @@ -1,2 +1,4 @@ include/master-slave.inc [connection master] +start slave; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_old_decimal.test b/mysql-test/suite/rpl/t/rpl_old_decimal.test new file mode 100644 index 00000000000..79fd2754079 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_old_decimal.test @@ -0,0 +1,25 @@ +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + + +--connection slave +CREATE TABLE t1dec102 (a DECIMAL(10,2)); + +--connection master +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm +--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD +--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI +INSERT INTO t1dec102 VALUES(999.99); + +--let $slave_sql_errno=1677 +--let $show_slave_sql_error= 1 +call mtr.add_suppression("Slave SQL.*Column 0 of table .* cannot be converted from type.* Error_code: 1677"); +--source include/wait_for_slave_sql_error_and_skip.inc + +--connection master +DROP TABLE t1dec102; +--sync_slave_with_master + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test index e9cc098857e..bc4119f332f 100644 --- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test +++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test @@ -150,6 +150,16 @@ DROP USER test_3@localhost; INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked"); UNLOCK TABLE; + +# Bug #20439913 CREATE TABLE DB.TABLE LIKE TMPTABLE IS +# BINLOGGED INCORRECTLY - BREAKS A SLAVE +CREATE DATABASE db; +CREATE TABLE db.t1 LIKE t2; +CREATE TABLE t3 LIKE t2; +DROP TABLE t3; +DROP DATABASE db; +# end of Bug #20439913 test + DROP USER test_3@localhost; DROP FUNCTION f2; DROP PROCEDURE p2; diff --git a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test index a79a1885a6c..38759c9b16a 100644 --- a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test +++ b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test @@ -10,3 +10,10 @@ --exec $MYSQL_SLAP --silent --socket=$SLAVE_MYSOCK -q "START SLAVE; STOP SLAVE; SHOW GLOBAL STATUS" -c 2 --number-of-queries=100 --create-schema=test # All done. + +--connection slave +start slave; + +--connection master +--source include/rpl_end.inc + diff --git a/mysql-test/suite/stress/t/ddl_archive.test b/mysql-test/suite/stress/t/ddl_archive.test index 0c47b5fcdd5..c688ae192d0 100644 --- a/mysql-test/suite/stress/t/ddl_archive.test +++ b/mysql-test/suite/stress/t/ddl_archive.test @@ -12,11 +12,8 @@ --source include/have_archive.inc let $engine_type= ARCHIVE; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/stress/t/ddl_csv.test b/mysql-test/suite/stress/t/ddl_csv.test index 9f6185c76be..3e0f8acb1d8 100644 --- a/mysql-test/suite/stress/t/ddl_csv.test +++ b/mysql-test/suite/stress/t/ddl_csv.test @@ -12,11 +12,8 @@ --source include/have_csv.inc let $engine_type= CSV; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/stress/t/ddl_innodb.test b/mysql-test/suite/stress/t/ddl_innodb.test index 784ba8ff003..083ec43e7d7 100644 --- a/mysql-test/suite/stress/t/ddl_innodb.test +++ b/mysql-test/suite/stress/t/ddl_innodb.test @@ -12,11 +12,8 @@ --source include/have_innodb.inc let $engine_type= InnoDB; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/stress/t/ddl_memory.test b/mysql-test/suite/stress/t/ddl_memory.test index 5178439bff1..bcca77a74d9 100644 --- a/mysql-test/suite/stress/t/ddl_memory.test +++ b/mysql-test/suite/stress/t/ddl_memory.test @@ -11,11 +11,8 @@ # Storage engine to be used in CREATE TABLE let $engine_type= MEMORY; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/stress/t/ddl_myisam.test b/mysql-test/suite/stress/t/ddl_myisam.test index 8d6226e573b..a9b14690c42 100644 --- a/mysql-test/suite/stress/t/ddl_myisam.test +++ b/mysql-test/suite/stress/t/ddl_myisam.test @@ -11,11 +11,8 @@ # Storage engine to be used in CREATE TABLE let $engine_type= MyISAM; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff index 6124273537e..28c12e27ebd 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff @@ -42,7 +42,7 @@ VARIABLE_NAME INNODB_BUFFER_POOL_SIZE SESSION_VALUE NULL GLOBAL_VALUE 8388608 -@@ -418,7 +446,7 @@ +@@ -432,7 +460,7 @@ DEFAULT_VALUE ON VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN @@ -51,7 +51,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -439,6 +467,104 @@ +@@ -453,6 +481,104 @@ ENUM_VALUE_LIST CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -156,7 +156,7 @@ VARIABLE_NAME INNODB_CMP_PER_INDEX_ENABLED SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -537,6 +663,20 @@ +@@ -551,6 +677,20 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -177,7 +177,7 @@ VARIABLE_NAME INNODB_DATA_FILE_PATH SESSION_VALUE NULL GLOBAL_VALUE ibdata1:12M:autoextend -@@ -733,6 +873,20 @@ +@@ -747,6 +887,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT OPTIONAL @@ -198,7 +198,7 @@ VARIABLE_NAME INNODB_ENCRYPTION_ROTATE_KEY_AGE SESSION_VALUE NULL GLOBAL_VALUE 1 -@@ -803,6 +957,20 @@ +@@ -817,6 +971,20 @@ ENUM_VALUE_LIST OFF,ON,FORCE READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL @@ -219,7 +219,7 @@ VARIABLE_NAME INNODB_FAST_SHUTDOWN SESSION_VALUE NULL GLOBAL_VALUE 1 -@@ -930,11 +1098,11 @@ +@@ -944,11 +1112,11 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_FLUSH_LOG_AT_TRX_COMMIT @@ -233,7 +233,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Controls the durability/speed trade-off for commits. Set to 0 (write and flush redo log to disk only once per second), 1 (flush to disk at each commit), 2 (write to log at commit but flush to disk only once per second) or 3 (flush to disk at prepare and at commit, slower and usually redundant). 1 and 3 guarantees that after a crash, committed transactions will not be lost and will be consistent with the binlog and other transactional engines. 2 can get inconsistent and lose transactions if there is a power failure or kernel crash but not if mysqld crashes. 0 has no guarantees in case of crash. 0 and 2 can be faster than 1 or 3. NUMERIC_MIN_VALUE 0 -@@ -1027,6 +1195,20 @@ +@@ -1041,6 +1209,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED @@ -254,7 +254,7 @@ VARIABLE_NAME INNODB_FT_AUX_TABLE SESSION_VALUE NULL GLOBAL_VALUE -@@ -1265,6 +1447,20 @@ +@@ -1279,6 +1461,20 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -275,7 +275,7 @@ VARIABLE_NAME INNODB_LARGE_PREFIX SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -1293,6 +1489,20 @@ +@@ -1307,6 +1503,20 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -296,7 +296,7 @@ VARIABLE_NAME INNODB_LOCKS_UNSAFE_FOR_BINLOG SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -1321,6 +1531,62 @@ +@@ -1335,6 +1545,62 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -359,7 +359,7 @@ VARIABLE_NAME INNODB_LOG_BUFFER_SIZE SESSION_VALUE NULL GLOBAL_VALUE 1048576 -@@ -1349,6 +1615,20 @@ +@@ -1363,6 +1629,20 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL @@ -380,7 +380,7 @@ VARIABLE_NAME INNODB_LOG_COMPRESSED_PAGES SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -1419,6 +1699,34 @@ +@@ -1433,6 +1713,34 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -415,7 +415,7 @@ VARIABLE_NAME INNODB_MAX_DIRTY_PAGES_PCT SESSION_VALUE NULL GLOBAL_VALUE 75.000000 -@@ -1685,6 +1993,62 @@ +@@ -1699,6 +2007,62 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL @@ -478,7 +478,7 @@ VARIABLE_NAME INNODB_PURGE_BATCH_SIZE SESSION_VALUE NULL GLOBAL_VALUE 300 -@@ -1853,6 +2217,48 @@ +@@ -1867,6 +2231,48 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL @@ -527,7 +527,7 @@ VARIABLE_NAME INNODB_SCRUB_LOG SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -1881,6 +2287,34 @@ +@@ -1895,6 +2301,34 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL @@ -562,7 +562,7 @@ VARIABLE_NAME INNODB_SIMULATE_COMP_FAILURES SESSION_VALUE NULL GLOBAL_VALUE 0 -@@ -1944,7 +2378,7 @@ +@@ -1958,7 +2392,7 @@ DEFAULT_VALUE nulls_equal VARIABLE_SCOPE GLOBAL VARIABLE_TYPE ENUM @@ -571,7 +571,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -2175,6 +2609,34 @@ +@@ -2189,6 +2623,34 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -606,7 +606,7 @@ VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -2252,7 +2714,7 @@ +@@ -2266,7 +2728,7 @@ DEFAULT_VALUE OFF VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN @@ -615,7 +615,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -2273,6 +2735,20 @@ +@@ -2287,6 +2749,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NONE @@ -636,7 +636,7 @@ VARIABLE_NAME INNODB_USE_MTFLUSH SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -2287,6 +2763,20 @@ +@@ -2301,6 +2777,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NONE @@ -657,12 +657,12 @@ VARIABLE_NAME INNODB_USE_SYS_MALLOC SESSION_VALUE NULL GLOBAL_VALUE ON -@@ -2317,12 +2807,12 @@ +@@ -2331,12 +2821,12 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL --GLOBAL_VALUE 5.6.24 -+GLOBAL_VALUE 5.6.23-72.1 +-GLOBAL_VALUE 5.6.25 ++GLOBAL_VALUE 5.6.24-72.2 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 1c59391f3fd..18f682bb16e 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -2331,7 +2331,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL -GLOBAL_VALUE 5.6.24 +GLOBAL_VALUE 5.6.25 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test index f988292b21e..11634e1e0c7 100644 --- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test @@ -2,11 +2,6 @@ # This is a debug variable for now -- source include/have_debug.inc -if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in InnoDB 5.6.10 or earlier -} - SELECT @@global.innodb_buffer_pool_evict; SET GLOBAL innodb_buffer_pool_evict = 'uncompressed'; diff --git a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test index 782fb475140..85ae2358db5 100644 --- a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test @@ -1,8 +1,3 @@ -if (`select plugin_auth_version <= "5.5.37-MariaDB-34.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB as of 5.5.37-MariaDB-34.0 or earlier -} - # # 2010-01-27 - Added # diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 8a4ad35765c..cdc188b7776 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1326,6 +1326,14 @@ SHOW CREATE TABLE t2; DROP TABLE t2; DROP TABLE t1; +CREATE TABLE t1 ( + `transaction_id` int(11) NOT NULL DEFAULT '0', + KEY `transaction_id` (`transaction_id`)); +ALTER TABLE t1 DROP KEY IF EXISTS transaction_id, ADD PRIMARY KEY IF NOT EXISTS (transaction_id); +SHOW CREATE TABLE t1; + +DROP TABLE t1; + --echo # Bug#11748057 (formerly known as 34972): ALTER TABLE statement doesn't --echo # identify correct column name. --echo # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 8b557626ae7..e89247dc0cc 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1636,6 +1636,22 @@ SET NAMES utf8 COLLATE utf8_general_ci; --source include/ctype_utf8_ilseq.inc --echo # +--echo # MDEV-8067 correct fix for MySQL Bug # 19699237: UNINITIALIZED VARIABLE IN ITEM_FIELD::STR_RESULT +--echo # +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8); +CREATE TABLE t2 (a VARCHAR(10) CHARACTER SET latin1); +INSERT INTO t1 VALUES ('aaa'); +INSERT INTO t2 VALUES ('aaa'); +SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); +INSERT INTO t1 VALUES ('aaa'); +INSERT INTO t2 VALUES ('aaa'); +# Running the below query crashed with two rows +--error ER_SUBQUERY_NO_1_ROW +SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); +DROP TABLE t1, t2; + + +--echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test index 65a94dcb49e..86dcee8148a 100644 --- a/mysql-test/t/dyncol.test +++ b/mysql-test/t/dyncol.test @@ -657,6 +657,13 @@ SELECT select column_get(column_create(1, "18446744073709552001" as char), 1 as int); --echo # +--echo # MDEV-7505 - Too large scale in DECIMAL dynamic column getter crashes +--echo # mysqld +--echo # +--error ER_TOO_BIG_SCALE +SELECT COLUMN_GET(`x`, 'y' AS DECIMAL(5,34)); + +--echo # --echo # test of symbolic names --echo # --echo # creation test (names) diff --git a/mysql-test/t/empty_server_name-8224.test b/mysql-test/t/empty_server_name-8224.test new file mode 100644 index 00000000000..528bce5dac5 --- /dev/null +++ b/mysql-test/t/empty_server_name-8224.test @@ -0,0 +1,9 @@ +# +# MDEV-8224 Server crashes in get_server_from_table_to_cache on empty name +# +--source include/not_embedded.inc +create server '' foreign data wrapper w2 options (host '127.0.0.1'); +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server 10 +--source include/wait_until_disconnected.inc +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect diff --git a/mysql-test/t/func_regexp_pcre.test b/mysql-test/t/func_regexp_pcre.test index 6710f5cf096..c9b4c10007d 100644 --- a/mysql-test/t/func_regexp_pcre.test +++ b/mysql-test/t/func_regexp_pcre.test @@ -402,3 +402,27 @@ SET default_regex_flags=DEFAULT; --echo # MDEV-6965 non-captured group \2 in regexp_replace --echo # SELECT REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that'); + +--echo # +--echo # MDEV-8102 REGEXP function fails to match hex values when expression is stored as a variable +--echo # + +--echo # Testing a warning +SET NAMES latin1; +SET @regCheck= '\\xE0\\x01'; +SELECT 0xE001 REGEXP @regCheck; + +--echo # Testing workaround N1: This makes the pattern to be a binary string: +SET NAMES latin1; +SET @regCheck= X'E001'; +SELECT 0xE001 REGEXP @regCheck; + +--echo # Testing workaround N2: This also makes the pattern to be a binary string, using a different syntax: +SET NAMES latin1; +SET @regCheck= _binary '\\xE0\\x01'; +SELECT 0xE001 REGEXP @regCheck; + +--echo # Testing workarond N3: This makes derivation of the subject string stronger (IMLICIT instead of COERCIBLE) +SET NAMES latin1; +SET @regCheck= '\\xE0\\x01'; +SELECT CAST(0xE001 AS BINARY) REGEXP @regCheck; diff --git a/mysql-test/t/func_regexp_pcre_debug.test b/mysql-test/t/func_regexp_pcre_debug.test new file mode 100644 index 00000000000..c2581fa4110 --- /dev/null +++ b/mysql-test/t/func_regexp_pcre_debug.test @@ -0,0 +1,6 @@ +--source include/have_debug.inc + +SET debug_dbug='+d,pcre_exec_error_123'; +SELECT 'a' RLIKE 'a'; +SET debug_dbug=''; +SELECT 'a' RLIKE 'a'; diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 2b189765bbc..3fb87e91b17 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -1649,3 +1649,44 @@ INSERT INTO t1 VALUES (17, NULL); INSERT INTO t1 VALUES (18, '2010-10-13'); SELECT a.id,a.date1,FROM_DAYS(TO_DAYS(a.date1)-10) as date2, DATE_ADD(a.date1,INTERVAL -10 DAY),TO_DAYS(a.date1)-10 FROM t1 a ORDER BY a.id; DROP TABLE t1; + + +--echo # +--echo # Start of 10.0 tests +--echo # + +--echo # +--echo # MDEV-8205 timediff returns null when comparing decimal time to time string value +--echo # + +# 1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-01-01 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140101010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140101010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-01-01 01:00:00' ) AS dec_str; + +# 1D1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-01-02 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140102010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140102010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-01-02 01:00:00' ) AS dec_str; + +# 1M1D1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-02-02 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140202010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140202010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-02-02 01:00:00' ) AS dec_str; + +# 2M1D1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-03-02 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140302010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140302010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-03-02 01:00:00' ) AS dec_str; + +--echo # +--echo # End of 10.0 tests +--echo # diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index dfb7f28ab28..4b992faa306 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1522,7 +1522,7 @@ DROP TABLE t1; create table t1 (a int, b int); insert into t1 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); create table t2 (c int, d int); -insert into t2 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); +insert into t2 values (1,11), (2,22), (4,44); select distinct a,sum(b), (select d from t2 where c=a order by max(b) limit 1) from t1 group by a order by max(b); drop table t1, t2; diff --git a/mysql-test/t/information_schema2.test b/mysql-test/t/information_schema2.test index c2479087f47..d577cdc1e4d 100644 --- a/mysql-test/t/information_schema2.test +++ b/mysql-test/t/information_schema2.test @@ -7,3 +7,16 @@ select variable_name from information_schema.session_status where variable_name select variable_name from information_schema.session_variables where variable_name = (select variable_name from information_schema.session_variables where variable_name = 'basedir'); +# +# information_schema tables inside subqueries, they should not be re-populated +# (i_s.columns needs to scan i_s itself, creating a tmp table for every i_s +# table. if it's re-populated, it'll do that multiple times) +# +create table t1 (a char); +insert t1 values ('a'),('t'),('z'); +flush status; +select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1; +# fix the result in ps-protocol +--replace_result 44 43 +show status like 'created_tmp_tables'; +drop table t1; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 6c9371eed25..9ac49a9063d 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1751,6 +1751,16 @@ CHECK TABLE t1; DROP TABLE t1; +--echo # +--echo # MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with +--echo # disabled keys +--echo # +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (4),(3),(1),(0); +ALTER TABLE t1 DISABLE KEYS; +OPTIMIZE TABLE t1; +DROP TABLE t1; + # # Check some variables # diff --git a/mysql-test/t/mysql_tzinfo_to_sql_symlink.test b/mysql-test/t/mysql_tzinfo_to_sql_symlink.test index 1ba4e91be3c..8ca82b87e30 100644 --- a/mysql-test/t/mysql_tzinfo_to_sql_symlink.test +++ b/mysql-test/t/mysql_tzinfo_to_sql_symlink.test @@ -37,3 +37,14 @@ # --exec rm -rf $MYSQLTEST_VARDIR/zoneinfo + +--echo # +--echo # MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL +--echo # +--exec mkdir $MYSQLTEST_VARDIR/zoneinfo +--copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/Factory + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1 + +--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo diff --git a/mysql-test/t/mysql_upgrade_view.test b/mysql-test/t/mysql_upgrade_view.test index e222afa89fe..49a90264f11 100644 --- a/mysql-test/t/mysql_upgrade_view.test +++ b/mysql-test/t/mysql_upgrade_view.test @@ -8,6 +8,35 @@ drop view if exists t1,v1,v2,v3,v4,v1badcheck; create table t1(a int); create table kv(k varchar(30) NOT NULL PRIMARY KEY,v varchar(50)); +create view v1 as select 1; + +repair table t1 quick; +repair table t1 extended; +repair table t1 use_frm; +--error ER_PARSE_ERROR +repair table t1 from mysql; + +--error ER_PARSE_ERROR +repair view v1 quick; +--error ER_PARSE_ERROR +repair view v1 extended; +--error ER_PARSE_ERROR +repair view v1 use_frm; +repair view v1 from mysql; + +--error ER_PARSE_ERROR +check view v1 quick; +--error ER_PARSE_ERROR +check view v1 fast; +--error ER_PARSE_ERROR +check view v1 medium; +--error ER_PARSE_ERROR +check view v1 extended; +--error ER_PARSE_ERROR +check view v1 changed; +check view v1 for upgrade; + +drop view v1; let $MYSQLD_DATADIR= `select @@datadir`; diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index e2733089f18..6cd0265f89a 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -8,6 +8,7 @@ call mtr.add_suppression("Invalid .old.. table or database name"); # check that CSV engine was compiled in, as the result of the test # depends on the presence of the log tables (which are CSV-based). --source include/have_csv.inc +let $MYSQLD_DATADIR= `select @@datadir`; # # Clean up after previous tests @@ -66,7 +67,6 @@ create table t_bug25347 (a int) engine=myisam; create view v_bug25347 as select * from t_bug25347; insert into t_bug25347 values (1),(2),(3); flush tables; -let $MYSQLD_DATADIR= `select @@datadir`; --echo removing and creating --remove_file $MYSQLD_DATADIR/d_bug25347/t_bug25347.MYI --write_file $MYSQLD_DATADIR/d_bug25347/t_bug25347.MYI @@ -119,7 +119,6 @@ DROP TABLE t1, t2; create table t1(a int) engine=myisam; create view v1 as select * from t1; show tables; -let $MYSQLD_DATADIR= `select @@datadir`; --copy_file $MYSQLD_DATADIR/test/v1.frm $MYSQLD_DATADIR/test/v-1.frm show tables; --exec $MYSQL_CHECK --check-upgrade --databases test @@ -164,24 +163,23 @@ CREATE TABLE `#mysql50#c@d` (a INT) engine=myisam; CREATE TABLE t1 (a INT) engine=myisam; # Create 5.0 like triggers -let $MYSQLTEST_VARDIR= `select @@datadir`; ---write_file $MYSQLTEST_VARDIR/a@b/c@d.TRG +--write_file $MYSQLD_DATADIR/a@b/c@d.TRG TYPE=TRIGGERS triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON `c@d` FOR EACH ROW SET NEW.a = 10 * NEW.a' sql_modes=0 definers='root@localhost' EOF ---write_file $MYSQLTEST_VARDIR/a@b/tr1.TRN +--write_file $MYSQLD_DATADIR/a@b/tr1.TRN TYPE=TRIGGERNAME trigger_table=c@d EOF ---write_file $MYSQLTEST_VARDIR/a@b/t1.TRG +--write_file $MYSQLD_DATADIR/a@b/t1.TRG TYPE=TRIGGERS triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr2 BEFORE INSERT ON `a@b`.t1 FOR EACH ROW SET NEW.a = 100 * NEW.a' sql_modes=0 definers='root@localhost' EOF ---write_file $MYSQLTEST_VARDIR/a@b/tr2.TRN +--write_file $MYSQLD_DATADIR/a@b/tr2.TRN TYPE=TRIGGERNAME trigger_table=t1 EOF @@ -255,7 +253,6 @@ INSERT INTO bug47205 VALUES ("foobar"); FLUSH TABLE bug47205; --echo # Replace the FRM with a 5.0 FRM that will require upgrade -let $MYSQLD_DATADIR= `select @@datadir`; --remove_file $MYSQLD_DATADIR/test/bug47205.frm --copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm @@ -279,7 +276,6 @@ CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) FLUSH TABLE bug47205; --echo # Replace the FRM with a 5.0 FRM that will require upgrade -let $MYSQLD_DATADIR= `select @@datadir`; --remove_file $MYSQLD_DATADIR/test/bug47205.frm --copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm @@ -322,3 +318,34 @@ CREATE TABLE test.`t.1` (id int); --exec $MYSQL_CHECK test t.1 drop table test.`t.1`; + +# +# MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such +# +create view v1 as select 1; +--echo mysqlcheck --process-views test +--exec $MYSQL_CHECK --process-views test +--echo mysqlcheck --process-views --extended test +--exec $MYSQL_CHECK --process-views --extended test +--echo mysqlcheck --process-views --fast test +--exec $MYSQL_CHECK --process-views --fast test +--echo mysqlcheck --process-views --quick test +--exec $MYSQL_CHECK --process-views --quick test +--echo mysqlcheck --process-views --check-only-changed test +--exec $MYSQL_CHECK --process-views --check-only-changed test +--echo mysqlcheck --process-views --medium-check test +--exec $MYSQL_CHECK --process-views --medium-check test +--echo mysqlcheck --process-views --check-upgrade test +--exec $MYSQL_CHECK --process-views --check-upgrade test +drop view v1; + + +# +# MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views +# +create table t1(a int); +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm +--echo mysqlcheck --process-views --check-upgrade --auto-repair test +--exec $MYSQL_CHECK --process-views --check-upgrade --auto-repair test +drop view v1; +drop table t1; diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index a74e95ab65b..2d90764da0d 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -1,3 +1,7 @@ +if (`select plugin_auth_version < "5.6.25" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in InnoDB as of 5.6.24 or earlier +} --source include/not_embedded.inc --source include/have_partition.inc --source include/have_innodb.inc @@ -403,7 +407,7 @@ DROP TABLE t1; create table t1 (a int) engine=innodb partition by hash(a) ; # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status like 't1'; drop table t1; @@ -415,12 +419,12 @@ engine = innodb partition by key (a); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; insert into t1 values (0), (1), (2), (3); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; drop table t1; @@ -429,17 +433,17 @@ engine = innodb partition by key (a); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; insert into t1 values (NULL), (NULL), (NULL), (NULL); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; insert into t1 values (NULL), (NULL), (NULL), (NULL); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; drop table t1; @@ -675,6 +679,18 @@ ALTER TABLE t1 ADD UNIQUE KEY (b); SHOW CREATE TABLE t1; SELECT * FROM t1; DROP TABLE t1; +--echo # +--echo # Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE +--echo # WRONG FOR PARTITIONED TABLES +--echo # + +CREATE TABLE t1 (a int, PRIMARY KEY (a)) ENGINE=InnoDB +PARTITION BY HASH (a) PARTITIONS 2; + +SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE +CREATE_TIME IS NOT NULL AND TABLE_NAME='t1'; + +DROP TABLE t1; --echo # --echo # BUG#12912171 - ASSERTION FAILED: QUICK->HEAD->READ_SET == diff --git a/mysql-test/t/partition_myisam.test b/mysql-test/t/partition_myisam.test index a33b9e19fbf..bce0c6f009c 100644 --- a/mysql-test/t/partition_myisam.test +++ b/mysql-test/t/partition_myisam.test @@ -123,7 +123,7 @@ CHECK TABLE t1; SELECT * FROM t1; --echo # Note that it is currently impossible to drop a partitioned table --echo # without the .par file ---error ER_BAD_TABLE_ERROR +--error ER_GET_ERRNO DROP TABLE t1; --remove_file $MYSQLD_DATADIR/test/t1.frm --remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI diff --git a/mysql-test/t/partition_not_blackhole.test b/mysql-test/t/partition_not_blackhole.test index 103c441dac4..64d4f3877c8 100644 --- a/mysql-test/t/partition_not_blackhole.test +++ b/mysql-test/t/partition_not_blackhole.test @@ -19,7 +19,7 @@ SHOW TABLES; --replace_result $MYSQLD_DATADIR ./ --error ER_FAILED_READ_FROM_PAR_FILE SHOW CREATE TABLE t1; ---error ER_BAD_TABLE_ERROR +--error ER_GET_ERRNO DROP TABLE t1; --list_files $MYSQLD_DATADIR/test t1* --remove_file $MYSQLD_DATADIR/test/t1.frm diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test index 0655aff9fc9..13e2c71fbc4 100644 --- a/mysql-test/t/plugin.test +++ b/mysql-test/t/plugin.test @@ -252,3 +252,16 @@ select plugin_name from information_schema.plugins where plugin_library like 'ha uninstall soname 'ha_example'; select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; + +--echo # +--echo # MDEV-5309 - RENAME TABLE does not check for existence of the table's +--echo # engine +--echo # +INSTALL PLUGIN example SONAME 'ha_example'; +CREATE TABLE t1(a INT) ENGINE=EXAMPLE; +SELECT * FROM t1; +FLUSH TABLES; +UNINSTALL PLUGIN example; +--error ER_NO_SUCH_TABLE +RENAME TABLE t1 TO t2; +DROP TABLE t1; diff --git a/mysql-test/t/query_cache_ps_no_prot.test b/mysql-test/t/query_cache_ps_no_prot.test index 16533c7194e..4b2bb842e34 100644 --- a/mysql-test/t/query_cache_ps_no_prot.test +++ b/mysql-test/t/query_cache_ps_no_prot.test @@ -16,12 +16,7 @@ let collation=utf8_unicode_ci; --source include/have_collation.inc # The file with expected results fits only to a run without -# ps-protocol/sp-protocol/cursor-protocol/view-protocol. -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL - + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} +--source include/no_protocol.inc # The main testing script --source include/query_cache_sql_prepare.inc diff --git a/mysql-test/t/range_innodb.test b/mysql-test/t/range_innodb.test new file mode 100644 index 00000000000..f76794814ef --- /dev/null +++ b/mysql-test/t/range_innodb.test @@ -0,0 +1,47 @@ +--echo # +--echo # Range optimizer (and related) tests that need InnoDB. +--echo # + +--source include/have_innodb.inc + +--disable_warnings +drop table if exists t0, t1, t2; +--enable_warnings + +--echo # +--echo # MDEV-6735: Range checked for each record used with key +--echo # + +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t1(a int); +insert into t1 select A.a + B.a* 10 + C.a * 100 + D.a * 1000 +from t0 A, t0 B, t0 C, t0 D; + +create table t2 ( + a int, + b int, + filler1 char(100), + filler2 char(100), + filler3 char(100), + filler4 char(100), + key(a), + key(b) +) engine=innodb; + +insert into t2 +select + a,a, + repeat('0123456789', 10), + repeat('0123456789', 10), + repeat('0123456789', 10), + repeat('0123456789', 10) +from t1; + +analyze table t2; +--echo # The following must not use "Range checked for each record": +explain select * from t0 left join t2 on t2.a <t0.a and t2.b between 50 and 250; + +drop table t0,t1,t2; + diff --git a/mysql-test/t/ssl_7937.combinations b/mysql-test/t/ssl_7937.combinations new file mode 100644 index 00000000000..46a45686a9b --- /dev/null +++ b/mysql-test/t/ssl_7937.combinations @@ -0,0 +1,5 @@ +[ssl] +--loose-enable-ssl + +[nossl] +--loose-disable-ssl diff --git a/mysql-test/t/ssl_7937.test b/mysql-test/t/ssl_7937.test new file mode 100644 index 00000000000..d593b9d936d --- /dev/null +++ b/mysql-test/t/ssl_7937.test @@ -0,0 +1,35 @@ +# +# MDEV-7937: Enforce SSL when --ssl client option is used +# + +source include/have_ssl_crypto_functs.inc; + +# create a procedure instead of SHOW STATUS LIKE 'ssl_cipher' +# because the cipher depends on openssl (or yassl) version, +# and it's actual value doesn't matter here anyway +create procedure have_ssl() + select if(variable_value > '','yes','no') as 'have_ssl' + from information_schema.session_status + where variable_name='ssl_cipher'; + +--disable_abort_on_error +--echo mysql --ssl-ca=cacert.pem -e "call test.have_ssl()" +--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem -e "call test.have_ssl()" 2>&1 +--echo mysql --ssl -e "call test.have_ssl()" +--exec $MYSQL --ssl -e "call test.have_ssl()" 2>&1 +--echo mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" +--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1 + +--echo mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()" +# this is the test where certificate verification fails. +# but yassl doesn't support certificate verification, so +# we fake the test result for yassl +let yassl=`select variable_value='Unknown' from information_schema.session_status where variable_name='Ssl_session_cache_mode'`; +if (!$yassl) { + --exec $MYSQL --ssl --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1 +} +if ($yassl) { + --echo ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate +} + +drop procedure have_ssl; diff --git a/mysql-test/t/truncate-stale-6500.test b/mysql-test/t/truncate-stale-6500.test new file mode 100644 index 00000000000..47dffb1966d --- /dev/null +++ b/mysql-test/t/truncate-stale-6500.test @@ -0,0 +1,32 @@ +--source include/have_innodb.inc +--source include/have_partition.inc + +SET GLOBAL query_cache_size=1024*1024*8; +CREATE TABLE `test` ( + `uniqueId` INT NOT NULL, + `partitionId` INT NOT NULL, + PRIMARY KEY (`uniqueId`,`partitionId`) +) ENGINE=InnoDB PARTITION BY LIST (partitionId) ( + PARTITION p01 VALUES IN (1), + PARTITION p02 VALUES IN (2) +); + + +INSERT INTO `test`(`uniqueId`,`partitionId`) VALUES(407237055, 2); + +SELECT * FROM `test`; + +--echo #Confirms 1 row in partition 'p02' +SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test'; +ALTER TABLE `test` TRUNCATE PARTITION `p02`; + +--echo #Confirms no more rows in partition 'p02' +SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test'; + +--echo #Before the patch, this returned the previously existing values. +SELECT * FROM `test`; +SELECT SQL_CACHE * FROM `test`; +SELECT SQL_NO_CACHE * FROM `test`; + +DROP TABLE test; +SET GLOBAL query_cache_size=DEFAULT; diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 1d4ef345747..659e75270ca 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -583,3 +583,27 @@ JOIN WHERE CONCAT(t1.col1, CAST(subq.col0 AS DECIMAL)); DROP TABLE t1, t2; + + +--echo # +--echo # Start of 5.5 tests +--echo # + +--echo # +--echo # MDEV-8267 Add /*old*/ comment into I_S.COLUMN_TYPE for old DECIMAL +--echo # + +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm +--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD +--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI + +SHOW CREATE TABLE t1dec102; +SHOW COLUMNS FROM t1dec102; +SELECT COLUMN_NAME, DATA_TYPE, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1dec102'; +DROP TABLE t1dec102; + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/update_innodb.test b/mysql-test/t/update_innodb.test new file mode 100644 index 00000000000..67c356c4e2e --- /dev/null +++ b/mysql-test/t/update_innodb.test @@ -0,0 +1,39 @@ +--source include/have_innodb.inc + +CREATE TABLE `t1` ( + `c1` int(11) NOT NULL, + `c2` datetime DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `t2` ( + `c0` varchar(10) NOT NULL, + `c1` int(11) NOT NULL, + `c2` int(11) NOT NULL, + PRIMARY KEY (`c0`,`c1`), + KEY `c1` (`c1`), + KEY `c2` (`c2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `t3` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `c1` datetime NOT NULL, + `c2` bigint(20) NOT NULL, + `c3` int(4) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `c2` (`c2`), + KEY `c3` (`c3`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `t4` ( + `c1` int(11) NOT NULL, + `c2` bigint(20) DEFAULT NULL, + `c3` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select `t4`.`c1` AS `c1`,`t4`.`c2` AS `c2`,`t4`.`c3` AS `c3` from `t4`; + +UPDATE t1 a JOIN t2 b ON a.c1 = b.c1 JOIN v1 vw ON b.c2 = vw.c1 JOIN t3 del ON vw.c2 = del.c2 SET a.c2 = ( SELECT max(t.c1) FROM t3 t, v1 i WHERE del.c2 = t.c2 AND vw.c3 = i.c3 AND t.c3 = 4 ) WHERE a.c2 IS NULL OR a.c2 < '2011-05-01'; + +drop view v1; +drop table t1,t2,t3,t4; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 84d7da548b2..e95194e3f2c 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -5367,6 +5367,19 @@ update t3 left join v2 using (id) set flag=flag+1; drop view v2, v1; drop table t1, t2, t3; +--echo # +--echo # MDEV-7207 - ALTER VIEW does not change ALGORITM +--echo # +create table t1 (a int, b int); +create algorithm=temptable view v2 (c) as select b+1 from t1; +show create view v2; +alter algorithm=undefined view v2 (c) as select b+1 from t1; +show create view v2; +alter algorithm=merge view v2 (c) as select b+1 from t1; +show create view v2; +drop view v2; +drop table t1; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.5 tests. --echo # ----------------------------------------------------------------- |