diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-11-21 10:25:38 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-11-21 10:25:38 +0200 |
commit | b35a048ece4f5dd7c6757d86a303f27187a16117 (patch) | |
tree | 707189e5b00169b61b9ec13608625b938bd4f35b /mysql-test/suite | |
parent | 91a7e9eb1ef9bfba6a1da5bca4a9b8c58a94c245 (diff) | |
parent | 5b1eb87b6fc9cd09d5a0ffcd926203700e035689 (diff) | |
download | mariadb-git-b35a048ece4f5dd7c6757d86a303f27187a16117.tar.gz |
Merge 10.8 into 10.9
Diffstat (limited to 'mysql-test/suite')
26 files changed, 376 insertions, 23 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_empty_xa_prepared.result b/mysql-test/suite/binlog/r/binlog_empty_xa_prepared.result index 589570d8300..b11484367b8 100644 --- a/mysql-test/suite/binlog/r/binlog_empty_xa_prepared.result +++ b/mysql-test/suite/binlog/r/binlog_empty_xa_prepared.result @@ -1,3 +1,4 @@ +RESET MASTER; CREATE TEMPORARY SEQUENCE seq_1; XA START '3'; CREATE TEMPORARY TABLE tmp_1(c INT); diff --git a/mysql-test/suite/binlog/r/binlog_table_map_optional_metadata_binary.result b/mysql-test/suite/binlog/r/binlog_table_map_optional_metadata_binary.result index 789bc6cd178..7514380b715 100644 --- a/mysql-test/suite/binlog/r/binlog_table_map_optional_metadata_binary.result +++ b/mysql-test/suite/binlog/r/binlog_table_map_optional_metadata_binary.result @@ -1,3 +1,4 @@ +RESET MASTER; # # Verify that SET string values and character sets can be printed correctly # diff --git a/mysql-test/suite/binlog/r/binlog_table_map_optional_metadata_ucs2.result b/mysql-test/suite/binlog/r/binlog_table_map_optional_metadata_ucs2.result index 1b1d2a79725..a889a2fa82e 100644 --- a/mysql-test/suite/binlog/r/binlog_table_map_optional_metadata_ucs2.result +++ b/mysql-test/suite/binlog/r/binlog_table_map_optional_metadata_ucs2.result @@ -1,3 +1,4 @@ +RESET MASTER; # # Verify that SET string values and character sets can be printed correctly # diff --git a/mysql-test/suite/binlog/r/binlog_table_map_optional_metadata_utf32.result b/mysql-test/suite/binlog/r/binlog_table_map_optional_metadata_utf32.result index 6fdda842bac..e44d0a275d7 100644 --- a/mysql-test/suite/binlog/r/binlog_table_map_optional_metadata_utf32.result +++ b/mysql-test/suite/binlog/r/binlog_table_map_optional_metadata_utf32.result @@ -1,3 +1,4 @@ +RESET MASTER; # # Verify that SET string values and character sets can be printed correctly # diff --git a/mysql-test/suite/binlog/t/binlog_empty_xa_prepared.test b/mysql-test/suite/binlog/t/binlog_empty_xa_prepared.test index 2890c42a087..b127178ebf7 100644 --- a/mysql-test/suite/binlog/t/binlog_empty_xa_prepared.test +++ b/mysql-test/suite/binlog/t/binlog_empty_xa_prepared.test @@ -4,7 +4,7 @@ --source include/have_binlog_format_mixed.inc --source include/have_innodb.inc - +RESET MASTER; # clear binlogs # MDEV-22420 DDL on temporary object is prohibited when XA is in prepare state # Temporary sequnce may not be created within a transaction diff --git a/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_binary.test b/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_binary.test index 5997cfd5d27..29e10ede98a 100644 --- a/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_binary.test +++ b/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_binary.test @@ -20,6 +20,7 @@ --let $MYSQLD_DATADIR= `select @@datadir` --let $binlog_file= $MYSQLD_DATADIR/master-bin.000001 +RESET MASTER; --echo # --echo # Verify that SET string values and character sets can be printed correctly --echo # diff --git a/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_ucs2.test b/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_ucs2.test index 1e218acdfea..8c9e22421b6 100644 --- a/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_ucs2.test +++ b/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_ucs2.test @@ -21,6 +21,7 @@ --let $MYSQLD_DATADIR= `select @@datadir` --let $binlog_file= $MYSQLD_DATADIR/master-bin.000001 +RESET MASTER; --echo # --echo # Verify that SET string values and character sets can be printed correctly --echo # diff --git a/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_utf32.test b/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_utf32.test index c1d449abf2f..094de058028 100644 --- a/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_utf32.test +++ b/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata_utf32.test @@ -21,6 +21,7 @@ --let $MYSQLD_DATADIR= `select @@datadir` --let $binlog_file= $MYSQLD_DATADIR/master-bin.000001 +RESET MASTER; --echo # --echo # Verify that SET string values and character sets can be printed correctly --echo # diff --git a/mysql-test/suite/compat/oracle/r/sp-package.result b/mysql-test/suite/compat/oracle/r/sp-package.result index daa244a3c5a..ef0acea5da1 100644 --- a/mysql-test/suite/compat/oracle/r/sp-package.result +++ b/mysql-test/suite/compat/oracle/r/sp-package.result @@ -3268,3 +3268,78 @@ a This is db1.pkg1.p1 DROP DATABASE db1; DROP DATABASE db2; +# +# MDEV-29370 Functions in packages are slow and seems to ignore deterministic +# +SET SQL_MODE=ORACLE; +CREATE TABLE t1 (c1 CHAR(1)); +CREATE FUNCTION f1_deterministic() +RETURN CHAR(1) +DETERMINISTIC +IS +BEGIN +RETURN 'X'; +END; +// +CREATE FUNCTION f2_not_deterministic() +RETURN CHAR(1) +IS +BEGIN +RETURN 'X'; +END; +// +CREATE PACKAGE pkg1 +IS +PROCEDURE t1_populate(numrows INTEGER); +FUNCTION f3_deterministic() RETURN CHAR(1) DETERMINISTIC; +FUNCTION f4_not_deterministic() RETURN CHAR(1); +END; +// +CREATE PACKAGE BODY pkg1 +IS +PROCEDURE t1_populate(numrounds INTEGER) +IS +i INTEGER; +BEGIN +INSERT INTO t1 VALUES('Y'); +FOR i IN 1..numrounds LOOP +INSERT INTO t1 SELECT * FROM t1; +END LOOP; +END; +FUNCTION f3_deterministic() RETURN CHAR(1) DETERMINISTIC COMMENT 'xxx' + IS +BEGIN +RETURN 'X'; +END; +FUNCTION f4_not_deterministic() RETURN CHAR(1) +IS +BEGIN +RETURN 'X'; +END; +END; +// +CALL pkg1.t1_populate(3); +EXPLAIN EXTENDED SELECT 'Deterministic function', COUNT(*) FROM t1 WHERE c1 = f1_deterministic(); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where +Warnings: +Note 1003 select 'Deterministic function' AS "Deterministic function",count(0) AS "COUNT(*)" from "test"."t1" where "test"."t1"."c1" = <cache>("f1_deterministic"()) +EXPLAIN EXTENDED SELECT 'Non-deterministic function', COUNT(*) FROM t1 WHERE c1 = f2_not_deterministic(); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where +Warnings: +Note 1003 select 'Non-deterministic function' AS "Non-deterministic function",count(0) AS "COUNT(*)" from "test"."t1" where "test"."t1"."c1" = "f2_not_deterministic"() +EXPLAIN EXTENDED SELECT 'Deterministic package function', COUNT(*) FROM t1 WHERE c1 = pkg1.f3_deterministic(); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where +Warnings: +Note 1003 select 'Deterministic package function' AS "Deterministic package function",count(0) AS "COUNT(*)" from "test"."t1" where "test"."t1"."c1" = <cache>("test"."pkg1"."f3_deterministic"()) +EXPLAIN EXTENDED SELECT 'Non-deterministic package function', COUNT(*) FROM t1 WHERE c1 = pkg1.f4_not_deterministic(); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where +Warnings: +Note 1003 select 'Non-deterministic package function' AS "Non-deterministic package function",count(0) AS "COUNT(*)" from "test"."t1" where "test"."t1"."c1" = "test"."pkg1"."f4_not_deterministic"() +DROP TABLE t1; +DROP FUNCTION f1_deterministic; +DROP FUNCTION f2_not_deterministic; +DROP PACKAGE pkg1; diff --git a/mysql-test/suite/compat/oracle/t/sp-package.test b/mysql-test/suite/compat/oracle/t/sp-package.test index 615ce51e195..0092c869d50 100644 --- a/mysql-test/suite/compat/oracle/t/sp-package.test +++ b/mysql-test/suite/compat/oracle/t/sp-package.test @@ -3016,3 +3016,75 @@ CALL db2.pkg1.p2_db1_pkg1_p1; DROP DATABASE db1; DROP DATABASE db2; + + +--echo # +--echo # MDEV-29370 Functions in packages are slow and seems to ignore deterministic +--echo # + +SET SQL_MODE=ORACLE; + +CREATE TABLE t1 (c1 CHAR(1)); + +DELIMITER //; +CREATE FUNCTION f1_deterministic() +RETURN CHAR(1) +DETERMINISTIC +IS +BEGIN + RETURN 'X'; +END; +// + +CREATE FUNCTION f2_not_deterministic() +RETURN CHAR(1) +IS +BEGIN + RETURN 'X'; +END; +// + +CREATE PACKAGE pkg1 +IS + PROCEDURE t1_populate(numrows INTEGER); + FUNCTION f3_deterministic() RETURN CHAR(1) DETERMINISTIC; + FUNCTION f4_not_deterministic() RETURN CHAR(1); +END; +// + +CREATE PACKAGE BODY pkg1 +IS + PROCEDURE t1_populate(numrounds INTEGER) + IS + i INTEGER; + BEGIN + INSERT INTO t1 VALUES('Y'); + FOR i IN 1..numrounds LOOP + INSERT INTO t1 SELECT * FROM t1; + END LOOP; + END; + FUNCTION f3_deterministic() RETURN CHAR(1) DETERMINISTIC COMMENT 'xxx' + IS + BEGIN + RETURN 'X'; + END; + FUNCTION f4_not_deterministic() RETURN CHAR(1) + IS + BEGIN + RETURN 'X'; + END; +END; +// +DELIMITER ;// + +CALL pkg1.t1_populate(3); + +EXPLAIN EXTENDED SELECT 'Deterministic function', COUNT(*) FROM t1 WHERE c1 = f1_deterministic(); +EXPLAIN EXTENDED SELECT 'Non-deterministic function', COUNT(*) FROM t1 WHERE c1 = f2_not_deterministic(); +EXPLAIN EXTENDED SELECT 'Deterministic package function', COUNT(*) FROM t1 WHERE c1 = pkg1.f3_deterministic(); +EXPLAIN EXTENDED SELECT 'Non-deterministic package function', COUNT(*) FROM t1 WHERE c1 = pkg1.f4_not_deterministic(); + +DROP TABLE t1; +DROP FUNCTION f1_deterministic; +DROP FUNCTION f2_not_deterministic; +DROP PACKAGE pkg1; diff --git a/mysql-test/suite/encryption/t/innochecksum.test b/mysql-test/suite/encryption/t/innochecksum.test index 59d90fbb3d7..516bc0733d9 100644 --- a/mysql-test/suite/encryption/t/innochecksum.test +++ b/mysql-test/suite/encryption/t/innochecksum.test @@ -9,6 +9,7 @@ -- source include/have_file_key_management_plugin.inc -- source include/innodb_page_size_small.inc -- source include/innodb_checksum_algorithm.inc +-- source include/maybe_debug.inc if (!$INNOCHECKSUM) { --echo Need innochecksum binary @@ -18,6 +19,10 @@ if (!$INNOCHECKSUM) { --disable_query_log # This may be triggered on a slow system or one that lacks native AIO. call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operations"); +if ($have_debug) { +SET GLOBAL DEBUG_DBUG='+d,ib_log_checkpoint_avoid_hard'; +call mtr.add_suppression("InnoDB: Crash recovery is broken due to insufficient innodb_log_file_size"); +} --enable_query_log let $checksum_algorithm = `SELECT @@innodb_checksum_algorithm`; @@ -259,6 +264,15 @@ print FILE pack("H*", "c00lcafedeadb017"); close FILE or die "close"; EOF +if (0 && $have_debug) { # these messages sometimes fail to appear +--let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err +--let SEARCH_PATTERN= InnoDB: Crash recovery is broken due to insufficient innodb_log_file_size; last checkpoint LSN=\\d+, current LSN=\\d+\\. Shutdown is in progress\\..*InnoDB: Crash recovery was broken.* +--echo # FOUND 1 is expected for both. +--source include/search_pattern_in_file.inc +--let SEARCH_PATTERN= InnoDB: Crash recovery was broken +--source include/search_pattern_in_file.inc +} + -- disable_result_log --error 1 --exec $INNOCHECKSUM $t1_IBD diff --git a/mysql-test/suite/innodb/r/insert_into_empty,32k.rdiff b/mysql-test/suite/innodb/r/insert_into_empty,32k.rdiff new file mode 100644 index 00000000000..9d40decbb30 --- /dev/null +++ b/mysql-test/suite/innodb/r/insert_into_empty,32k.rdiff @@ -0,0 +1,9 @@ +@@ -377,8 +377,6 @@ + c09 text, c10 text, c11 text, c12 text) ENGINE=InnoDB; + SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= COMPACT; + ALTER TABLE t1 FORCE; +-Warnings: +-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. + INSERT IGNORE INTO t1 VALUES + (1, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107)), + (2, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107)); diff --git a/mysql-test/suite/innodb/r/insert_into_empty,64k.rdiff b/mysql-test/suite/innodb/r/insert_into_empty,64k.rdiff new file mode 100644 index 00000000000..9d40decbb30 --- /dev/null +++ b/mysql-test/suite/innodb/r/insert_into_empty,64k.rdiff @@ -0,0 +1,9 @@ +@@ -377,8 +377,6 @@ + c09 text, c10 text, c11 text, c12 text) ENGINE=InnoDB; + SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= COMPACT; + ALTER TABLE t1 FORCE; +-Warnings: +-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. + INSERT IGNORE INTO t1 VALUES + (1, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107)), + (2, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107)); diff --git a/mysql-test/suite/innodb/r/insert_into_empty.result b/mysql-test/suite/innodb/r/insert_into_empty.result index 3267eefdc28..dd4451deaa2 100644 --- a/mysql-test/suite/innodb/r/insert_into_empty.result +++ b/mysql-test/suite/innodb/r/insert_into_empty.result @@ -186,12 +186,31 @@ DROP TABLE t; # MDEV-28327 InnoDB persistent statistics fail to update # after bulk insert # -CREATE TABLE t1 (a INT PRIMARY KEY)ENGINE=InnoDB; +CREATE TABLE t1 (a INT PRIMARY KEY)ENGINE=InnoDB +STATS_PERSISTENT=1 STATS_AUTO_RECALC=1; INSERT INTO t1 SELECT * FROM seq_1_to_4096; # Wait till statistics update after bulk insert operation -SELECT n_rows FROM mysql.innodb_table_stats WHERE TABLE_NAME="t1"; -n_rows -4096 +SELECT n_rows>=4000 FROM mysql.innodb_table_stats WHERE TABLE_NAME="t1"; +n_rows>=4000 +1 +DROP TABLE t1; +# +# MDEV-27214 Import with disabled keys corrupts meta-data like rows, indexes, ... +# +SET UNIQUE_CHECKS=0; +SET FOREIGN_KEY_CHECKS=0; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL, +`a` int(11) DEFAULT NULL, +PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +STATS_PERSISTENT=1 STATS_AUTO_RECALC=1; +INSERT INTO `t1` VALUES (1,2),(2,3),(3,4); +# Wait till statistics update after bulk insert operation +SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'; +TABLE_ROWS AVG_ROW_LENGTH>0 +3 1 DROP TABLE t1; # End of 10.6 tests # @@ -351,7 +370,7 @@ DROP TABLE t1, t2; # MDEV-29801 Inconsistent ER_TOO_BIG_ROWSIZE during bulk # insert operation # -call mtr.add_suppression("InnoDB: Cannot add field `c11` in table"); +call mtr.add_suppression("InnoDB: Cannot add field `(c0[36]|c11)` in table"); SET @format= @@innodb_default_row_format; CREATE TABLE t1 (pk int primary key, c01 text, c02 text, c03 text, c04 text, c05 text, c06 text, c07 text, c08 text, diff --git a/mysql-test/suite/innodb/r/insert_into_empty_notembedded.result b/mysql-test/suite/innodb/r/insert_into_empty_notembedded.result new file mode 100644 index 00000000000..5305b2e7a85 --- /dev/null +++ b/mysql-test/suite/innodb/r/insert_into_empty_notembedded.result @@ -0,0 +1,30 @@ +# +# Start of 10.6 tests +# +# +# MDEV-27214 Import with disabled keys corrupts meta-data like rows, indexes, ... +# +CREATE DATABASE db1; +CREATE TABLE db1.t1 (id int, a int,PRIMARY KEY (id)) ENGINE=InnoDB +STATS_PERSISTENT=1 STATS_AUTO_RECALC=1; +INSERT INTO db1.t1 VALUES (1,2),(2,3),(3,4); +DROP DATABASE IF EXISTS db1; +CREATE DATABASE db1; +# Wait till statistics update after bulk insert operation +SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='db1'; +TABLE_ROWS AVG_ROW_LENGTH>0 +3 1 +OPTIMIZE TABLE db1.t1; +Table Op Msg_type Msg_text +db1.t1 optimize note Table does not support optimize, doing recreate + analyze instead +db1.t1 optimize status OK +# Wait till statistics update after bulk insert operation +SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='db1'; +TABLE_ROWS AVG_ROW_LENGTH>0 +3 1 +DROP DATABASE db1; +# +# End of 10.6 tests +# diff --git a/mysql-test/suite/innodb/r/temporary_table.result b/mysql-test/suite/innodb/r/temporary_table.result index a8a073cb257..ffcee726f0d 100644 --- a/mysql-test/suite/innodb/r/temporary_table.result +++ b/mysql-test/suite/innodb/r/temporary_table.result @@ -789,4 +789,16 @@ CHECK TABLE t EXTENDED; Table Op Msg_type Msg_text test.t check status OK DROP TEMPORARY TABLE t; +# +# MDEV-29978 Corruption errors upon CHECK on temporary InnoDB table +# +CREATE TEMPORARY TABLE t (f INT UNIQUE) ENGINE=InnoDB; +INSERT INTO t (f) VALUES (1),(2); +CHECK TABLE t; +Table Op Msg_type Msg_text +test.t check status OK +CHECK TABLE t EXTENDED; +Table Op Msg_type Msg_text +test.t check status OK +DROP TEMPORARY TABLE t; # End of 10.6 tests diff --git a/mysql-test/suite/innodb/t/insert_into_empty.test b/mysql-test/suite/innodb/t/insert_into_empty.test index 590f76dca9e..fab1b882868 100644 --- a/mysql-test/suite/innodb/t/insert_into_empty.test +++ b/mysql-test/suite/innodb/t/insert_into_empty.test @@ -1,5 +1,5 @@ --source include/have_innodb.inc - +--source include/innodb_page_size.inc --source include/have_sequence.inc --source include/maybe_debug.inc --source include/have_partition.inc @@ -199,15 +199,41 @@ DROP TABLE t; --echo # MDEV-28327 InnoDB persistent statistics fail to update --echo # after bulk insert --echo # -CREATE TABLE t1 (a INT PRIMARY KEY)ENGINE=InnoDB; +CREATE TABLE t1 (a INT PRIMARY KEY)ENGINE=InnoDB +STATS_PERSISTENT=1 STATS_AUTO_RECALC=1; INSERT INTO t1 SELECT * FROM seq_1_to_4096; --echo # Wait till statistics update after bulk insert operation let $wait_condition= select n_rows > 100 from mysql.innodb_table_stats where table_name="t1"; source include/wait_condition.inc; -SELECT n_rows FROM mysql.innodb_table_stats WHERE TABLE_NAME="t1"; +# At innodb_page_size=4k this will be only 4075, not 4096. Add some slack. +# This is related to MDEV-24621 and possibly MDEV-26740. +SELECT n_rows>=4000 FROM mysql.innodb_table_stats WHERE TABLE_NAME="t1"; +DROP TABLE t1; + + +--echo # +--echo # MDEV-27214 Import with disabled keys corrupts meta-data like rows, indexes, ... +--echo # + +SET UNIQUE_CHECKS=0; +SET FOREIGN_KEY_CHECKS=0; +CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `a` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +STATS_PERSISTENT=1 STATS_AUTO_RECALC=1; +INSERT INTO `t1` VALUES (1,2),(2,3),(3,4); +--echo # Wait till statistics update after bulk insert operation +let $wait_condition= select n_rows > 0 from mysql.innodb_table_stats +where database_name='test' and table_name='t1'; +source include/wait_condition.inc; +SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'; DROP TABLE t1; + --echo # End of 10.6 tests --echo # @@ -363,13 +389,14 @@ DROP TABLE t1, t2; --echo # MDEV-29801 Inconsistent ER_TOO_BIG_ROWSIZE during bulk --echo # insert operation --echo # -call mtr.add_suppression("InnoDB: Cannot add field `c11` in table"); +call mtr.add_suppression("InnoDB: Cannot add field `(c0[36]|c11)` in table"); SET @format= @@innodb_default_row_format; CREATE TABLE t1 (pk int primary key, c01 text, c02 text, c03 text, c04 text, c05 text, c06 text, c07 text, c08 text, c09 text, c10 text, c11 text, c12 text) ENGINE=InnoDB; SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= COMPACT; +--replace_result 1982 8126 4030 8126 ALTER TABLE t1 FORCE; INSERT IGNORE INTO t1 VALUES (1, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107)), diff --git a/mysql-test/suite/innodb/t/insert_into_empty_notembedded.test b/mysql-test/suite/innodb/t/insert_into_empty_notembedded.test new file mode 100644 index 00000000000..267501133ea --- /dev/null +++ b/mysql-test/suite/innodb/t/insert_into_empty_notembedded.test @@ -0,0 +1,43 @@ +--source include/not_embedded.inc +--source include/have_innodb.inc +--source include/innodb_page_size.inc +--source include/maybe_debug.inc + +--echo # +--echo # Start of 10.6 tests +--echo # + +--echo # +--echo # MDEV-27214 Import with disabled keys corrupts meta-data like rows, indexes, ... +--echo # + +CREATE DATABASE db1; +CREATE TABLE db1.t1 (id int, a int,PRIMARY KEY (id)) ENGINE=InnoDB +STATS_PERSISTENT=1 STATS_AUTO_RECALC=1; +INSERT INTO db1.t1 VALUES (1,2),(2,3),(3,4); +--let $file = $MYSQLTEST_VARDIR/tmp/dump.sql +--exec $MYSQL_DUMP db1 t1 >$file +DROP DATABASE IF EXISTS db1; + +CREATE DATABASE db1; +--exec $MYSQL db1 < $file +--remove_file $file +--echo # Wait till statistics update after bulk insert operation +let $wait_condition= select n_rows > 0 from mysql.innodb_table_stats +where database_name='db1' and table_name='t1'; +source include/wait_condition.inc; +SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='db1'; + +OPTIMIZE TABLE db1.t1; +--echo # Wait till statistics update after bulk insert operation +let $wait_condition= select n_rows > 0 from mysql.innodb_table_stats +where database_name='db1' and table_name='t1'; +source include/wait_condition.inc; +SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='db1'; +DROP DATABASE db1; + +--echo # +--echo # End of 10.6 tests +--echo # diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test index 0cc3b29feb1..5d7e5d51696 100644 --- a/mysql-test/suite/innodb/t/temporary_table.test +++ b/mysql-test/suite/innodb/t/temporary_table.test @@ -624,4 +624,15 @@ UPDATE t SET a=2; CHECK TABLE t; CHECK TABLE t EXTENDED; DROP TEMPORARY TABLE t; + +--echo # +--echo # MDEV-29978 Corruption errors upon CHECK on temporary InnoDB table +--echo # + +CREATE TEMPORARY TABLE t (f INT UNIQUE) ENGINE=InnoDB; +INSERT INTO t (f) VALUES (1),(2); +CHECK TABLE t; +CHECK TABLE t EXTENDED; +DROP TEMPORARY TABLE t; + --echo # End of 10.6 tests diff --git a/mysql-test/suite/maria/rollback.result b/mysql-test/suite/maria/rollback.result index 959f596edf2..2e58387ce57 100644 --- a/mysql-test/suite/maria/rollback.result +++ b/mysql-test/suite/maria/rollback.result @@ -1,3 +1,4 @@ +reset master; call mtr.add_suppression("Table was marked as crashed"); call mtr.add_suppression("Checking table: .*"); create table t1 (a int primary key auto_increment, b int) engine=aria transactional= 1; diff --git a/mysql-test/suite/maria/rollback.test b/mysql-test/suite/maria/rollback.test index 1469c26eaa2..d42be9274e6 100644 --- a/mysql-test/suite/maria/rollback.test +++ b/mysql-test/suite/maria/rollback.test @@ -3,6 +3,8 @@ # no-protocol doesn't print warnings about repaired tables --source include/no_protocol.inc +reset master; # clear binlogs + call mtr.add_suppression("Table was marked as crashed"); call mtr.add_suppression("Checking table: .*"); diff --git a/mysql-test/suite/mariabackup/defer_space.result b/mysql-test/suite/mariabackup/defer_space.result index 41239c476e7..6453aff5502 100644 --- a/mysql-test/suite/mariabackup/defer_space.result +++ b/mysql-test/suite/mariabackup/defer_space.result @@ -1,6 +1,7 @@ call mtr.add_suppression("InnoDB: Expected tablespace id .*"); # Mariabackup --backup with page0 INIT_PAGE redo record # and there is no FILE_CREATE for the tablespace t1 +SET @save_dbug = @@SESSION.debug_dbug; SET DEBUG_DBUG="+d,checkpoint_after_file_create"; CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB; INSERT INTO t1 VALUES(1); @@ -14,7 +15,7 @@ SELECT * FROM t1; f1 1 DROP TABLE t1; -SET DEBUG_DBUG="-d,checkpoint_after_file_create"; +SET @@SESSION.DEBUG_DBUG= @save_debug; # Mariabackup fails after corrupting the page0 in disk # and there is no INIT_PAGE for page0 CREATE TABLE t1(c INT) ENGINE=INNODB; diff --git a/mysql-test/suite/mariabackup/defer_space.test b/mysql-test/suite/mariabackup/defer_space.test index a475b010531..397a1ff5dc2 100644 --- a/mysql-test/suite/mariabackup/defer_space.test +++ b/mysql-test/suite/mariabackup/defer_space.test @@ -6,6 +6,7 @@ call mtr.add_suppression("InnoDB: Expected tablespace id .*"); --echo # Mariabackup --backup with page0 INIT_PAGE redo record --echo # and there is no FILE_CREATE for the tablespace t1 +SET @save_dbug = @@SESSION.debug_dbug; SET DEBUG_DBUG="+d,checkpoint_after_file_create"; CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB; INSERT INTO t1 VALUES(1); @@ -26,7 +27,7 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir; SELECT * FROM t1; DROP TABLE t1; rmdir $targetdir; -SET DEBUG_DBUG="-d,checkpoint_after_file_create"; +SET @@SESSION.DEBUG_DBUG= @save_debug; --echo # Mariabackup fails after corrupting the page0 in disk --echo # and there is no INIT_PAGE for page0 @@ -39,16 +40,13 @@ let INNODB_PAGE_SIZE=`select @@innodb_page_size`; --echo # Corrupt the table perl; -use strict; -use warnings; -use Fcntl qw(:DEFAULT :seek); -my $page_size = $ENV{INNODB_PAGE_SIZE}; +my $ps = $ENV{INNODB_PAGE_SIZE}; -sysopen FILE, "$ENV{MYSQLD_DATADIR}/test/t1.ibd", O_RDWR -|| die "Cannot open t1.ibd\n"; -sysseek(FILE, 0, SEEK_SET) || die "Cannot seek t1.ibd\n"; -my $page=chr(0) x $page_size; -syswrite(FILE, $page, $page_size)==$page_size; +my $file = "$ENV{MYSQLD_DATADIR}/test/t1.ibd"; +open(FILE, "+<$file") || die "Unable to open $file"; +binmode FILE; +seek (FILE, 0, SEEK_SET) or die "seek"; +print FILE chr(0x00) x $ps; close FILE or die "close"; EOF diff --git a/mysql-test/suite/sys_vars/t/wsrep_on_without_provider.test b/mysql-test/suite/sys_vars/t/wsrep_on_without_provider.test index 5bee3c9a356..9b32552436f 100644 --- a/mysql-test/suite/sys_vars/t/wsrep_on_without_provider.test +++ b/mysql-test/suite/sys_vars/t/wsrep_on_without_provider.test @@ -1,4 +1,5 @@ --source include/not_embedded.inc +--source include/have_wsrep.inc # # @@global.wsrep_on is not allowed if there diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result index f3d9a62684f..0266464c5d6 100644 --- a/mysql-test/suite/versioning/r/partition.result +++ b/mysql-test/suite/versioning/r/partition.result @@ -96,6 +96,16 @@ with system versioning partition by system_time ( partition p0 history, partition pn current); +create or replace table t1 (a int) +partition by range (a) ( +partition p0 history, +partition p1 current); +ERROR HY000: Wrong partition type `SYSTEM_TIME` for partitioning by `RANGE` +create or replace table t1 (b int) +partition by range (a) ( +partition p0 current, +partition p1 history); +ERROR HY000: Wrong partition type `SYSTEM_TIME` for partitioning by `RANGE` ## ALTER TABLE alter table t1 add partition ( partition p1 current); @@ -150,7 +160,7 @@ partition by system_time limit 1; alter table t1 change x big int; create or replace table t1 (i int) engine myisam partition by hash(i) partitions 2; alter table t1 add partition (partition px history); -ERROR HY000: Wrong partitioning type, expected type: `SYSTEM_TIME` +ERROR HY000: Wrong partition type `SYSTEM_TIME` for partitioning by `HASH` ## INSERT, UPDATE, DELETE create or replace table t1 (x int) with system versioning @@ -1140,7 +1150,7 @@ drop table t1; create table t1 (a int) with system versioning partition by system_time (partition p1 history, partition pn current); alter table t1 add partition (partition p2); -ERROR HY000: Wrong partitioning type, expected type: `SYSTEM_TIME` +ERROR HY000: Wrong partition type `HASH` for partitioning by `SYSTEM_TIME` # MDEV-17891 Assertion failures in select_insert::abort_result_set and # mysql_load upon attempt to replace into a full table set @@max_heap_table_size= 1024*1024; diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test index 5cc010a5445..e865ec3b9f6 100644 --- a/mysql-test/suite/versioning/t/partition.test +++ b/mysql-test/suite/versioning/t/partition.test @@ -107,6 +107,18 @@ partition by system_time ( partition p0 history, partition pn current); +--error ER_PARTITION_WRONG_TYPE +create or replace table t1 (a int) +partition by range (a) ( + partition p0 history, + partition p1 current); + +--error ER_PARTITION_WRONG_TYPE +create or replace table t1 (b int) +partition by range (a) ( + partition p0 current, + partition p1 history); + --echo ## ALTER TABLE |