summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/innodb
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
commit347c164c35eddab388009470e6848cb361ac93f8 (patch)
tree2c0c44eac690f510bb0a35b2a13b36d606b77b6b /mysql-test/suite/innodb
parentReleasing progress-linux version 1:10.11.7-4~progress7.99u1. (diff)
downloadmariadb-347c164c35eddab388009470e6848cb361ac93f8.tar.xz
mariadb-347c164c35eddab388009470e6848cb361ac93f8.zip
Merging upstream version 1:10.11.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/innodb')
-rw-r--r--mysql-test/suite/innodb/include/innodb_merge_threshold_delete.inc3
-rw-r--r--mysql-test/suite/innodb/include/innodb_merge_threshold_secondary.inc3
-rw-r--r--mysql-test/suite/innodb/include/innodb_merge_threshold_update.inc3
-rw-r--r--mysql-test/suite/innodb/include/no_checkpoint_start.inc23
-rw-r--r--mysql-test/suite/innodb/r/alter_copy.result2
-rw-r--r--mysql-test/suite/innodb/r/alter_kill.result4
-rw-r--r--mysql-test/suite/innodb/r/alter_not_null,COPY,NON-STRICT.rdiff121
-rw-r--r--mysql-test/suite/innodb/r/alter_not_null,COPY,STRICT.rdiff181
-rw-r--r--mysql-test/suite/innodb/r/alter_not_null,INPLACE,STRICT.rdiff164
-rw-r--r--mysql-test/suite/innodb/r/autoinc_debug.result57
-rw-r--r--mysql-test/suite/innodb/r/autoinc_import.result232
-rw-r--r--mysql-test/suite/innodb/r/check_ibd_filesize,32k.rdiff6
-rw-r--r--mysql-test/suite/innodb/r/check_ibd_filesize,4k.rdiff6
-rw-r--r--mysql-test/suite/innodb/r/check_ibd_filesize,64k.rdiff6
-rw-r--r--mysql-test/suite/innodb/r/check_ibd_filesize,8k.rdiff6
-rw-r--r--mysql-test/suite/innodb/r/check_ibd_filesize.result2
-rw-r--r--mysql-test/suite/innodb/r/cursor-restore-unique-null.result24
-rw-r--r--mysql-test/suite/innodb/r/foreign_key.result21
-rw-r--r--mysql-test/suite/innodb/r/full_crc32_import.result20
-rw-r--r--mysql-test/suite/innodb/r/import_bugs.result52
-rw-r--r--mysql-test/suite/innodb/r/import_hidden_fts.result45
-rw-r--r--mysql-test/suite/innodb/r/import_hidden_fts_debug.result76
-rw-r--r--mysql-test/suite/innodb/r/index_length.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-debug.result15
-rw-r--r--mysql-test/suite/innodb/r/innodb-lru-force-no-free-page.result10
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522,crc32.rdiff5
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522,strict_crc32.rdiff17
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug30113362.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_mysql.result12
-rw-r--r--mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_stats_fetch.result7
-rw-r--r--mysql-test/suite/innodb/r/innodb_timeout_rollback.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_ut_format_name.result5
-rw-r--r--mysql-test/suite/innodb/r/insert_into_empty,4k.rdiff12
-rw-r--r--mysql-test/suite/innodb/r/insert_into_empty.result53
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_crash.result24
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_debug,redundant.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_debug.result53
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_extend.resultbin9115 -> 9503 bytes
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_import.result1
-rw-r--r--mysql-test/suite/innodb/r/lock_insert_into_empty.result5
-rw-r--r--mysql-test/suite/innodb/r/lock_isolation.result136
-rw-r--r--mysql-test/suite/innodb/r/log_upgrade_101_flags.result12
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,16k,compact.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,16k,compact,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,16k,dynamic.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,16k,dynamic,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,16k,redundant.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,16k,innodb,redundant.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,32k,compact.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,32k,compact,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,32k,dynamic.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,32k,dynamic,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,32k,redundant.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,32k,innodb,redundant.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,4k,compact.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,4k,compact,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,4k,dynamic.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,4k,dynamic,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,4k,redundant.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,4k,innodb,redundant.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,64k,compact.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,64k,compact,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,64k,dynamic.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,64k,dynamic,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,64k,redundant.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,64k,innodb,redundant.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,8k,compact.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,8k,compact,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,8k,dynamic.rdiff (renamed from mysql-test/suite/innodb/r/max_record_size,8k,dynamic,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/monitor.result56
-rw-r--r--mysql-test/suite/innodb/r/rename_table.result10
-rw-r--r--mysql-test/suite/innodb/r/restart,16k.rdiff (renamed from mysql-test/suite/innodb/r/restart,16k,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/restart,32k.rdiff (renamed from mysql-test/suite/innodb/r/restart,32k,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/restart,4k.rdiff (renamed from mysql-test/suite/innodb/r/restart,4k,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/restart,64k.rdiff (renamed from mysql-test/suite/innodb/r/restart,64k,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/restart,8k.rdiff (renamed from mysql-test/suite/innodb/r/restart,8k,innodb.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/row_size_error_log_warnings_3,4k.rdiff2
-rw-r--r--mysql-test/suite/innodb/r/row_size_error_log_warnings_3.result8
-rw-r--r--mysql-test/suite/innodb/r/undo_space_dblwr.result9
-rw-r--r--mysql-test/suite/innodb/r/undo_truncate.result3
-rw-r--r--mysql-test/suite/innodb/t/alter_copy.test2
-rw-r--r--mysql-test/suite/innodb/t/alter_crash.test6
-rw-r--r--mysql-test/suite/innodb/t/alter_kill.test2
-rw-r--r--mysql-test/suite/innodb/t/alter_rename_existing.test2
-rw-r--r--mysql-test/suite/innodb/t/autoinc_debug.test66
-rw-r--r--mysql-test/suite/innodb/t/autoinc_import.test168
-rw-r--r--mysql-test/suite/innodb/t/corrupted_during_recovery.test2
-rw-r--r--mysql-test/suite/innodb/t/cursor-restore-unique-null.test36
-rw-r--r--mysql-test/suite/innodb/t/doublewrite_debug.test4
-rw-r--r--mysql-test/suite/innodb/t/foreign_key.test21
-rw-r--r--mysql-test/suite/innodb/t/full_crc32_import.test12
-rw-r--r--mysql-test/suite/innodb/t/group_commit_crash.test2
-rw-r--r--mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test2
-rw-r--r--mysql-test/suite/innodb/t/import_bugs.test62
-rw-r--r--mysql-test/suite/innodb/t/import_hidden_fts.test46
-rw-r--r--mysql-test/suite/innodb/t/import_hidden_fts_debug.test101
-rw-r--r--mysql-test/suite/innodb/t/index_length.test8
-rw-r--r--mysql-test/suite/innodb/t/index_merge_threshold.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-debug.test22
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-tempfile.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-corrupted-table.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-lru-force-no-free-page.test24
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5522-debug.test6
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug60196.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_stats.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_stats_fetch.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb_timeout_rollback.test3
-rw-r--r--mysql-test/suite/innodb/t/innodb_ut_format_name.test17
-rw-r--r--mysql-test/suite/innodb/t/insert_into_empty.test61
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_crash.test26
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_debug.test53
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_extend.test13
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_import.test1
-rw-r--r--mysql-test/suite/innodb/t/lock_insert_into_empty.test4
-rw-r--r--mysql-test/suite/innodb/t/lock_isolation.test149
-rw-r--r--mysql-test/suite/innodb/t/log_file_name.test2
-rw-r--r--mysql-test/suite/innodb/t/log_upgrade_101_flags.test91
-rw-r--r--mysql-test/suite/innodb/t/monitor.test62
-rw-r--r--mysql-test/suite/innodb/t/purge_secondary.test4
-rw-r--r--mysql-test/suite/innodb/t/rename_table.test9
-rw-r--r--mysql-test/suite/innodb/t/row_size_error_log_warnings_3.test16
-rw-r--r--mysql-test/suite/innodb/t/temporary_table.test2
-rw-r--r--mysql-test/suite/innodb/t/undo_space_dblwr.test12
-rw-r--r--mysql-test/suite/innodb/t/undo_truncate.test5
-rw-r--r--mysql-test/suite/innodb/t/undo_truncate_recover.test2
113 files changed, 2256 insertions, 429 deletions
diff --git a/mysql-test/suite/innodb/include/innodb_merge_threshold_delete.inc b/mysql-test/suite/innodb/include/innodb_merge_threshold_delete.inc
index 8c60cd6e..7d7188aa 100644
--- a/mysql-test/suite/innodb/include/innodb_merge_threshold_delete.inc
+++ b/mysql-test/suite/innodb/include/innodb_merge_threshold_delete.inc
@@ -5,9 +5,6 @@
# "create table tab1 (a bigint primary key, b varchar(2048)) engine=InnoDB;"
#
---source include/have_innodb.inc
---source include/have_innodb_16k.inc
-
# turn on flags
--disable_query_log
SET GLOBAL innodb_monitor_enable=index_page_merge_attempts;
diff --git a/mysql-test/suite/innodb/include/innodb_merge_threshold_secondary.inc b/mysql-test/suite/innodb/include/innodb_merge_threshold_secondary.inc
index 8e821365..1d3aca87 100644
--- a/mysql-test/suite/innodb/include/innodb_merge_threshold_secondary.inc
+++ b/mysql-test/suite/innodb/include/innodb_merge_threshold_secondary.inc
@@ -6,9 +6,6 @@
# "create index index1 on tab1(b(750));"
#
---source include/have_innodb.inc
---source include/have_innodb_16k.inc
-
# turn on flags
--disable_query_log
SET GLOBAL innodb_monitor_enable=index_page_merge_attempts;
diff --git a/mysql-test/suite/innodb/include/innodb_merge_threshold_update.inc b/mysql-test/suite/innodb/include/innodb_merge_threshold_update.inc
index 61e961ac..f91a796d 100644
--- a/mysql-test/suite/innodb/include/innodb_merge_threshold_update.inc
+++ b/mysql-test/suite/innodb/include/innodb_merge_threshold_update.inc
@@ -5,9 +5,6 @@
# "create table tab1 (a bigint primary key, b varchar(2048)) engine=InnoDB;"
#
---source include/have_innodb.inc
---source include/have_innodb_16k.inc
-
# turn on flags
--disable_query_log
SET GLOBAL innodb_monitor_enable=index_page_merge_attempts;
diff --git a/mysql-test/suite/innodb/include/no_checkpoint_start.inc b/mysql-test/suite/innodb/include/no_checkpoint_start.inc
index a903fee6..69823dd0 100644
--- a/mysql-test/suite/innodb/include/no_checkpoint_start.inc
+++ b/mysql-test/suite/innodb/include/no_checkpoint_start.inc
@@ -1,5 +1,28 @@
# Preparation for using no_checkpoint_end.inc
+# no_checkpoint_flush: Set to trigger flushing the dirty pages from buffer pool
+# and checkpoint before the "no checkpoint" block.
+
+if ($no_checkpoint_flush) {
+ --echo
+ --echo # Flush all dirty pages from buffer pool
+ SET @no_checkpoint_save_pct= @@GLOBAL.innodb_max_dirty_pages_pct;
+ SET @no_checkpoint_save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm;
+
+ SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
+ SET GLOBAL innodb_max_dirty_pages_pct=0.0;
+
+ let $wait_condition =
+ SELECT variable_value = 0
+ FROM information_schema.global_status
+ WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
+ --source include/wait_condition.inc
+
+ SET GLOBAL innodb_max_dirty_pages_pct= @no_checkpoint_save_pct;
+ SET GLOBAL innodb_max_dirty_pages_pct_lwm= @no_checkpoint_save_pct_lwm;
+ --echo
+}
+
let MYSQLD_DATADIR= `select @@datadir`;
--replace_regex /.*Last checkpoint at[ ]*([0-9]+).*/\1/
let CHECKPOINT_LSN=`SHOW ENGINE INNODB STATUS`;
diff --git a/mysql-test/suite/innodb/r/alter_copy.result b/mysql-test/suite/innodb/r/alter_copy.result
index 8c9e5966..72ae28e9 100644
--- a/mysql-test/suite/innodb/r/alter_copy.result
+++ b/mysql-test/suite/innodb/r/alter_copy.result
@@ -51,7 +51,7 @@ ADD INDEX(a,b,d), ADD INDEX(a,d,b), ADD INDEX(b,c,d), ADD INDEX(b,d,c),
ALGORITHM=COPY;
connection default;
SET DEBUG_SYNC='now WAIT_FOR hung';
-# restart: --innodb-force-recovery=3 --debug_dbug=+d,recv_ran_out_of_buffer
+# restart: --innodb-force-recovery=3
disconnect hang;
FTS_INDEX_1.ibd
FTS_INDEX_2.ibd
diff --git a/mysql-test/suite/innodb/r/alter_kill.result b/mysql-test/suite/innodb/r/alter_kill.result
index 51814088..209a711d 100644
--- a/mysql-test/suite/innodb/r/alter_kill.result
+++ b/mysql-test/suite/innodb/r/alter_kill.result
@@ -15,9 +15,9 @@ disconnect con1;
# and recompute innodb_checksum_algorithm=crc32
# restart
SELECT COUNT(*) FROM bug16720368;
-ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine
+ERROR HY000: Table `test`.`bug16720368` is corrupted. Please drop the table and recreate.
INSERT INTO bug16720368 VALUES(1);
-ERROR HY000: Table test/bug16720368 is corrupted. Please drop the table and recreate.
+ERROR HY000: Table `test`.`bug16720368` is corrupted. Please drop the table and recreate.
INSERT INTO bug16720368_1 VALUES(1);
# Shut down the server to uncorrupt the data.
# restart
diff --git a/mysql-test/suite/innodb/r/alter_not_null,COPY,NON-STRICT.rdiff b/mysql-test/suite/innodb/r/alter_not_null,COPY,NON-STRICT.rdiff
index 01db97e5..7c32d38a 100644
--- a/mysql-test/suite/innodb/r/alter_not_null,COPY,NON-STRICT.rdiff
+++ b/mysql-test/suite/innodb/r/alter_not_null,COPY,NON-STRICT.rdiff
@@ -1,42 +1,79 @@
-7,8c7,8
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
----
-> affected rows: 1
-> info: Records: 1 Duplicates: 0 Warnings: 1
-21,22c21,22
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
----
-> affected rows: 1
-> info: Records: 1 Duplicates: 0 Warnings: 1
-35,36c35,36
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
----
-> affected rows: 1
-> info: Records: 1 Duplicates: 0 Warnings: 1
-49,50c49,50
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
----
-> affected rows: 1
-> info: Records: 1 Duplicates: 0 Warnings: 1
-63,64c63,64
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
----
-> affected rows: 1
-> info: Records: 1 Duplicates: 0 Warnings: 1
-77,78c77,78
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
----
-> affected rows: 1
-> info: Records: 1 Duplicates: 0 Warnings: 1
-98,99c98,99
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
----
-> affected rows: 1
-> info: Records: 1 Duplicates: 0 Warnings: 1
+--- alter_not_null.result
++++ alter_not_null,COPY,NON-STRICT.result~
+@@ -4,8 +4,8 @@
+ f1
+ NULL
+ ALTER TABLE t1 CHANGE f1 f1 INT NOT NULL;
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
++affected rows: 1
++info: Records: 1 Duplicates: 0 Warnings: 1
+ Warnings:
+ Warning 1265 Data truncated for column 'f1' at row 1
+ SELECT * FROM t1;
+@@ -18,8 +18,8 @@
+ f1
+ NULL
+ ALTER TABLE t1 CHANGE f1 f1 CHAR(10) NOT NULL;
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
++affected rows: 1
++info: Records: 1 Duplicates: 0 Warnings: 1
+ Warnings:
+ Warning 1265 Data truncated for column 'f1' at row 1
+ SELECT * FROM t1;
+@@ -32,8 +32,8 @@
+ f1
+ NULL
+ ALTER TABLE t1 CHANGE f1 f1 VARCHAR(20) NOT NULL;
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
++affected rows: 1
++info: Records: 1 Duplicates: 0 Warnings: 1
+ Warnings:
+ Warning 1265 Data truncated for column 'f1' at row 1
+ SELECT * FROM t1;
+@@ -46,8 +46,8 @@
+ f1
+ NULL
+ ALTER TABLE t1 CHANGE f1 f1 TEXT NOT NULL DEFAULT 'abc';
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
++affected rows: 1
++info: Records: 1 Duplicates: 0 Warnings: 1
+ Warnings:
+ Warning 1265 Data truncated for column 'f1' at row 1
+ SELECT * FROM t1;
+@@ -60,8 +60,8 @@
+ f1 f2 f3
+ 2 2 NULL
+ ALTER TABLE t1 CHANGE f3 f3 INT NOT NULL DEFAULT (f1 + f2);
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
++affected rows: 1
++info: Records: 1 Duplicates: 0 Warnings: 1
+ Warnings:
+ Warning 1265 Data truncated for column 'f3' at row 1
+ SELECT * FROM t1;
+@@ -74,8 +74,8 @@
+ f1 b
+ 10 NULL
+ ALTER TABLE t1 CHANGE b b TINYINT NOT NULL DEFAULT if(unix_timestamp()>1,1000,0);
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
++affected rows: 1
++info: Records: 1 Duplicates: 0 Warnings: 1
+ Warnings:
+ Warning 1265 Data truncated for column 'b' at row 1
+ SELECT * FROM t1;
+@@ -95,8 +95,8 @@
+ CREATE TABLE t1(c1 INT NOT NULL, c2 INT, PRIMARY KEY(c1))ENGINE=INNODB;
+ INSERT INTO t1 VALUES(1, NULL);
+ ALTER IGNORE TABLE t1 CHANGE c2 c2 INT NOT NULL DEFAULT 2;
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
++affected rows: 1
++info: Records: 1 Duplicates: 0 Warnings: 1
+ Warnings:
+ Warning 1265 Data truncated for column 'c2' at row 1
+ SELECT * FROM t1;
diff --git a/mysql-test/suite/innodb/r/alter_not_null,COPY,STRICT.rdiff b/mysql-test/suite/innodb/r/alter_not_null,COPY,STRICT.rdiff
index e02d235c..37e97169 100644
--- a/mysql-test/suite/innodb/r/alter_not_null,COPY,STRICT.rdiff
+++ b/mysql-test/suite/innodb/r/alter_not_null,COPY,STRICT.rdiff
@@ -1,72 +1,109 @@
-7,10c7
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
-< Warnings:
-< Warning 1265 Data truncated for column 'f1' at row 1
----
-> ERROR 01000: Data truncated for column 'f1' at row 1
-13c10
-< 0
----
-> NULL
-21,24c18
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
-< Warnings:
-< Warning 1265 Data truncated for column 'f1' at row 1
----
-> ERROR 01000: Data truncated for column 'f1' at row 1
-27c21
-<
----
-> NULL
-35,38c29
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
-< Warnings:
-< Warning 1265 Data truncated for column 'f1' at row 1
----
-> ERROR 01000: Data truncated for column 'f1' at row 1
-41c32
-<
----
-> NULL
-49,52c40
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
-< Warnings:
-< Warning 1265 Data truncated for column 'f1' at row 1
----
-> ERROR 01000: Data truncated for column 'f1' at row 1
-55c43
-<
----
-> NULL
-63,66c51
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
-< Warnings:
-< Warning 1265 Data truncated for column 'f3' at row 1
----
-> ERROR 01000: Data truncated for column 'f3' at row 1
-69c54
-< 2 2 0
----
-> 2 2 NULL
-77,80c62
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
-< Warnings:
-< Warning 1265 Data truncated for column 'b' at row 1
----
-> ERROR 01000: Data truncated for column 'b' at row 1
-83c65
-< 10 0
----
-> 10 NULL
-98,99c80,81
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
----
-> affected rows: 1
-> info: Records: 1 Duplicates: 0 Warnings: 1
+--- alter_not_null.result
++++ alter_not_null,COPY,STRICT.result~
+@@ -4,13 +4,10 @@
+ f1
+ NULL
+ ALTER TABLE t1 CHANGE f1 f1 INT NOT NULL;
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
+-Warnings:
+-Warning 1265 Data truncated for column 'f1' at row 1
++ERROR 01000: Data truncated for column 'f1' at row 1
+ SELECT * FROM t1;
+ f1
+-0
++NULL
+ DROP TABLE t1;
+ CREATE TABLE t1(f1 CHAR(10))ENGINE=INNODB;
+ INSERT INTO t1 VALUES(NULL);
+@@ -18,13 +15,10 @@
+ f1
+ NULL
+ ALTER TABLE t1 CHANGE f1 f1 CHAR(10) NOT NULL;
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
+-Warnings:
+-Warning 1265 Data truncated for column 'f1' at row 1
++ERROR 01000: Data truncated for column 'f1' at row 1
+ SELECT * FROM t1;
+ f1
+-
++NULL
+ DROP TABLE t1;
+ CREATE TABLE t1(f1 VARCHAR(10))ENGINE=INNODB;
+ INSERT INTO t1 VALUES(NULL);
+@@ -32,13 +26,10 @@
+ f1
+ NULL
+ ALTER TABLE t1 CHANGE f1 f1 VARCHAR(20) NOT NULL;
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
+-Warnings:
+-Warning 1265 Data truncated for column 'f1' at row 1
++ERROR 01000: Data truncated for column 'f1' at row 1
+ SELECT * FROM t1;
+ f1
+-
++NULL
+ DROP TABLE t1;
+ CREATE TABLE t1(f1 TEXT)ENGINE=INNODB;
+ INSERT INTO t1 VALUES(NULL);
+@@ -46,13 +37,10 @@
+ f1
+ NULL
+ ALTER TABLE t1 CHANGE f1 f1 TEXT NOT NULL DEFAULT 'abc';
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
+-Warnings:
+-Warning 1265 Data truncated for column 'f1' at row 1
++ERROR 01000: Data truncated for column 'f1' at row 1
+ SELECT * FROM t1;
+ f1
+-
++NULL
+ DROP TABLE t1;
+ CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, f3 INT)ENGINE=INNODB;
+ INSERT INTO t1 VALUES(2, 2, NULL);
+@@ -60,13 +48,10 @@
+ f1 f2 f3
+ 2 2 NULL
+ ALTER TABLE t1 CHANGE f3 f3 INT NOT NULL DEFAULT (f1 + f2);
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
+-Warnings:
+-Warning 1265 Data truncated for column 'f3' at row 1
++ERROR 01000: Data truncated for column 'f3' at row 1
+ SELECT * FROM t1;
+ f1 f2 f3
+-2 2 0
++2 2 NULL
+ DROP TABLE t1;
+ CREATE TABLE t1(f1 INT NOT NULL DEFAULT 0, b TINYINT)ENGINE=InnoDB;
+ INSERT INTO t1 VALUES(10, NULL);
+@@ -74,13 +59,10 @@
+ f1 b
+ 10 NULL
+ ALTER TABLE t1 CHANGE b b TINYINT NOT NULL DEFAULT if(unix_timestamp()>1,1000,0);
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
+-Warnings:
+-Warning 1265 Data truncated for column 'b' at row 1
++ERROR 01000: Data truncated for column 'b' at row 1
+ SELECT * FROM t1;
+ f1 b
+-10 0
++10 NULL
+ DROP TABLE t1;
+ CREATE TABLE t1(a INT, v INT AS (a), c INT, d INT NOT NULL, e INT) ENGINE=InnoDB;
+ ALTER TABLE t1 DROP COLUMN c, CHANGE COLUMN e e INT NOT NULL;
+@@ -95,8 +77,8 @@
+ CREATE TABLE t1(c1 INT NOT NULL, c2 INT, PRIMARY KEY(c1))ENGINE=INNODB;
+ INSERT INTO t1 VALUES(1, NULL);
+ ALTER IGNORE TABLE t1 CHANGE c2 c2 INT NOT NULL DEFAULT 2;
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
++affected rows: 1
++info: Records: 1 Duplicates: 0 Warnings: 1
+ Warnings:
+ Warning 1265 Data truncated for column 'c2' at row 1
+ SELECT * FROM t1;
diff --git a/mysql-test/suite/innodb/r/alter_not_null,INPLACE,STRICT.rdiff b/mysql-test/suite/innodb/r/alter_not_null,INPLACE,STRICT.rdiff
index ec97b174..555f4cdb 100644
--- a/mysql-test/suite/innodb/r/alter_not_null,INPLACE,STRICT.rdiff
+++ b/mysql-test/suite/innodb/r/alter_not_null,INPLACE,STRICT.rdiff
@@ -1,66 +1,98 @@
-7,10c7
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
-< Warnings:
-< Warning 1265 Data truncated for column 'f1' at row 1
----
-> ERROR 01000: Data truncated for column 'f1' at row 1
-13c10
-< 0
----
-> NULL
-21,24c18
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
-< Warnings:
-< Warning 1265 Data truncated for column 'f1' at row 1
----
-> ERROR 01000: Data truncated for column 'f1' at row 1
-27c21
-<
----
-> NULL
-35,38c29
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
-< Warnings:
-< Warning 1265 Data truncated for column 'f1' at row 1
----
-> ERROR 01000: Data truncated for column 'f1' at row 1
-41c32
-<
----
-> NULL
-49,52c40
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
-< Warnings:
-< Warning 1265 Data truncated for column 'f1' at row 1
----
-> ERROR 01000: Data truncated for column 'f1' at row 1
-55c43
-<
----
-> NULL
-63,66c51
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
-< Warnings:
-< Warning 1265 Data truncated for column 'f3' at row 1
----
-> ERROR 01000: Data truncated for column 'f3' at row 1
-69c54
-< 2 2 0
----
-> 2 2 NULL
-77,80c62
-< affected rows: 0
-< info: Records: 0 Duplicates: 0 Warnings: 1
-< Warnings:
-< Warning 1265 Data truncated for column 'b' at row 1
----
-> ERROR 01000: Data truncated for column 'b' at row 1
-83c65
-< 10 0
----
-> 10 NULL
+--- alter_not_null.result
++++ alter_not_null,INPLACE,STRICT.result~
+@@ -4,13 +4,10 @@
+ f1
+ NULL
+ ALTER TABLE t1 CHANGE f1 f1 INT NOT NULL;
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
+-Warnings:
+-Warning 1265 Data truncated for column 'f1' at row 1
++ERROR 01000: Data truncated for column 'f1' at row 1
+ SELECT * FROM t1;
+ f1
+-0
++NULL
+ DROP TABLE t1;
+ CREATE TABLE t1(f1 CHAR(10))ENGINE=INNODB;
+ INSERT INTO t1 VALUES(NULL);
+@@ -18,13 +15,10 @@
+ f1
+ NULL
+ ALTER TABLE t1 CHANGE f1 f1 CHAR(10) NOT NULL;
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
+-Warnings:
+-Warning 1265 Data truncated for column 'f1' at row 1
++ERROR 01000: Data truncated for column 'f1' at row 1
+ SELECT * FROM t1;
+ f1
+-
++NULL
+ DROP TABLE t1;
+ CREATE TABLE t1(f1 VARCHAR(10))ENGINE=INNODB;
+ INSERT INTO t1 VALUES(NULL);
+@@ -32,13 +26,10 @@
+ f1
+ NULL
+ ALTER TABLE t1 CHANGE f1 f1 VARCHAR(20) NOT NULL;
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
+-Warnings:
+-Warning 1265 Data truncated for column 'f1' at row 1
++ERROR 01000: Data truncated for column 'f1' at row 1
+ SELECT * FROM t1;
+ f1
+-
++NULL
+ DROP TABLE t1;
+ CREATE TABLE t1(f1 TEXT)ENGINE=INNODB;
+ INSERT INTO t1 VALUES(NULL);
+@@ -46,13 +37,10 @@
+ f1
+ NULL
+ ALTER TABLE t1 CHANGE f1 f1 TEXT NOT NULL DEFAULT 'abc';
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
+-Warnings:
+-Warning 1265 Data truncated for column 'f1' at row 1
++ERROR 01000: Data truncated for column 'f1' at row 1
+ SELECT * FROM t1;
+ f1
+-
++NULL
+ DROP TABLE t1;
+ CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, f3 INT)ENGINE=INNODB;
+ INSERT INTO t1 VALUES(2, 2, NULL);
+@@ -60,13 +48,10 @@
+ f1 f2 f3
+ 2 2 NULL
+ ALTER TABLE t1 CHANGE f3 f3 INT NOT NULL DEFAULT (f1 + f2);
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
+-Warnings:
+-Warning 1265 Data truncated for column 'f3' at row 1
++ERROR 01000: Data truncated for column 'f3' at row 1
+ SELECT * FROM t1;
+ f1 f2 f3
+-2 2 0
++2 2 NULL
+ DROP TABLE t1;
+ CREATE TABLE t1(f1 INT NOT NULL DEFAULT 0, b TINYINT)ENGINE=InnoDB;
+ INSERT INTO t1 VALUES(10, NULL);
+@@ -74,13 +59,10 @@
+ f1 b
+ 10 NULL
+ ALTER TABLE t1 CHANGE b b TINYINT NOT NULL DEFAULT if(unix_timestamp()>1,1000,0);
+-affected rows: 0
+-info: Records: 0 Duplicates: 0 Warnings: 1
+-Warnings:
+-Warning 1265 Data truncated for column 'b' at row 1
++ERROR 01000: Data truncated for column 'b' at row 1
+ SELECT * FROM t1;
+ f1 b
+-10 0
++10 NULL
+ DROP TABLE t1;
+ CREATE TABLE t1(a INT, v INT AS (a), c INT, d INT NOT NULL, e INT) ENGINE=InnoDB;
+ ALTER TABLE t1 DROP COLUMN c, CHANGE COLUMN e e INT NOT NULL;
diff --git a/mysql-test/suite/innodb/r/autoinc_debug.result b/mysql-test/suite/innodb/r/autoinc_debug.result
index b3b7a469..59740e43 100644
--- a/mysql-test/suite/innodb/r/autoinc_debug.result
+++ b/mysql-test/suite/innodb/r/autoinc_debug.result
@@ -105,3 +105,60 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
SET DEBUG_SYNC='RESET';
+#
+# MDEV-33593: Auto increment deadlock error causes ASSERT in subsequent save point
+#
+CREATE TABLE t1(col1 INT PRIMARY KEY AUTO_INCREMENT, col2 INT) ENGINE=InnoDB;
+CREATE TABLE t2(col1 INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1(col2) values(100);
+connect con1, localhost, root,,;
+START TRANSACTION;
+# T1: Acquiring Row X lock on table t2
+INSERT INTO t2 values(100);
+connect con2, localhost, root,,;
+START TRANSACTION;
+# T2: Wait for (T1) row lock on t2 after acquiring GAP Lock on t1
+UPDATE t1 SET col2 = 20 where col1 = 10;
+SET DEBUG_SYNC='lock_wait_before_suspend SIGNAL t2_waiting';
+INSERT INTO t2 values(100);
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR t2_waiting';
+# T3: Wait for (T2) II row Lock on t1 after acquiring Auto Increment Lock on t1
+SET DEBUG_SYNC='lock_wait_before_suspend SIGNAL t3_waiting';
+INSERT INTO t1(col2) SELECT col2 from t1;
+connection con1;
+SAVEPOINT s1;
+SET DEBUG_SYNC='now WAIT_FOR t3_waiting';
+# T1: Wait for (T3) auto increment lock on t1 causing T1 -> T3 -> T2 -> T1 deadlock
+SET debug_dbug = '+d,innodb_deadlock_victim_self';
+INSERT INTO t1(col2) VALUES(200);
+ERROR HY000: Failed to read auto-increment value from storage engine
+# The transaction should have been rolled back
+SELECT * FROM t1;
+col1 col2
+1 100
+SELECT * FROM t2;
+col1
+# Release the previous savepoint using the same name
+SAVEPOINT s1;
+COMMIT;
+connection con2;
+COMMIT;
+connection default;
+COMMIT;
+disconnect con1;
+disconnect con2;
+# Cleanup
+SELECT * FROM t1;
+col1 col2
+1 100
+2 100
+DROP TABLE t1;
+SELECT * FROM t2;
+col1
+100
+DROP TABLE t2;
+SET DEBUG_SYNC='RESET';
+#
+# End of 10.5 tests
+#
diff --git a/mysql-test/suite/innodb/r/autoinc_import.result b/mysql-test/suite/innodb/r/autoinc_import.result
new file mode 100644
index 00000000..4a8ddd02
--- /dev/null
+++ b/mysql-test/suite/innodb/r/autoinc_import.result
@@ -0,0 +1,232 @@
+CREATE TABLE t1 (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(42);
+CREATE TABLE t1b LIKE t1;
+INSERT INTO t1b VALUES(3);
+CREATE TABLE t1z LIKE t1;
+CREATE TABLE t1t (id TINYINT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t0t LIKE t1t;
+INSERT INTO t1t VALUES(123);
+FLUSH TABLES t1,t1b,t1t FOR EXPORT;
+UNLOCK TABLES;
+CREATE TABLE t5_7 LIKE t1;
+CREATE TABLE t5_7b LIKE t1b;
+CREATE TABLE t10_1 LIKE t1;
+CREATE TABLE t10_1b LIKE t1b;
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t1b DISCARD TABLESPACE;
+ALTER TABLE t1z DISCARD TABLESPACE;
+ALTER TABLE t1t DISCARD TABLESPACE;
+ALTER TABLE t0t DISCARD TABLESPACE;
+ALTER TABLE t5_7 DISCARD TABLESPACE;
+ALTER TABLE t5_7b DISCARD TABLESPACE;
+ALTER TABLE t10_1 DISCARD TABLESPACE;
+ALTER TABLE t10_1b DISCARD TABLESPACE;
+FLUSH TABLES;
+ALTER TABLE t0t IMPORT TABLESPACE;
+Warnings:
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t0t.cfg', will attempt to import without schema verification
+INSERT INTO t0t VALUES(NULL);
+SELECT * FROM t0t;
+id
+123
+124
+DROP TABLE t0t;
+ALTER TABLE t1 IMPORT TABLESPACE;
+Warnings:
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t1.cfg', will attempt to import without schema verification
+ALTER TABLE t1b IMPORT TABLESPACE;
+Warnings:
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t1b.cfg', will attempt to import without schema verification
+ALTER TABLE t1z IMPORT TABLESPACE;
+Warnings:
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t1z.cfg', will attempt to import without schema verification
+ALTER TABLE t1t IMPORT TABLESPACE;
+Warnings:
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t1t.cfg', will attempt to import without schema verification
+ALTER TABLE t5_7 IMPORT TABLESPACE;
+Warnings:
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t5_7.cfg', will attempt to import without schema verification
+ALTER TABLE t5_7b IMPORT TABLESPACE;
+Warnings:
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t5_7b.cfg', will attempt to import without schema verification
+ALTER TABLE t10_1 IMPORT TABLESPACE;
+Warnings:
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t10_1.cfg', will attempt to import without schema verification
+ALTER TABLE t10_1b IMPORT TABLESPACE;
+Warnings:
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t10_1b.cfg', will attempt to import without schema verification
+FOUND 1 /InnoDB: Resetting PAGE_ROOT_AUTO_INC from 128 to 123 on table `test`\.`t0t`/ in mysqld.1.err
+FOUND 1 /InnoDB: Resetting PAGE_ROOT_AUTO_INC from 0 to 42 on table `test`\.`t1z`/ in mysqld.1.err
+FOUND 1 /InnoDB: Resetting PAGE_ROOT_AUTO_INC from 128 to 123 on table `test`\.`t1t`/ in mysqld.1.err
+FOUND 1 /InnoDB: Resetting PAGE_ROOT_AUTO_INC from 3 to 42 on table `test`\.`t5_7` \(created with version 50744\)/ in mysqld.1.err
+FOUND 1 /InnoDB: Resetting PAGE_ROOT_AUTO_INC from 3 to 42 on table `test`\.`t10_1` \(created with version 100149\)/ in mysqld.1.err
+FOUND 5 /InnoDB: Resetting PAGE_ROOT_AUTO_INC/ in mysqld.1.err
+# restart: --read-only
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t1b check status OK
+test.t1t check status OK
+test.t1z check status OK
+test.t5_7 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t5_7 check status OK
+test.t5_7b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t5_7b check status OK
+test.t10_1 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t10_1 check status OK
+test.t10_1b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t10_1b check status OK
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t1b check status OK
+test.t1t check status OK
+test.t1z check status OK
+test.t5_7 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t5_7 check status OK
+test.t5_7b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t5_7b check status OK
+test.t10_1 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t10_1 check status OK
+test.t10_1b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t10_1b check status OK
+# restart: --innodb-read-only --read-only
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t1b check status OK
+test.t1t check status OK
+test.t1z check status OK
+test.t5_7 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t5_7 check status OK
+test.t5_7b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t5_7b check status OK
+test.t10_1 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t10_1 check status OK
+test.t10_1b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t10_1b check status OK
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t1b check status OK
+test.t1t check status OK
+test.t1z check status OK
+test.t5_7 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t5_7 check status OK
+test.t5_7b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t5_7b check status OK
+test.t10_1 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t10_1 check status OK
+test.t10_1b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
+test.t10_1b check status OK
+# restart: --innodb-read-only
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t1b check status OK
+test.t1t check status OK
+test.t1z check status OK
+test.t5_7 check status Operation failed
+test.t5_7b check status Operation failed
+test.t10_1 check status Operation failed
+test.t10_1b check status Operation failed
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t1b check status OK
+test.t1t check status OK
+test.t1z check status OK
+test.t5_7 check status Operation failed
+test.t5_7b check status Operation failed
+test.t10_1 check status Operation failed
+test.t10_1b check status Operation failed
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT COUNT(*) FROM t1b;
+COUNT(*)
+1
+SELECT COUNT(*) FROM t1t;
+COUNT(*)
+1
+SELECT COUNT(*) FROM t1z;
+COUNT(*)
+1
+SELECT COUNT(*) FROM t5_7;
+COUNT(*)
+1
+SELECT COUNT(*) FROM t5_7b;
+COUNT(*)
+1
+SELECT COUNT(*) FROM t10_1;
+COUNT(*)
+1
+SELECT COUNT(*) FROM t10_1b;
+COUNT(*)
+1
+# restart
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t1b check status OK
+test.t1t check status OK
+test.t1z check status OK
+test.t5_7 check note Auto_increment checked and .frm file version updated
+test.t5_7 check status OK
+test.t5_7b check note Auto_increment checked and .frm file version updated
+test.t5_7b check status OK
+test.t10_1 check note Auto_increment checked and .frm file version updated
+test.t10_1 check status OK
+test.t10_1b check note Auto_increment checked and .frm file version updated
+test.t10_1b check status OK
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1b VALUES(NULL);
+INSERT INTO t1t VALUES(NULL);
+INSERT INTO t1z VALUES(NULL);
+INSERT INTO t5_7 VALUES(NULL);
+INSERT INTO t5_7b VALUES(NULL);
+INSERT INTO t10_1 VALUES(NULL);
+INSERT INTO t10_1b VALUES(NULL);
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t1b check status OK
+test.t1t check status OK
+test.t1z check status OK
+test.t5_7 check status OK
+test.t5_7b check status OK
+test.t10_1 check status OK
+test.t10_1b check status OK
+SELECT * FROM t1;
+id
+4
+42
+SELECT * FROM t1b;
+id
+3
+347
+SELECT * FROM t1t;
+id
+123
+124
+SELECT * FROM t1z;
+id
+42
+43
+SELECT * FROM t5_7;
+id
+42
+43
+SELECT * FROM t5_7b;
+id
+3
+347
+SELECT * FROM t10_1;
+id
+42
+43
+SELECT * FROM t10_1b;
+id
+3
+347
+DROP TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
diff --git a/mysql-test/suite/innodb/r/check_ibd_filesize,32k.rdiff b/mysql-test/suite/innodb/r/check_ibd_filesize,32k.rdiff
index 44446602..ad1f3a44 100644
--- a/mysql-test/suite/innodb/r/check_ibd_filesize,32k.rdiff
+++ b/mysql-test/suite/innodb/r/check_ibd_filesize,32k.rdiff
@@ -1,5 +1,5 @@
---- mysql-test/suite/innodb/r/check_ibd_filesize.result 2022-08-16 17:28:06.462350465 +0530
-+++ mysql-test/suite/innodb/r/check_ibd_filesize.reject 2022-08-16 17:29:25.129637040 +0530
+--- mysql-test/suite/innodb/r/check_ibd_filesize.result
++++ mysql-test/suite/innodb/r/check_ibd_filesize.reject
@@ -3,18 +3,12 @@
# SPACE IN 5.7 THAN IN 5.6
#
@@ -14,7 +14,7 @@
-# bytes: 65536
+# bytes: 131072
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
--# bytes: 4194304
+-# bytes: 2097152
-DROP TABLE t1;
-CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
diff --git a/mysql-test/suite/innodb/r/check_ibd_filesize,4k.rdiff b/mysql-test/suite/innodb/r/check_ibd_filesize,4k.rdiff
index ef55ad97..1412df39 100644
--- a/mysql-test/suite/innodb/r/check_ibd_filesize,4k.rdiff
+++ b/mysql-test/suite/innodb/r/check_ibd_filesize,4k.rdiff
@@ -1,5 +1,5 @@
---- mysql-test/suite/innodb/r/check_ibd_filesize.result 2022-08-16 17:28:06.462350465 +0530
-+++ mysql-test/suite/innodb/r/check_ibd_filesize.reject 2022-08-16 17:31:39.288769153 +0530
+--- mysql-test/suite/innodb/r/check_ibd_filesize.result
++++ mysql-test/suite/innodb/r/check_ibd_filesize.reject
@@ -3,18 +3,18 @@
# SPACE IN 5.7 THAN IN 5.6
#
@@ -13,7 +13,7 @@
-# bytes: 65536
+# bytes: 16384
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
- # bytes: 4194304
+ # bytes: 2097152
DROP TABLE t1;
CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
diff --git a/mysql-test/suite/innodb/r/check_ibd_filesize,64k.rdiff b/mysql-test/suite/innodb/r/check_ibd_filesize,64k.rdiff
index bcdcea31..15692559 100644
--- a/mysql-test/suite/innodb/r/check_ibd_filesize,64k.rdiff
+++ b/mysql-test/suite/innodb/r/check_ibd_filesize,64k.rdiff
@@ -1,5 +1,5 @@
---- mysql-test/suite/innodb/r/check_ibd_filesize.result 2022-08-16 17:28:06.462350465 +0530
-+++ mysql-test/suite/innodb/r/check_ibd_filesize.reject 2022-08-16 17:30:28.957174270 +0530
+--- mysql-test/suite/innodb/r/check_ibd_filesize.result
++++ mysql-test/suite/innodb/r/check_ibd_filesize.reject
@@ -3,18 +3,12 @@
# SPACE IN 5.7 THAN IN 5.6
#
@@ -14,7 +14,7 @@
-# bytes: 65536
+# bytes: 262144
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
--# bytes: 4194304
+-# bytes: 2097152
-DROP TABLE t1;
-CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
diff --git a/mysql-test/suite/innodb/r/check_ibd_filesize,8k.rdiff b/mysql-test/suite/innodb/r/check_ibd_filesize,8k.rdiff
index 7b699ef4..55cf5973 100644
--- a/mysql-test/suite/innodb/r/check_ibd_filesize,8k.rdiff
+++ b/mysql-test/suite/innodb/r/check_ibd_filesize,8k.rdiff
@@ -1,5 +1,5 @@
---- mysql-test/suite/innodb/r/check_ibd_filesize.result 2022-08-16 17:28:06.462350465 +0530
-+++ mysql-test/suite/innodb/r/check_ibd_filesize.reject 2022-08-16 17:31:03.516962339 +0530
+--- mysql-test/suite/innodb/r/check_ibd_filesize.result
++++ mysql-test/suite/innodb/r/check_ibd_filesize.reject
@@ -3,18 +3,18 @@
# SPACE IN 5.7 THAN IN 5.6
#
@@ -13,7 +13,7 @@
-# bytes: 65536
+# bytes: 32768
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
- # bytes: 4194304
+ # bytes: 2097152
DROP TABLE t1;
CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
diff --git a/mysql-test/suite/innodb/r/check_ibd_filesize.result b/mysql-test/suite/innodb/r/check_ibd_filesize.result
index 0d224d6a..b0f37618 100644
--- a/mysql-test/suite/innodb/r/check_ibd_filesize.result
+++ b/mysql-test/suite/innodb/r/check_ibd_filesize.result
@@ -10,7 +10,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB) ENGINE=InnoDB;
# bytes: 65536
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
-# bytes: 4194304
+# bytes: 2097152
DROP TABLE t1;
CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
diff --git a/mysql-test/suite/innodb/r/cursor-restore-unique-null.result b/mysql-test/suite/innodb/r/cursor-restore-unique-null.result
new file mode 100644
index 00000000..29edc47a
--- /dev/null
+++ b/mysql-test/suite/innodb/r/cursor-restore-unique-null.result
@@ -0,0 +1,24 @@
+CREATE TABLE t(a INT PRIMARY KEY, b INT, c INT, UNIQUE KEY `b_c` (`b`,`c`))
+ENGINE=InnoDB, STATS_PERSISTENT=0;
+INSERT INTO t SET a = 1, c = 2;
+connect con1,localhost,root;
+BEGIN;
+INSERT INTO t SET a=2, c=2;
+connection default;
+BEGIN;
+SET DEBUG_SYNC="lock_wait_start SIGNAL select_locked";
+SELECT * FROM t FORCE INDEX(b) FOR UPDATE;
+connection con1;
+SET DEBUG_SYNC="now WAIT_FOR select_locked";
+ROLLBACK;
+connection default;
+# If the bug is not fixed, and the both unique index key fields are
+# NULL, there will be two (1, NULL, 2) rows in the result,
+# because cursor will be restored to (NULL, 2, 1) position for
+# secondary key instead of "supremum".
+a b c
+1 NULL 2
+COMMIT;
+SET DEBUG_SYNC="RESET";
+disconnect con1;
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result
index 808e2270..80a0afb8 100644
--- a/mysql-test/suite/innodb/r/foreign_key.result
+++ b/mysql-test/suite/innodb/r/foreign_key.result
@@ -1035,9 +1035,22 @@ BEGIN;
INSERT INTO child SET a=1;
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`a`) REFERENCES `parent` (`a`))
connection default;
+TRUNCATE TABLE parent;
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`parent` (`a`))
+DROP TABLE parent;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+SET innodb_lock_wait_timeout=0;
+RENAME TABLE parent TO transparent;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ALTER TABLE parent FORCE, ALGORITHM=COPY;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ALTER TABLE parent FORCE, ALGORITHM=INPLACE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET innodb_lock_wait_timeout=0, foreign_key_checks=0;
TRUNCATE TABLE parent;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+DROP TABLE parent;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ALTER TABLE parent FORCE, ALGORITHM=COPY;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ALTER TABLE parent FORCE, ALGORITHM=INPLACE;
@@ -1052,7 +1065,13 @@ TRUNCATE TABLE parent;
ALTER TABLE parent FORCE, ALGORITHM=COPY;
ALTER TABLE parent FORCE, ALGORITHM=INPLACE;
ALTER TABLE parent ADD COLUMN b INT, ALGORITHM=INSTANT;
-DROP TABLE child, parent;
+SET foreign_key_checks=ON;
+TRUNCATE TABLE parent;
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`parent` (`a`))
+ALTER TABLE parent FORCE, ALGORITHM=COPY;
+ALTER TABLE parent FORCE, ALGORITHM=INPLACE;
+RENAME TABLE parent TO transparent;
+DROP TABLE child, transparent;
#
# MDEV-26217 Failing assertion: list.count > 0 in ut_list_remove
# or Assertion `lock->trx == this' failed in dberr_t trx_t::drop_table
diff --git a/mysql-test/suite/innodb/r/full_crc32_import.result b/mysql-test/suite/innodb/r/full_crc32_import.result
index 548e69c1..416f607c 100644
--- a/mysql-test/suite/innodb/r/full_crc32_import.result
+++ b/mysql-test/suite/innodb/r/full_crc32_import.result
@@ -50,7 +50,15 @@ t1 CREATE TABLE `t1` (
`b` blob DEFAULT NULL,
`c` blob DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC
+) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC
+# Auto increment value must be more than maximum column value
+SELECT MAX(a) FROM t1;
+MAX(a)
+45
+SELECT auto_increment FROM information_schema.tables
+WHERE table_name like 't1';
+auto_increment
+46
UPDATE t1 set b = repeat("de", 100) where b = repeat("cd", 200);
explain SELECT a FROM t1 where b = repeat("de", 100);
id select_type table type possible_keys key key_len ref rows Extra
@@ -132,7 +140,15 @@ t1 CREATE TABLE `t1` (
`c2` point NOT NULL,
`c3` linestring NOT NULL,
PRIMARY KEY (`c1`)
-) ENGINE=InnoDB AUTO_INCREMENT=16372 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC
+) ENGINE=InnoDB AUTO_INCREMENT=14325 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC
+# Auto increment value must be more than maximum column value
+SELECT MAX(c1) FROM t1;
+MAX(c1)
+14324
+SELECT auto_increment FROM information_schema.tables
+WHERE table_name like 't1';
+auto_increment
+14325
UPDATE t1 SET C2 = ST_GeomFromText('POINT(0 0)');
SELECT COUNT(*) FROM t1;
COUNT(*)
diff --git a/mysql-test/suite/innodb/r/import_bugs.result b/mysql-test/suite/innodb/r/import_bugs.result
index 98f3e767..26845e55 100644
--- a/mysql-test/suite/innodb/r/import_bugs.result
+++ b/mysql-test/suite/innodb/r/import_bugs.result
@@ -15,6 +15,58 @@ CREATE TABLE imp_t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
DROP TABLE imp_t1, t1;
SET GLOBAL innodb_checksum_algorithm=@save_innodb_checksum_algorithm;
#
+# MDEV-33400 Adaptive hash index corruption after DISCARD TABLESPACE
+#
+SET @save_adaptive=@@GLOBAL.innodb_adaptive_hash_index;
+SET GLOBAL innodb_adaptive_hash_index=ON;
+CREATE TABLE t (a INT PRIMARY KEY) ENGINE=INNODB;
+INSERT INTO t SELECT * FROM seq_1_to_131;
+ALTER TABLE t ADD hid INT DEFAULT 2;
+INSERT INTO t VALUES (251,1);
+ALTER TABLE t DISCARD TABLESPACE;
+CHECK TABLE mysql.innodb_table_stats;
+Table Op Msg_type Msg_text
+mysql.innodb_table_stats check status OK
+DROP TABLE t;
+SET GLOBAL innodb_adaptive_hash_index=@save_adaptive;
+# End of 10.4 tests
+#
+# MDEV-18288: Transportable Tablespaces leave AUTO_INCREMENT in mismatched
+# state, causing INSERT errors in newly imported tables when .cfg is not used.
+#
+CREATE TABLE t1(
+id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id)
+) ENGINE=INNODB;
+CREATE TABLE t2 LIKE t1;
+ALTER TABLE t2 DISCARD TABLESPACE;
+INSERT INTO t1() VALUES();
+INSERT INTO t1() VALUES();
+FLUSH TABLES test.t1 FOR EXPORT;
+# Copy data file
+# Skip CFG file copy
+UNLOCK TABLES;
+DROP TABLE t1;
+ALTER TABLE t2 IMPORT TABLESPACE;
+Warnings:
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification
+SELECT * FROM t2 ORDER BY id;
+id
+1
+2
+INSERT INTO t2() VALUES();
+INSERT INTO t2() VALUES();
+INSERT INTO t2() VALUES();
+SELECT * FROM t2 ORDER BY id;
+id
+1
+2
+3
+4
+5
+DROP TABLE t2;
+# End of 10.5 tests
+#
# MDEV-27006 Assertion `!lock_trx_has_sys_table_locks(trx)'
# failed in dberr_t row_discard_tablespace_for_mysql
# (dict_table_t*, trx_t*)
diff --git a/mysql-test/suite/innodb/r/import_hidden_fts.result b/mysql-test/suite/innodb/r/import_hidden_fts.result
new file mode 100644
index 00000000..69120898
--- /dev/null
+++ b/mysql-test/suite/innodb/r/import_hidden_fts.result
@@ -0,0 +1,45 @@
+call mtr.add_suppression("InnoDB: Added system generated FTS_DOC_ID and FTS_DOC_ID_INDEX while importing the tablespace");
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+f2 CHAR(2) not null, fulltext f_idx(f2),
+f3 INT as (f1) VIRTUAL, INDEX(f3),
+f4 INT as (f1) STORED, INDEX(f4),
+f5 INT as (f1) VIRTUAL)ENGINE=InnoDB;
+INSERT INTO t1(f1, f2) VALUES(1, "on");
+INSERT INTO t1(f1, f2) SELECT seq, "si" FROM seq_2_to_256;
+ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL;
+ALTER TABLE t1 DROP COLUMN f6;
+ALTER TABLE t1 DROP INDEX f_idx;
+connect con1,localhost,root,,;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection default;
+DELETE FROM t1 WHERE f1 > 1;
+FLUSH TABLE t1 FOR EXPORT;
+Warnings:
+Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
+Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
+backup: t1
+UNLOCK TABLES;
+Warnings:
+Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+f2 CHAR(2) not null,
+f3 INT as (f1) VIRTUAL, INDEX(f3),
+f4 INT as (f1) STORED, INDEX(f4),
+f5 INT as (f1) VIRTUAL)ENGINE=InnoDB;
+ALTER TABLE t1 DISCARD TABLESPACE;
+restore: t1 .ibd and .cfg files
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` char(2) NOT NULL,
+ `f3` int(11) GENERATED ALWAYS AS (`f1`) VIRTUAL,
+ `f4` int(11) GENERATED ALWAYS AS (`f1`) STORED,
+ `f5` int(11) GENERATED ALWAYS AS (`f1`) VIRTUAL,
+ PRIMARY KEY (`f1`),
+ KEY `f3` (`f3`),
+ KEY `f4` (`f4`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/import_hidden_fts_debug.result b/mysql-test/suite/innodb/r/import_hidden_fts_debug.result
new file mode 100644
index 00000000..2cf1746e
--- /dev/null
+++ b/mysql-test/suite/innodb/r/import_hidden_fts_debug.result
@@ -0,0 +1,76 @@
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+f2 CHAR(2) NOT NULL, FULLTEXT f_idx(f2),
+f3 INT as (f1) VIRTUAL, INDEX(f3))ENGINE=InnoDB;
+INSERT INTO t1(f1, f2) VALUES(1, "on");
+ALTER TABLE t1 DROP INDEX f_idx;
+FLUSH TABLE t1 FOR EXPORT;
+Warnings:
+Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
+Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
+backup: t1
+UNLOCK TABLES;
+Warnings:
+Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+f2 CHAR(2) NOT NULL,
+f3 CHAR(2) NOT NULL,
+f4 INT AS (f1) VIRTUAL, INDEX(f4))ENGINE=InnoDB;
+ALTER TABLE t1 DISCARD TABLESPACE;
+restore: t1 .ibd and .cfg files
+ALTER TABLE t1 IMPORT TABLESPACE;
+ERROR HY000: Schema mismatch (Number of indexes don't match, table has 2 indexes but the tablespace meta-data file has 3 indexes)
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+f2 CHAR(2) NOT NULL,
+f3 INT as (f1) VIRTUAL, INDEX(f3))ENGINE=InnoDB;
+ALTER TABLE t1 DISCARD TABLESPACE;
+restore: t1 .ibd and .cfg files
+SET DEBUG_DBUG="+d,ib_import_set_index_root_failure";
+ALTER TABLE t1 IMPORT TABLESPACE;
+ERROR HY000: Too many active concurrent transactions
+SET DEBUG_DBUG="-d,ib_import_set_index_root_failure";
+SET DEBUG_DBUG="+d,ib_import_vcol_update_fail";
+ALTER TABLE t1 IMPORT TABLESPACE;
+ERROR 23000: Can't write; duplicate key in table 't1'
+SET DEBUG_DBUG="-d,ib_import_vcol_update_fail";
+restore: t1 .ibd and .cfg files
+SET DEBUG_DBUG="+d,ib_import_fts_error";
+ALTER TABLE t1 IMPORT TABLESPACE;
+ERROR 23000: Can't write; duplicate key in table 't1'
+SET DEBUG_DBUG="-d,ib_import_fts_error";
+unlink: t1.ibd
+unlink: t1.cfg
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS
+WHERE table_id IN (SELECT table_id FROM information_schema.innodb_sys_tables where name="test/t1");
+NAME
+f1
+f2
+f3
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` char(2) NOT NULL,
+ `f3` int(11) GENERATED ALWAYS AS (`f1`) VIRTUAL,
+ PRIMARY KEY (`f1`),
+ KEY `f3` (`f3`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+FTS_DOC_ID BIGINT SIGNED NOT NULL,
+f2 CHAR(2) NOT NULL,
+FULLTEXT f_idx(f2))ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, 1, "on");
+ALTER TABLE t1 DROP INDEX f_idx;
+FLUSH TABLE t1 FOR EXPORT;
+backup: t1
+UNLOCK TABLES;
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+f2 CHAR(2) NOT NULL)ENGINE=InnoDB;
+ALTER TABLE t1 DISCARD TABLESPACE;
+restore: t1 .ibd and .cfg files
+ALTER TABLE t1 IMPORT TABLESPACE;
+ERROR HY000: Schema mismatch (Column f2 ordinal value mismatch, it's at 1 in the table and 2 in the tablespace meta-data file)
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/index_length.result b/mysql-test/suite/innodb/r/index_length.result
index cc92780a..e0d6a735 100644
--- a/mysql-test/suite/innodb/r/index_length.result
+++ b/mysql-test/suite/innodb/r/index_length.result
@@ -20,4 +20,12 @@ FLOOR(index_length/@@innodb_page_size)
2
disconnect stop_purge;
DROP TABLE t1;
+#
+# MDEV-22855 Assertion (!field->prefix_len ||
+# field->fixed_len == field->prefix_len)
+# failed in btr_node_ptr_max_size
+#
+CREATE TABLE t1(c CHAR(194) CHARACTER SET UTF32, KEY k1(c(193)))ENGINE=InnoDB;
+INSERT INTO t1 SET c='';
+DROP TABLE t1;
# End of 10.4 tests
diff --git a/mysql-test/suite/innodb/r/innodb-alter-debug.result b/mysql-test/suite/innodb/r/innodb-alter-debug.result
index c55b4a3d..fd33581f 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-debug.result
@@ -108,11 +108,11 @@ DROP TABLE t;
# MDEV-26772 InnoDB DDL fails with DUPLICATE KEY error
#
create table t1(f1 int not null primary key,
-f2 int not null, index idx(f2))engine=innodb;
+f2 int not null, index idx(f2), index i(f2,f1))engine=innodb;
insert into t1 values(1, 1);
connect con1,localhost,root,,,;
SET DEBUG_SYNC='before_delete_table_stats SIGNAL blocked WAIT_FOR go';
-SET innodb_lock_wait_timeout=0;
+SET STATEMENT innodb_lock_wait_timeout=0 FOR
ALTER TABLE t1 FORCE, ALGORITHM=COPY;
connection default;
SET DEBUG_SYNC='now WAIT_FOR blocked';
@@ -124,6 +124,17 @@ connection con1;
connection default;
COMMIT;
SET DEBUG_SYNC=RESET;
+RENAME TABLE mysql.innodb_table_stats TO mysql.innodb_table_stats_hidden;
+connection con1;
+SET DEBUG_SYNC='innodb_commit_inplace_before_lock SIGNAL blocked WAIT_FOR go';
+ALTER TABLE t1 DROP INDEX i;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR blocked';
+RENAME TABLE mysql.innodb_table_stats_hidden TO mysql.innodb_table_stats;
+SET DEBUG_SYNC='now SIGNAL go';
+connection con1;
+connection default;
+SET DEBUG_SYNC=RESET;
connection con1;
ALTER TABLE t1 RENAME KEY idx TO idx1, ALGORITHM=COPY;
disconnect con1;
diff --git a/mysql-test/suite/innodb/r/innodb-lru-force-no-free-page.result b/mysql-test/suite/innodb/r/innodb-lru-force-no-free-page.result
deleted file mode 100644
index 09e53b59..00000000
--- a/mysql-test/suite/innodb/r/innodb-lru-force-no-free-page.result
+++ /dev/null
@@ -1,10 +0,0 @@
-call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
-SET @saved_debug = @@SESSION.debug_dbug;
-SET SESSION debug_dbug="+d,ib_lru_force_no_free_page";
-CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB;
-BEGIN;
-INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
-COMMIT;
-SET debug_dbug = @saved_debug;
-DROP TABLE t1;
-FOUND 1 /InnoDB: Difficult to find free blocks / in mysqld.1.err
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522,crc32.rdiff b/mysql-test/suite/innodb/r/innodb-wl5522,crc32.rdiff
deleted file mode 100644
index bb902e18..00000000
--- a/mysql-test/suite/innodb/r/innodb-wl5522,crc32.rdiff
+++ /dev/null
@@ -1,5 +0,0 @@
-120,121c120
-< Warnings:
-< Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification
----
-> ERROR HY000: Schema mismatch (Expected FSP_SPACE_FLAGS=0x*, .ibd file contains 0x*.)
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522,strict_crc32.rdiff b/mysql-test/suite/innodb/r/innodb-wl5522,strict_crc32.rdiff
index bb902e18..283bbe96 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522,strict_crc32.rdiff
+++ b/mysql-test/suite/innodb/r/innodb-wl5522,strict_crc32.rdiff
@@ -1,5 +1,12 @@
-120,121c120
-< Warnings:
-< Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification
----
-> ERROR HY000: Schema mismatch (Expected FSP_SPACE_FLAGS=0x*, .ibd file contains 0x*.)
+--- innodb-wl5522.result
++++ innodb-wl5522,strict_crc32.result~
+@@ -131,8 +131,7 @@
+ ALTER TABLE t2 IMPORT TABLESPACE;
+ ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1; .cfg file uses ROW_FORMAT=COMPACT)
+ ALTER TABLE t2 IMPORT TABLESPACE;
+-Warnings:
+-Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification
++ERROR HY000: Schema mismatch (Expected FSP_SPACE_FLAGS=0x*, .ibd file contains 0x*.)
+ DROP TABLE t2;
+ SET GLOBAL innodb_file_per_table = 1;
+ SELECT @@innodb_file_per_table;
diff --git a/mysql-test/suite/innodb/r/innodb_bug30113362.result b/mysql-test/suite/innodb/r/innodb_bug30113362.result
index cb0f5091..5d30c5c0 100644
--- a/mysql-test/suite/innodb/r/innodb_bug30113362.result
+++ b/mysql-test/suite/innodb/r/innodb_bug30113362.result
@@ -37,7 +37,7 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
CLUST_INDEX_SIZE
-1856
+1792
connection con2;
DELETE FROM t1 WHERE a00 = 'cnm';
COMMIT;
@@ -80,7 +80,7 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
CLUST_INDEX_SIZE
-1856
+1792
DELETE FROM t1 WHERE a00 = 'dpn';
COMMIT;
INSERT INTO t1 SET a00 = 'dpn';
@@ -117,6 +117,6 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
CLUST_INDEX_SIZE
-1856
+1792
SET DEBUG_SYNC = 'RESET';
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result
index d142c0e4..9d8ead7a 100644
--- a/mysql-test/suite/innodb/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result
@@ -431,10 +431,6 @@ a
connection con1;
begin work;
insert into t1 values (5);
-select * from t1;
-a
-1
-5
insert into t1 values (2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1;
@@ -509,10 +505,6 @@ a
connection con1;
begin work;
insert into t1 values (5);
-select * from t1;
-a
-1
-5
insert into t1 values (2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1;
@@ -1217,10 +1209,6 @@ a
connection con1;
begin work;
insert into t1 values (5);
-select * from t1;
-a
-1
-5
insert into t1 values (2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1;
diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
index 832a4800..94e40ee5 100644
--- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
+++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
@@ -86,7 +86,6 @@ buffer_flush_n_to_flush_by_age buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NUL
buffer_flush_adaptive_avg_time buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Avg time (ms) spent for adaptive flushing recently.
buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of adaptive flushes passed during the recent Avg period.
buffer_LRU_get_free_loops buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Total loops in LRU get free.
-buffer_LRU_get_free_waits buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Total sleep waits in LRU get free.
buffer_flush_avg_page_rate buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Average number of pages at which flushing is happening
buffer_flush_lsn_avg_rate buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Average redo generation rate
buffer_flush_pct_for_dirty buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Percent of IO capacity used to avoid max dirty page limit
@@ -106,7 +105,6 @@ buffer_LRU_batch_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NUL
buffer_LRU_batch_scanned_per_call buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Pages scanned per LRU batch call
buffer_LRU_batch_flush_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Total pages flushed as part of LRU batches
buffer_LRU_batch_evict_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Total pages evicted as part of LRU batches
-buffer_LRU_single_flush_failure_count Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of times attempt to flush a single page from LRU failed
buffer_LRU_get_free_search Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of searches performed for a clean page
buffer_LRU_search_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages scanned as part of LRU search
buffer_LRU_search_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Number of times LRU search is performed
diff --git a/mysql-test/suite/innodb/r/innodb_stats_fetch.result b/mysql-test/suite/innodb/r/innodb_stats_fetch.result
index df6bc4b0..cb205b18 100644
--- a/mysql-test/suite/innodb/r/innodb_stats_fetch.result
+++ b/mysql-test/suite/innodb/r/innodb_stats_fetch.result
@@ -174,3 +174,10 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_VIRTUAL LIMIT ROWS EXAMINED 5;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN LIMIT ROWS EXAMINED 5;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS LIMIT ROWS EXAMINED 5;
DROP TABLE t1;
+#
+# MDEV-33462 Disallow LOCK=NONE operation on statistics table
+#
+ALTER TABLE mysql.innodb_table_stats FORCE, LOCK=NONE;
+ERROR 0A000: LOCK=NONE is not supported. Reason: innodb_table_stats. Try LOCK=SHARED
+ALTER TABLE mysql.innodb_index_stats FORCE, LOCK=NONE;
+ERROR 0A000: LOCK=NONE is not supported. Reason: innodb_index_stats. Try LOCK=SHARED
diff --git a/mysql-test/suite/innodb/r/innodb_timeout_rollback.result b/mysql-test/suite/innodb/r/innodb_timeout_rollback.result
index 30db5a21..5f99ad75 100644
--- a/mysql-test/suite/innodb/r/innodb_timeout_rollback.result
+++ b/mysql-test/suite/innodb/r/innodb_timeout_rollback.result
@@ -17,10 +17,6 @@ a
connection con1;
begin work;
insert into t1 values (5);
-select * from t1;
-a
-1
-5
insert into t1 values (2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1;
@@ -41,4 +37,4 @@ a
drop table t1;
disconnect con1;
disconnect con2;
-End of 5.0 tests
+# End of 5.0 tests
diff --git a/mysql-test/suite/innodb/r/innodb_ut_format_name.result b/mysql-test/suite/innodb/r/innodb_ut_format_name.result
deleted file mode 100644
index 41a5b0f7..00000000
--- a/mysql-test/suite/innodb/r/innodb_ut_format_name.result
+++ /dev/null
@@ -1,5 +0,0 @@
-CREATE TABLE t (c INT) ENGINE=INNODB;
-SET @save_dbug = @@debug_dbug;
-SET debug_dbug = '+d,test_ut_format_name';
-DROP TABLE t;
-SET debug_dbug = @save_dbug;
diff --git a/mysql-test/suite/innodb/r/insert_into_empty,4k.rdiff b/mysql-test/suite/innodb/r/insert_into_empty,4k.rdiff
index baa017ec..ad3d03a7 100644
--- a/mysql-test/suite/innodb/r/insert_into_empty,4k.rdiff
+++ b/mysql-test/suite/innodb/r/insert_into_empty,4k.rdiff
@@ -1,2 +1,10 @@
-423a424
-> ERROR 42000: Row size too large (> 1982). 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.
+--- a/mysql-test/suite/innodb/r/insert_into_empty.result
++++ b/mysql-test/suite/innodb/r/insert_into_empty.result
+@@ -430,6 +430,7 @@
+ 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));
++ERROR 42000: Row size too large (> 1982). 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.
+ CHECK TABLE t1;
+ Table Op Msg_type Msg_text
+ test.t1 check status OK
diff --git a/mysql-test/suite/innodb/r/insert_into_empty.result b/mysql-test/suite/innodb/r/insert_into_empty.result
index 0cdee172..78d93494 100644
--- a/mysql-test/suite/innodb/r/insert_into_empty.result
+++ b/mysql-test/suite/innodb/r/insert_into_empty.result
@@ -251,6 +251,15 @@ c1
1984
3331
DROP TABLE t1;
+#
+# MDEV-33979 Disallow bulk insert operation during
+# partition update statement
+#
+CREATE TABLE t1(a INT KEY)ENGINE=InnoDB
+PARTITION BY KEY(a) PARTITIONS 16;
+INSERT INTO t1 VALUES(1);
+UPDATE t1 SET a = 2 WHERE a = 1;
+DROP TABLE t1;
# End of 10.6 tests
#
# MDEV-26947 UNIQUE column checks fail in InnoDB resulting
@@ -467,3 +476,47 @@ DROP TABLE t1;
CREATE TABLE t (a CHAR CHARACTER SET utf8) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
INSERT t SELECT left(seq,1) FROM seq_1_to_43691;
DROP TABLE t;
+#
+# MDEV-32453 Bulk insert fails to apply when trigger
+# does insert operation
+#
+CREATE TABLE t(c INT)ENGINE=InnoDB;
+CREATE TRIGGER t2_ai AFTER INSERT ON t FOR EACH ROW SET @a:=(SELECT * FROM t);
+BEGIN;
+INSERT INTO t VALUES (1),(1);
+ERROR 21000: Subquery returns more than 1 row
+COMMIT;
+DROP TABLE t;
+#
+# MDEV-33868 Assertion `trx->bulk_insert' failed in
+# innodb_prepare_commit_versioned
+#
+CREATE TABLE t (id INT) ENGINE=InnoDB;
+select 1 into outfile "VARDIR/tmp/t.outfile";
+BEGIN;
+LOAD DATA INFILE 'VARDIR/tmp/t.outfile' INTO TABLE t;
+COMMIT;
+DROP TABLE t;
+#
+# MDEV-33934 Assertion `!check_foreigns' failed in
+# trx_t::bulk_insert_apply_for_table(dict_table_t*)
+#
+CREATE TABLE t1(f1 INT,f2 INT,KEY(f1))engine=innodb;
+BEGIN;
+INSERT INTO t1 VALUES();
+SET STATEMENT FOREIGN_KEY_CHECKS=1 FOR SELECT * FROM t1;
+f1 f2
+NULL NULL
+COMMIT;
+DROP TABLE t1;
+#
+# MDEV-33970 Assertion `!m.first->second.is_bulk_insert()'
+# failed in trx_undo_report_row_operation()
+#
+CREATE TABLE t1(c1 INT,c2 CHAR) ENGINE=INNODB PARTITION BY KEY(c1) PARTITIONS 2;
+begin;
+INSERT INTO t1 VALUES(2,0);
+DELETE FROM t1;
+commit;
+DROP TABLE t1;
+# End of 10.11 tests
diff --git a/mysql-test/suite/innodb/r/instant_alter_crash.result b/mysql-test/suite/innodb/r/instant_alter_crash.result
index e423afe1..565f7e4b 100644
--- a/mysql-test/suite/innodb/r/instant_alter_crash.result
+++ b/mysql-test/suite/innodb/r/instant_alter_crash.result
@@ -202,27 +202,3 @@ Table Op Msg_type Msg_text
test.t2 check status OK
DROP TABLE t1,t2;
db.opt
-#
-# MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
-# ADD PRIMARY KEY or OPTIMIZE TABLE
-#
-CREATE TABLE t1(f1 year default null, f2 year default null,
-f3 text, f4 year default null, f5 year default null,
-f6 year default null, f7 year default null,
-f8 year default null)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
-INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
-ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
-set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
-ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ADD COLUMN f10 YEAR DEFAULT NULL, ALGORITHM=INPLACE;
-connect con1,localhost,root,,,;
-SET DEBUG_SYNC="now WAIT_FOR con1_insert";
-INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
-INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
-SET DEBUG_SYNC="now SIGNAL con1_finish";
-connection default;
-disconnect con1;
-SET DEBUG_SYNC=RESET;
-CHECK TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/instant_alter_debug,redundant.rdiff b/mysql-test/suite/innodb/r/instant_alter_debug,redundant.rdiff
index f442e406..cf72c37b 100644
--- a/mysql-test/suite/innodb/r/instant_alter_debug,redundant.rdiff
+++ b/mysql-test/suite/innodb/r/instant_alter_debug,redundant.rdiff
@@ -2,7 +2,7 @@
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
--35
-+36
+-37
++38
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
# End of 10.6 tests
diff --git a/mysql-test/suite/innodb/r/instant_alter_debug.result b/mysql-test/suite/innodb/r/instant_alter_debug.result
index d6d49047..733a85aa 100644
--- a/mysql-test/suite/innodb/r/instant_alter_debug.result
+++ b/mysql-test/suite/innodb/r/instant_alter_debug.result
@@ -477,10 +477,59 @@ SET DEBUG_SYNC="now WAIT_FOR try_insert";
INSERT INTO t1 VALUES(1, 2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC="now SIGNAL alter_progress";
-disconnect con1;
connection default;
DROP TABLE t1;
+#
+# MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
+# ADD PRIMARY KEY or OPTIMIZE TABLE
+#
+CREATE TABLE t1(f1 year default null, f2 year default null,
+f3 text, f4 year default null, f5 year default null,
+f6 year default null, f7 year default null,
+f8 year default null)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
+ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
+set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
+ALTER TABLE t1 ADD COLUMN f10 YEAR DEFAULT NULL, FORCE, ALGORITHM=INPLACE;
+connection con1;
+SET DEBUG_SYNC="now WAIT_FOR con1_insert";
+INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
+INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
+SET DEBUG_SYNC="now SIGNAL con1_finish";
+connection default;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+#
+# MDEV-19044 Alter table corrupts while applying the
+# modification log
+#
+CREATE TABLE t1 (
+f1 INT,
+f2 INT,
+f3 char(19) CHARACTER SET utf8mb3,
+f4 VARCHAR(500),
+f5 TEXT)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(3, 1, REPEAT('a', 2), REPEAT("b", 20),'a');
+ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL, ALGORITHM=INSTANT;
+INSERT INTO t1 VALUES(1, 2, REPEAT('InnoDB', 2),
+REPEAT("MariaDB", 20), REPEAT('a', 8000), 12);
+INSERT INTO t1 VALUES(1, 2, REPEAT('MYSQL', 2),
+REPEAT("MariaDB", 20), REPEAT('a', 8000), 12);
+SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL con1_begin WAIT_FOR con1_update';
+ALTER TABLE t1 MODIFY COLUMN f2 INT NOT NULL, FORCE, ALGORITHM=INPLACE;
+connection con1;
+SET DEBUG_SYNC='now WAIT_FOR con1_begin';
+UPDATE t1 SET f2=204 order by f1 limit 2;
+SET DEBUG_SYNC='now SIGNAL con1_update';
+connection default;
+disconnect con1;
SET DEBUG_SYNC=reset;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
# End of 10.4 tests
#
# MDEV-22867 Assertion instant.n_core_fields == n_core_fields
@@ -525,6 +574,6 @@ SELECT variable_value-@old_instant instants
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
-35
+37
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
# End of 10.6 tests
diff --git a/mysql-test/suite/innodb/r/instant_alter_extend.result b/mysql-test/suite/innodb/r/instant_alter_extend.result
index 33a5f57c..c22043ec 100644
--- a/mysql-test/suite/innodb/r/instant_alter_extend.result
+++ b/mysql-test/suite/innodb/r/instant_alter_extend.result
Binary files differ
diff --git a/mysql-test/suite/innodb/r/instant_alter_import.result b/mysql-test/suite/innodb/r/instant_alter_import.result
index 3e7ee35f..6fe48fb6 100644
--- a/mysql-test/suite/innodb/r/instant_alter_import.result
+++ b/mysql-test/suite/innodb/r/instant_alter_import.result
@@ -64,6 +64,7 @@ alter table t1 discard tablespace;
flush tables t2 for export;
unlock tables;
alter table t1 import tablespace;
+# restart
select * from t1;
z
42
diff --git a/mysql-test/suite/innodb/r/lock_insert_into_empty.result b/mysql-test/suite/innodb/r/lock_insert_into_empty.result
index c1dea2fc..97369b58 100644
--- a/mysql-test/suite/innodb/r/lock_insert_into_empty.result
+++ b/mysql-test/suite/innodb/r/lock_insert_into_empty.result
@@ -47,6 +47,9 @@ CREATE TABLE t1 (k INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 SET k=1;
START TRANSACTION;
INSERT INTO t1 SET k=2;
+SELECT count(*) > 0 FROM mysql.innodb_index_stats lock in share mode;
+count(*) > 0
+1
connect con1,localhost,root,,test;
SET innodb_lock_wait_timeout=0;
CREATE TABLE t2 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB
@@ -54,4 +57,6 @@ AS SELECT k FROM t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
disconnect con1;
connection default;
+SET innodb_lock_wait_timeout=default;
DROP TABLE t1;
+DROP TABLE IF EXISTS t2;
diff --git a/mysql-test/suite/innodb/r/lock_isolation.result b/mysql-test/suite/innodb/r/lock_isolation.result
new file mode 100644
index 00000000..31843266
--- /dev/null
+++ b/mysql-test/suite/innodb/r/lock_isolation.result
@@ -0,0 +1,136 @@
+#
+# MDEV-26642 Weird SELECT view when a record is
+# modified to the same value by two transactions
+# MDEV-32898 Phantom rows caused by updates of PRIMARY KEY
+#
+CREATE TABLE t(a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+INSERT INTO t VALUES (1,1),(2,2);
+BEGIN;
+SELECT * FROM t LOCK IN SHARE MODE;
+a b
+1 1
+2 2
+connect con_weird,localhost,root;
+BEGIN;
+SELECT * FROM t;
+a b
+1 1
+2 2
+connect consistent,localhost,root;
+SET innodb_snapshot_isolation=ON;
+BEGIN;
+SELECT * FROM t;
+a b
+1 1
+2 2
+connection default;
+UPDATE t SET a=3 WHERE b=2;
+COMMIT;
+connection consistent;
+UPDATE t SET b=3;
+ERROR HY000: Record has changed since last read in table 't'
+SELECT * FROM t;
+a b
+1 1
+3 2
+COMMIT;
+connection con_weird;
+UPDATE t SET b=3;
+SELECT * FROM t;
+a b
+1 3
+2 2
+3 3
+COMMIT;
+connection default;
+SELECT * FROM t;
+a b
+1 3
+3 3
+DROP TABLE t;
+#
+# MDEV-26643 Inconsistent behaviors of UPDATE under
+# READ UNCOMMITTED and READ COMMITTED isolation level
+#
+CREATE TABLE t(a INT, b INT) ENGINE=InnoDB;
+INSERT INTO t VALUES(NULL, 1), (2, 2);
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+BEGIN;
+UPDATE t SET a = 10;
+connection consistent;
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+UPDATE t SET b = 20 WHERE a;
+connection default;
+COMMIT;
+connection consistent;
+SELECT * FROM t;
+a b
+10 20
+10 20
+connection default;
+TRUNCATE TABLE t;
+INSERT INTO t VALUES(NULL, 1), (2, 2);
+BEGIN;
+UPDATE t SET a = 10;
+connection consistent;
+SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+UPDATE t SET b = 20 WHERE a;
+connection default;
+COMMIT;
+connection consistent;
+SELECT * FROM t;
+a b
+10 20
+10 20
+connection default;
+TRUNCATE TABLE t;
+INSERT INTO t VALUES(NULL, 1), (2, 2);
+BEGIN;
+UPDATE t SET a = 10;
+connection con_weird;
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+UPDATE t SET b = 20 WHERE a;
+connection default;
+SELECT * FROM t;
+a b
+10 1
+10 2
+COMMIT;
+connection con_weird;
+COMMIT;
+connection default;
+SELECT * FROM t;
+a b
+10 1
+10 20
+DROP TABLE t;
+#
+# MDEV-33802 Weird read view after ROLLBACK of other transactions
+#
+CREATE TABLE t(a INT PRIMARY KEY, b INT UNIQUE) ENGINE=InnoDB;
+INSERT INTO t SET a=1;
+BEGIN;
+INSERT INTO t SET a=2;
+connection consistent;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
+ERROR HY000: Record has changed since last read in table 't'
+connection con_weird;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
+connection default;
+ROLLBACK;
+connection con_weird;
+a b
+1 NULL
+SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
+a b
+1 NULL
+disconnect con_weird;
+connection consistent;
+SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
+a b
+1 NULL
+disconnect consistent;
+connection default;
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb/r/log_upgrade_101_flags.result b/mysql-test/suite/innodb/r/log_upgrade_101_flags.result
new file mode 100644
index 00000000..6ae7c848
--- /dev/null
+++ b/mysql-test/suite/innodb/r/log_upgrade_101_flags.result
@@ -0,0 +1,12 @@
+call mtr.add_suppression("InnoDB: The change buffer is corrupted");
+call mtr.add_suppression("InnoDB: Tablespace size stored in header is 768 pages, but the sum of data file sizes is 384 pages");
+call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of file");
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-force-recovery=5 --innodb-log-file-size=4m --innodb_page_size=32k --innodb_buffer_pool_size=10M
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+COUNT(*)
+1
+FOUND 1 /InnoDB: Upgrading redo log:/ in mysqld.1.err
+# restart
+# End of 10.5 tests
diff --git a/mysql-test/suite/innodb/r/max_record_size,16k,compact,innodb.rdiff b/mysql-test/suite/innodb/r/max_record_size,16k,compact.rdiff
index 118145be..118145be 100644
--- a/mysql-test/suite/innodb/r/max_record_size,16k,compact,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,16k,compact.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,16k,dynamic,innodb.rdiff b/mysql-test/suite/innodb/r/max_record_size,16k,dynamic.rdiff
index 33067866..33067866 100644
--- a/mysql-test/suite/innodb/r/max_record_size,16k,dynamic,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,16k,dynamic.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,16k,innodb,redundant.rdiff b/mysql-test/suite/innodb/r/max_record_size,16k,redundant.rdiff
index e50e4d2b..e50e4d2b 100644
--- a/mysql-test/suite/innodb/r/max_record_size,16k,innodb,redundant.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,16k,redundant.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,32k,compact,innodb.rdiff b/mysql-test/suite/innodb/r/max_record_size,32k,compact.rdiff
index 1bc03a5d..1bc03a5d 100644
--- a/mysql-test/suite/innodb/r/max_record_size,32k,compact,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,32k,compact.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,32k,dynamic,innodb.rdiff b/mysql-test/suite/innodb/r/max_record_size,32k,dynamic.rdiff
index 71c4c2e4..71c4c2e4 100644
--- a/mysql-test/suite/innodb/r/max_record_size,32k,dynamic,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,32k,dynamic.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,32k,innodb,redundant.rdiff b/mysql-test/suite/innodb/r/max_record_size,32k,redundant.rdiff
index e42b3de8..e42b3de8 100644
--- a/mysql-test/suite/innodb/r/max_record_size,32k,innodb,redundant.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,32k,redundant.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,4k,compact,innodb.rdiff b/mysql-test/suite/innodb/r/max_record_size,4k,compact.rdiff
index 6f08dab3..6f08dab3 100644
--- a/mysql-test/suite/innodb/r/max_record_size,4k,compact,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,4k,compact.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,4k,dynamic,innodb.rdiff b/mysql-test/suite/innodb/r/max_record_size,4k,dynamic.rdiff
index bd37d435..bd37d435 100644
--- a/mysql-test/suite/innodb/r/max_record_size,4k,dynamic,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,4k,dynamic.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,4k,innodb,redundant.rdiff b/mysql-test/suite/innodb/r/max_record_size,4k,redundant.rdiff
index 93c39ff6..93c39ff6 100644
--- a/mysql-test/suite/innodb/r/max_record_size,4k,innodb,redundant.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,4k,redundant.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,64k,compact,innodb.rdiff b/mysql-test/suite/innodb/r/max_record_size,64k,compact.rdiff
index 5e6c6221..5e6c6221 100644
--- a/mysql-test/suite/innodb/r/max_record_size,64k,compact,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,64k,compact.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,64k,dynamic,innodb.rdiff b/mysql-test/suite/innodb/r/max_record_size,64k,dynamic.rdiff
index 2cbf4cd9..2cbf4cd9 100644
--- a/mysql-test/suite/innodb/r/max_record_size,64k,dynamic,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,64k,dynamic.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,64k,innodb,redundant.rdiff b/mysql-test/suite/innodb/r/max_record_size,64k,redundant.rdiff
index c324969f..c324969f 100644
--- a/mysql-test/suite/innodb/r/max_record_size,64k,innodb,redundant.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,64k,redundant.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,8k,compact,innodb.rdiff b/mysql-test/suite/innodb/r/max_record_size,8k,compact.rdiff
index 4db669a8..4db669a8 100644
--- a/mysql-test/suite/innodb/r/max_record_size,8k,compact,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,8k,compact.rdiff
diff --git a/mysql-test/suite/innodb/r/max_record_size,8k,dynamic,innodb.rdiff b/mysql-test/suite/innodb/r/max_record_size,8k,dynamic.rdiff
index 5f79d77e..5f79d77e 100644
--- a/mysql-test/suite/innodb/r/max_record_size,8k,dynamic,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,8k,dynamic.rdiff
diff --git a/mysql-test/suite/innodb/r/monitor.result b/mysql-test/suite/innodb/r/monitor.result
index d99dd69e..1834032e 100644
--- a/mysql-test/suite/innodb/r/monitor.result
+++ b/mysql-test/suite/innodb/r/monitor.result
@@ -51,7 +51,6 @@ buffer_flush_n_to_flush_by_age disabled
buffer_flush_adaptive_avg_time disabled
buffer_flush_adaptive_avg_pass disabled
buffer_LRU_get_free_loops disabled
-buffer_LRU_get_free_waits disabled
buffer_flush_avg_page_rate disabled
buffer_flush_lsn_avg_rate disabled
buffer_flush_pct_for_dirty disabled
@@ -71,7 +70,6 @@ buffer_LRU_batch_num_scan disabled
buffer_LRU_batch_scanned_per_call disabled
buffer_LRU_batch_flush_total_pages enabled
buffer_LRU_batch_evict_total_pages enabled
-buffer_LRU_single_flush_failure_count disabled
buffer_LRU_get_free_search disabled
buffer_LRU_search_scanned disabled
buffer_LRU_search_num_scan disabled
@@ -198,6 +196,7 @@ icp_attempts disabled
icp_no_match disabled
icp_out_of_range disabled
icp_match disabled
+create temporary table orig_innodb_metrics as select name, enabled from information_schema.innodb_metrics;
set global innodb_monitor_disable = All;
select name from information_schema.innodb_metrics where enabled;
name
@@ -431,7 +430,7 @@ set global innodb_monitor_reset_all = default;
# MONITORS
#
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
-SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+SELECT /*1*/ NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
NAME COUNT > 0
buffer_page_written_index_leaf 0
@@ -439,13 +438,13 @@ SET GLOBAL innodb_monitor_enable='module_buffer_page';
INSERT INTO t1 VALUES (1), (2), (3), (4);
FLUSH TABLES t1 FOR EXPORT;
UNLOCK TABLES;
-SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+SELECT /*2*/ NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
NAME COUNT > 0
buffer_page_written_index_leaf 1
SET GLOBAL innodb_monitor_disable='module_buffer_page';
SET GLOBAL innodb_monitor_reset_all='module_buffer_page';
-SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+SELECT /*3*/ NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
NAME COUNT > 0
buffer_page_written_index_leaf 0
@@ -455,13 +454,13 @@ ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value o
INSERT INTO t1 VALUES (5), (6), (7), (8);
FLUSH TABLES t1 FOR EXPORT;
UNLOCK TABLES;
-SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+SELECT /*4*/ NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
NAME COUNT > 0
buffer_page_written_index_leaf 1
SET GLOBAL innodb_monitor_disable='%';
SET GLOBAL innodb_monitor_reset_all='%';
-SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+SELECT /*5*/ NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
NAME COUNT > 0
buffer_page_written_index_leaf 0
@@ -469,7 +468,7 @@ SET GLOBAL innodb_monitor_enable='ALL';
INSERT INTO t1 VALUES (9), (10), (11), (12);
FLUSH TABLES t1 FOR EXPORT;
UNLOCK TABLES;
-SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+SELECT /*6*/ NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
NAME COUNT > 0
buffer_page_written_index_leaf 1
@@ -599,6 +598,41 @@ DROP TABLE t1;
DROP TABLE fl2;
DROP TABLE fl1;
DROP TABLE fl0;
-SET GLOBAL innodb_monitor_enable=default;
-SET GLOBAL innodb_monitor_disable=default;
-SET GLOBAL innodb_monitor_reset_all=default;
+set global innodb_monitor_disable = 'adaptive\\_hash\\_p%';
+set global innodb_monitor_disable = 'adaptive\\_hash\\_r%';
+set global innodb_monitor_disable = 'buffer\\_LRU\\_batch\\_n%';
+set global innodb_monitor_disable = 'buffer\\_LRU\\_batch\\_s%';
+set global innodb_monitor_disable = 'buffer\\_LRU\\_g%';
+set global innodb_monitor_disable = 'buffer\\_LRU\\_s%';
+set global innodb_monitor_disable = 'buffer\\_LRU\\_u%';
+set global innodb_monitor_disable = 'buffer\\_f%';
+set global innodb_monitor_disable = 'buffer\\_page\\_%';
+set global innodb_monitor_disable = 'c%';
+set global innodb_monitor_disable = 'ddl%';
+set global innodb_monitor_disable = 'icp%';
+set global innodb_monitor_disable = 'index\\_p%';
+set global innodb_monitor_disable = 'innodb\\_di%';
+set global innodb_monitor_disable = 'innodb\\_l%';
+set global innodb_monitor_disable = 'innodb\\_m%';
+set global innodb_monitor_disable = 'lock\\_re%';
+set global innodb_monitor_disable = 'lock\\_ta%';
+set global innodb_monitor_disable = 'log%';
+set global innodb_monitor_disable = 'm%';
+set global innodb_monitor_disable = 'p%';
+set global innodb_monitor_disable = 't%';
+set global innodb_monitor_enable = 'log\\_w%';
+set global innodb_monitor_enable = 'trx_rseg_history_len';
+set global innodb_monitor_enable = 'trx_undo_slots_cached';
+set global innodb_monitor_enable=default;
+Warnings:
+Warning 1230 Default value is not defined for this set option. Please specify correct counter or module name.
+set global innodb_monitor_disable=default;
+Warnings:
+Warning 1230 Default value is not defined for this set option. Please specify correct counter or module name.
+set global innodb_monitor_reset_all=default;
+Warnings:
+Warning 1230 Default value is not defined for this set option. Please specify correct counter or module name.
+select name, orig.enabled, new.enabled from
+orig_innodb_metrics orig join information_schema.innodb_metrics new using(name)
+where orig.enabled != new.enabled;
+name enabled enabled
diff --git a/mysql-test/suite/innodb/r/rename_table.result b/mysql-test/suite/innodb/r/rename_table.result
index 0ed56005..a3bf5910 100644
--- a/mysql-test/suite/innodb/r/rename_table.result
+++ b/mysql-test/suite/innodb/r/rename_table.result
@@ -21,11 +21,17 @@ path
DROP DATABASE abc_def;
# restart
DROP DATABASE abc_def2;
-call mtr.add_suppression("InnoDB: (Operating system error|Error number \\d+ means|Cannot rename file)");
+call mtr.add_suppression("InnoDB: Cannot rename '.*t1.ibd' to '.*non_existing_db.*' because the target schema directory doesn't exist");
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(100);
RENAME TABLE t1 TO non_existing_db.t1;
ERROR HY000: Error on rename of './test/t1' to './non_existing_db/t1' (errno: 168 "Unknown (generic) error from engine")
-FOUND 1 /\[ERROR\] InnoDB: Cannot rename file '.*t1\.ibd' to '.*non_existing_db/ in mysqld.1.err
+FOUND 1 /\[ERROR\] InnoDB: Cannot rename '.*t1\.ibd' to '.*non_existing_db/ in mysqld.1.err
+SET GLOBAL innodb_fast_shutdown=2;
+# restart
+SELECT * FROM t1;
+a
+100
DROP TABLE t1;
#
# MDEV-25509 Atomic DDL: Assertion `err != DB_DUPLICATE_KEY'
diff --git a/mysql-test/suite/innodb/r/restart,16k,innodb.rdiff b/mysql-test/suite/innodb/r/restart,16k.rdiff
index b36ed067..b36ed067 100644
--- a/mysql-test/suite/innodb/r/restart,16k,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/restart,16k.rdiff
diff --git a/mysql-test/suite/innodb/r/restart,32k,innodb.rdiff b/mysql-test/suite/innodb/r/restart,32k.rdiff
index 8fa05781..8fa05781 100644
--- a/mysql-test/suite/innodb/r/restart,32k,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/restart,32k.rdiff
diff --git a/mysql-test/suite/innodb/r/restart,4k,innodb.rdiff b/mysql-test/suite/innodb/r/restart,4k.rdiff
index 7d084636..7d084636 100644
--- a/mysql-test/suite/innodb/r/restart,4k,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/restart,4k.rdiff
diff --git a/mysql-test/suite/innodb/r/restart,64k,innodb.rdiff b/mysql-test/suite/innodb/r/restart,64k.rdiff
index 3ac9f45b..3ac9f45b 100644
--- a/mysql-test/suite/innodb/r/restart,64k,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/restart,64k.rdiff
diff --git a/mysql-test/suite/innodb/r/restart,8k,innodb.rdiff b/mysql-test/suite/innodb/r/restart,8k.rdiff
index 4da55ebf..4da55ebf 100644
--- a/mysql-test/suite/innodb/r/restart,8k,innodb.rdiff
+++ b/mysql-test/suite/innodb/r/restart,8k.rdiff
diff --git a/mysql-test/suite/innodb/r/row_size_error_log_warnings_3,4k.rdiff b/mysql-test/suite/innodb/r/row_size_error_log_warnings_3,4k.rdiff
new file mode 100644
index 00000000..812632ac
--- /dev/null
+++ b/mysql-test/suite/innodb/r/row_size_error_log_warnings_3,4k.rdiff
@@ -0,0 +1,2 @@
+91a92
+> ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
diff --git a/mysql-test/suite/innodb/r/row_size_error_log_warnings_3.result b/mysql-test/suite/innodb/r/row_size_error_log_warnings_3.result
index 21085e4c..1fde89ac 100644
--- a/mysql-test/suite/innodb/r/row_size_error_log_warnings_3.result
+++ b/mysql-test/suite/innodb/r/row_size_error_log_warnings_3.result
@@ -82,3 +82,11 @@ f29(10), f30(10), f31(10), f32(10),
f33(10)))
ENGINE=InnoDB;
ERROR 42000: Too many key parts specified; max 32 parts allowed
+#
+# MDEV-31161 Assertion failures upon adding a too long key
+# to table with COMPRESSED row format
+#
+CREATE TABLE t1(pk INT PRIMARY KEY, f1 INT, f2 TEXT)ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+INSERT INTO t1 (pk) VALUES (1);
+ALTER TABLE t1 ADD KEY (f1), ADD KEY (f2(1000));
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/undo_space_dblwr.result b/mysql-test/suite/innodb/r/undo_space_dblwr.result
index d6822b20..4466df98 100644
--- a/mysql-test/suite/innodb/r/undo_space_dblwr.result
+++ b/mysql-test/suite/innodb/r/undo_space_dblwr.result
@@ -4,15 +4,14 @@ Variable_name Value
innodb_doublewrite ON
create table t1(f1 int not null, f2 int not null)engine=innodb;
insert into t1 values (1, 1);
-InnoDB 0 transactions not purged
-set GLOBAL innodb_log_checkpoint_now=1;
+SET GLOBAL innodb_fast_shutdown = 0;
+# restart: --debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0
# Make the first page dirty for undo tablespace
set global innodb_saved_page_number_debug = 0;
set global innodb_fil_make_page_dirty_debug = 1;
-SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
-SET GLOBAL innodb_max_dirty_pages_pct=0.0;
+SET GLOBAL innodb_buf_flush_list_now = 1;
# Kill the server
-# restart
+# restart: --debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0
FOUND 1 /Checksum mismatch in the first page of file/ in mysqld.1.err
check table t1;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/innodb/r/undo_truncate.result b/mysql-test/suite/innodb/r/undo_truncate.result
index f90bef94..6d77baa9 100644
--- a/mysql-test/suite/innodb/r/undo_truncate.result
+++ b/mysql-test/suite/innodb/r/undo_truncate.result
@@ -27,6 +27,7 @@ delete from t1;
connection con2;
delete from t2;
connection con1;
+SET GLOBAL innodb_max_undo_log_size = @@GLOBAL.innodb_page_size * 4294967296;
SET GLOBAL innodb_undo_log_truncate = 1;
commit;
disconnect con1;
@@ -35,6 +36,8 @@ commit;
disconnect con2;
connection default;
SET GLOBAL innodb_max_purge_lag_wait=0;
+SET GLOBAL innodb_max_undo_log_size=DEFAULT;
+SET GLOBAL innodb_max_purge_lag_wait=0;
set global innodb_fast_shutdown=0;
# restart
drop table t1, t2;
diff --git a/mysql-test/suite/innodb/t/alter_copy.test b/mysql-test/suite/innodb/t/alter_copy.test
index b62f812f..90f2171d 100644
--- a/mysql-test/suite/innodb/t/alter_copy.test
+++ b/mysql-test/suite/innodb/t/alter_copy.test
@@ -57,7 +57,7 @@ ALTER TABLE t ADD INDEX(b,c,d,a),ADD INDEX(b,c,a,d),ADD INDEX(b,a,c,d),ADD INDEX
connection default;
SET DEBUG_SYNC='now WAIT_FOR hung';
let $shutdown_timeout=0;
---let $restart_parameters= --innodb-force-recovery=3 --debug_dbug="+d,recv_ran_out_of_buffer"
+--let $restart_parameters= --innodb-force-recovery=3
--source include/restart_mysqld.inc
disconnect hang;
let $shutdown_timeout=;
diff --git a/mysql-test/suite/innodb/t/alter_crash.test b/mysql-test/suite/innodb/t/alter_crash.test
index 164ff877..f56dcf2c 100644
--- a/mysql-test/suite/innodb/t/alter_crash.test
+++ b/mysql-test/suite/innodb/t/alter_crash.test
@@ -70,7 +70,7 @@ let $orig_table_id = `SELECT table_id
WHERE name = 'test/t1'`;
# Write file to make mysql-test-run.pl expect crash
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--error 2013
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
@@ -110,7 +110,7 @@ let $orig_table_id = `SELECT table_id
WHERE name = 'test/t2'`;
# Write file to make mysql-test-run.pl expect crash
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--error 2013
ALTER TABLE t2 ADD PRIMARY KEY (f2, f1);
@@ -150,7 +150,7 @@ let $orig_table_id = `select table_id from
information_schema.innodb_sys_tables where name = 'test/t1'`;
# Write file to make mysql-test-run.pl expect crash
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
#
--error 2013
ALTER TABLE t1 ADD INDEX (b), CHANGE c d int, ALGORITHM=INPLACE;
diff --git a/mysql-test/suite/innodb/t/alter_kill.test b/mysql-test/suite/innodb/t/alter_kill.test
index 7d83e7e3..100beb76 100644
--- a/mysql-test/suite/innodb/t/alter_kill.test
+++ b/mysql-test/suite/innodb/t/alter_kill.test
@@ -76,7 +76,7 @@ EOF
-- source include/start_mysqld.inc
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT COUNT(*) FROM bug16720368;
--error ER_TABLE_CORRUPT
INSERT INTO bug16720368 VALUES(1);
diff --git a/mysql-test/suite/innodb/t/alter_rename_existing.test b/mysql-test/suite/innodb/t/alter_rename_existing.test
index 556d8e66..f09456e7 100644
--- a/mysql-test/suite/innodb/t/alter_rename_existing.test
+++ b/mysql-test/suite/innodb/t/alter_rename_existing.test
@@ -18,7 +18,7 @@ INSERT INTO t1(b) VALUES('one'), ('two'), ('three');
--echo #
--echo # Create a file called MYSQLD_DATADIR/test/t1.ibd
---exec echo "This is not t1.ibd" > $MYSQLD_DATADIR/test/t1.ibd
+--write_line "This is not t1.ibd" $MYSQLD_DATADIR/test/t1.ibd
--echo # Directory listing of test/*.ibd
--echo #
diff --git a/mysql-test/suite/innodb/t/autoinc_debug.test b/mysql-test/suite/innodb/t/autoinc_debug.test
index 7722b848..d38a70b3 100644
--- a/mysql-test/suite/innodb/t/autoinc_debug.test
+++ b/mysql-test/suite/innodb/t/autoinc_debug.test
@@ -92,3 +92,69 @@ SELECT * FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
SET DEBUG_SYNC='RESET';
+
+--echo #
+--echo # MDEV-33593: Auto increment deadlock error causes ASSERT in subsequent save point
+--echo #
+
+CREATE TABLE t1(col1 INT PRIMARY KEY AUTO_INCREMENT, col2 INT) ENGINE=InnoDB;
+CREATE TABLE t2(col1 INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1(col2) values(100);
+
+--connect(con1, localhost, root,,)
+START TRANSACTION;
+--echo # T1: Acquiring Row X lock on table t2
+INSERT INTO t2 values(100);
+
+--connect(con2, localhost, root,,)
+START TRANSACTION;
+--echo # T2: Wait for (T1) row lock on t2 after acquiring GAP Lock on t1
+UPDATE t1 SET col2 = 20 where col1 = 10;
+SET DEBUG_SYNC='lock_wait_before_suspend SIGNAL t2_waiting';
+--send INSERT INTO t2 values(100)
+
+--connection default
+SET DEBUG_SYNC='now WAIT_FOR t2_waiting';
+--echo # T3: Wait for (T2) II row Lock on t1 after acquiring Auto Increment Lock on t1
+SET DEBUG_SYNC='lock_wait_before_suspend SIGNAL t3_waiting';
+--send INSERT INTO t1(col2) SELECT col2 from t1
+
+--connection con1
+SAVEPOINT s1;
+SET DEBUG_SYNC='now WAIT_FOR t3_waiting';
+--echo # T1: Wait for (T3) auto increment lock on t1 causing T1 -> T3 -> T2 -> T1 deadlock
+SET debug_dbug = '+d,innodb_deadlock_victim_self';
+--error ER_AUTOINC_READ_FAILED
+INSERT INTO t1(col2) VALUES(200);
+
+--echo # The transaction should have been rolled back
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+--echo # Release the previous savepoint using the same name
+SAVEPOINT s1;
+COMMIT;
+
+--connection con2
+--reap
+COMMIT;
+
+--connection default
+--reap
+COMMIT;
+
+--disconnect con1
+--disconnect con2
+
+--echo # Cleanup
+SELECT * FROM t1;
+DROP TABLE t1;
+
+SELECT * FROM t2;
+DROP TABLE t2;
+
+SET DEBUG_SYNC='RESET';
+
+--echo #
+--echo # End of 10.5 tests
+--echo #
diff --git a/mysql-test/suite/innodb/t/autoinc_import.test b/mysql-test/suite/innodb/t/autoinc_import.test
new file mode 100644
index 00000000..e137413d
--- /dev/null
+++ b/mysql-test/suite/innodb/t/autoinc_import.test
@@ -0,0 +1,168 @@
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(42);
+CREATE TABLE t1b LIKE t1;
+INSERT INTO t1b VALUES(3);
+CREATE TABLE t1z LIKE t1;
+CREATE TABLE t1t (id TINYINT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t0t LIKE t1t;
+INSERT INTO t1t VALUES(123);
+--let DATADIR=`select @@datadir`
+--let PAGE_SIZE=`select @@innodb_page_size`
+FLUSH TABLES t1,t1b,t1t FOR EXPORT;
+--copy_file $DATADIR/test/t1.ibd $DATADIR/test/t.ibd
+--copy_file $DATADIR/test/t1.ibd $DATADIR/test/tz.ibd
+--copy_file $DATADIR/test/t1b.ibd $DATADIR/test/tb.ibd
+--copy_file $DATADIR/test/t1t.ibd $DATADIR/test/tt.ibd
+UNLOCK TABLES;
+CREATE TABLE t5_7 LIKE t1;
+CREATE TABLE t5_7b LIKE t1b;
+CREATE TABLE t10_1 LIKE t1;
+CREATE TABLE t10_1b LIKE t1b;
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t1b DISCARD TABLESPACE;
+ALTER TABLE t1z DISCARD TABLESPACE;
+ALTER TABLE t1t DISCARD TABLESPACE;
+ALTER TABLE t0t DISCARD TABLESPACE;
+ALTER TABLE t5_7 DISCARD TABLESPACE;
+ALTER TABLE t5_7b DISCARD TABLESPACE;
+ALTER TABLE t10_1 DISCARD TABLESPACE;
+ALTER TABLE t10_1b DISCARD TABLESPACE;
+FLUSH TABLES;
+
+# Update the PAGE_ROOT_AUTO_INC field of a few files.
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
+sub update_autoinc
+{
+ my ($file, $value) = @_;
+ open(FILE, "+<$file") || die "Unable to open $file";
+ binmode FILE;
+ my $ps= $ENV{PAGE_SIZE};
+ my $page;
+ die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
+ my $full_crc32 = unpack("N",substr($page,54,4)) & 0x10; # FIL_SPACE_FLAGS
+ sysseek(FILE, 3*$ps, 0) || die "Unable to seek $file\n";
+ die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
+ substr($page,56,8)=pack("NN",0,$value);
+ my $polynomial = 0x82f63b78; # CRC-32C
+ if ($full_crc32) {
+ my $ck = mycrc32(substr($page, 0, $ps-4), 0, $polynomial);
+ substr($page, $ps-4, 4) = pack("N", $ck);
+ }
+ else
+ {
+ my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
+ mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
+ substr($page,0,4)=$ck;
+ substr($page,$ps-8,4)=$ck;
+ }
+ sysseek(FILE, 3*$ps, 0) || die "Unable to rewind $file\n";
+ syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
+ close(FILE) || die "Unable to close $file";
+}
+update_autoinc("$ENV{DATADIR}/test/tz.ibd", 0);
+update_autoinc("$ENV{DATADIR}/test/t.ibd", 3);
+update_autoinc("$ENV{DATADIR}/test/tb.ibd", 346);
+update_autoinc("$ENV{DATADIR}/test/tt.ibd", 128);
+EOF
+
+--remove_file $DATADIR/test/t5_7.frm
+--remove_file $DATADIR/test/t5_7b.frm
+--copy_file $MYSQL_TEST_DIR/std_data/autoinc_import_57.frm $DATADIR/test/t5_7.frm
+--copy_file $MYSQL_TEST_DIR/std_data/autoinc_import_57.frm $DATADIR/test/t5_7b.frm
+--remove_file $DATADIR/test/t10_1.frm
+--remove_file $DATADIR/test/t10_1b.frm
+--copy_file $MYSQL_TEST_DIR/std_data/autoinc_import_101.frm $DATADIR/test/t10_1.frm
+--copy_file $MYSQL_TEST_DIR/std_data/autoinc_import_101.frm $DATADIR/test/t10_1b.frm
+--copy_file $DATADIR/test/t.ibd $DATADIR/test/t5_7.ibd
+--copy_file $DATADIR/test/tb.ibd $DATADIR/test/t5_7b.ibd
+--copy_file $DATADIR/test/t.ibd $DATADIR/test/t10_1.ibd
+--copy_file $DATADIR/test/tb.ibd $DATADIR/test/t10_1b.ibd
+--move_file $DATADIR/test/t.ibd $DATADIR/test/t1.ibd
+--move_file $DATADIR/test/tb.ibd $DATADIR/test/t1b.ibd
+--copy_file $DATADIR/test/tt.ibd $DATADIR/test/t0t.ibd
+--move_file $DATADIR/test/tt.ibd $DATADIR/test/t1t.ibd
+--move_file $DATADIR/test/tz.ibd $DATADIR/test/t1z.ibd
+
+ALTER TABLE t0t IMPORT TABLESPACE;
+INSERT INTO t0t VALUES(NULL);
+SELECT * FROM t0t;
+DROP TABLE t0t;
+ALTER TABLE t1 IMPORT TABLESPACE;
+ALTER TABLE t1b IMPORT TABLESPACE;
+ALTER TABLE t1z IMPORT TABLESPACE;
+ALTER TABLE t1t IMPORT TABLESPACE;
+ALTER TABLE t5_7 IMPORT TABLESPACE;
+ALTER TABLE t5_7b IMPORT TABLESPACE;
+ALTER TABLE t10_1 IMPORT TABLESPACE;
+ALTER TABLE t10_1b IMPORT TABLESPACE;
+
+--let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let SEARCH_PATTERN= InnoDB: Resetting PAGE_ROOT_AUTO_INC from 128 to 123 on table `test`\.`t0t`
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN= InnoDB: Resetting PAGE_ROOT_AUTO_INC from 0 to 42 on table `test`\.`t1z`
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN= InnoDB: Resetting PAGE_ROOT_AUTO_INC from 128 to 123 on table `test`\.`t1t`
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN= InnoDB: Resetting PAGE_ROOT_AUTO_INC from 3 to 42 on table `test`\.`t5_7` \(created with version 50744\)
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN= InnoDB: Resetting PAGE_ROOT_AUTO_INC from 3 to 42 on table `test`\.`t10_1` \(created with version 100149\)
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN= InnoDB: Resetting PAGE_ROOT_AUTO_INC
+--source include/search_pattern_in_file.inc
+
+# Restart, so that the InnoDB tables will be loaded into the data dictionary.
+--let $restart_parameters=--read-only
+--source include/restart_mysqld.inc
+
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
+
+--let $restart_parameters=--innodb-read-only --read-only
+--source include/restart_mysqld.inc
+
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
+
+--let $restart_parameters=--innodb-read-only
+--source include/restart_mysqld.inc
+
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
+
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t1b;
+SELECT COUNT(*) FROM t1t;
+SELECT COUNT(*) FROM t1z;
+SELECT COUNT(*) FROM t5_7;
+SELECT COUNT(*) FROM t5_7b;
+SELECT COUNT(*) FROM t10_1;
+SELECT COUNT(*) FROM t10_1b;
+
+--let $restart_parameters=
+--source include/restart_mysqld.inc
+
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
+
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1b VALUES(NULL);
+INSERT INTO t1t VALUES(NULL);
+INSERT INTO t1z VALUES(NULL);
+INSERT INTO t5_7 VALUES(NULL);
+INSERT INTO t5_7b VALUES(NULL);
+INSERT INTO t10_1 VALUES(NULL);
+INSERT INTO t10_1b VALUES(NULL);
+
+CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
+
+SELECT * FROM t1;
+SELECT * FROM t1b;
+SELECT * FROM t1t;
+SELECT * FROM t1z;
+SELECT * FROM t5_7;
+SELECT * FROM t5_7b;
+SELECT * FROM t10_1;
+SELECT * FROM t10_1b;
+DROP TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
diff --git a/mysql-test/suite/innodb/t/corrupted_during_recovery.test b/mysql-test/suite/innodb/t/corrupted_during_recovery.test
index 1f410246..83240549 100644
--- a/mysql-test/suite/innodb/t/corrupted_during_recovery.test
+++ b/mysql-test/suite/innodb/t/corrupted_during_recovery.test
@@ -7,7 +7,7 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*test.t1\\.ibd' page");
call mtr.add_suppression("InnoDB: Failed to read page 3 from file '.*test.t1\\.ibd': Page read from tablespace is corrupted.");
call mtr.add_suppression("InnoDB: (Unable to apply log to|Discarding log for) corrupted page .*, page number=3\\]");
-call mtr.add_suppression("Table test/t1 is corrupted. Please drop the table and recreate\\.");
+call mtr.add_suppression("Table `test`.`t1` is corrupted. Please drop the table and recreate.");
call mtr.add_suppression("InnoDB: File '.*test/t1\\.ibd' is corrupted");
call mtr.add_suppression("InnoDB: A long wait .* was observed for dict_sys");
--enable_query_log
diff --git a/mysql-test/suite/innodb/t/cursor-restore-unique-null.test b/mysql-test/suite/innodb/t/cursor-restore-unique-null.test
new file mode 100644
index 00000000..409694d6
--- /dev/null
+++ b/mysql-test/suite/innodb/t/cursor-restore-unique-null.test
@@ -0,0 +1,36 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/count_sessions.inc
+
+
+CREATE TABLE t(a INT PRIMARY KEY, b INT, c INT, UNIQUE KEY `b_c` (`b`,`c`))
+ ENGINE=InnoDB, STATS_PERSISTENT=0;
+INSERT INTO t SET a = 1, c = 2;
+
+--connect con1,localhost,root
+BEGIN;
+ INSERT INTO t SET a=2, c=2;
+
+--connection default
+BEGIN;
+SET DEBUG_SYNC="lock_wait_start SIGNAL select_locked";
+--send SELECT * FROM t FORCE INDEX(b) FOR UPDATE
+
+--connection con1
+SET DEBUG_SYNC="now WAIT_FOR select_locked";
+ROLLBACK;
+
+--connection default
+--echo # If the bug is not fixed, and the both unique index key fields are
+--echo # NULL, there will be two (1, NULL, 2) rows in the result,
+--echo # because cursor will be restored to (NULL, 2, 1) position for
+--echo # secondary key instead of "supremum".
+--reap
+COMMIT;
+
+SET DEBUG_SYNC="RESET";
+
+--disconnect con1
+DROP TABLE t;
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb/t/doublewrite_debug.test b/mysql-test/suite/innodb/t/doublewrite_debug.test
index ab7fd8eb..b8dcd506 100644
--- a/mysql-test/suite/innodb/t/doublewrite_debug.test
+++ b/mysql-test/suite/innodb/t/doublewrite_debug.test
@@ -45,7 +45,7 @@ commit work;
# Slow shutdown and restart to make sure ibuf merge is finished
SET GLOBAL innodb_fast_shutdown = 0;
let $shutdown_timeout=;
-let $restart_parameters="--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0";
+let $restart_parameters=--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0;
--source include/restart_mysqld.inc
--source ../include/no_checkpoint_start.inc
begin;
@@ -95,7 +95,7 @@ select f1, f2 from t1;
--echo # Test Begin: Test if recovery works if 1st page of
--echo # system tablespace is corrupted and 2nd page as corrupted.
-let $restart_parameters="--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0";
+let $restart_parameters=--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0;
--source include/restart_mysqld.inc
--source ../include/no_checkpoint_start.inc
begin;
diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test
index 0db3a7ca..e793e261 100644
--- a/mysql-test/suite/innodb/t/foreign_key.test
+++ b/mysql-test/suite/innodb/t/foreign_key.test
@@ -1077,10 +1077,23 @@ BEGIN;
--error ER_NO_REFERENCED_ROW_2
INSERT INTO child SET a=1;
connection default;
+--error ER_TRUNCATE_ILLEGAL_FK
+TRUNCATE TABLE parent;
+--error ER_ROW_IS_REFERENCED_2
+DROP TABLE parent;
+SET innodb_lock_wait_timeout=0;
+--error ER_LOCK_WAIT_TIMEOUT
+RENAME TABLE parent TO transparent;
+--error ER_LOCK_WAIT_TIMEOUT
+ALTER TABLE parent FORCE, ALGORITHM=COPY;
+--error ER_LOCK_WAIT_TIMEOUT
+ALTER TABLE parent FORCE, ALGORITHM=INPLACE;
SET innodb_lock_wait_timeout=0, foreign_key_checks=0;
--error ER_LOCK_WAIT_TIMEOUT
TRUNCATE TABLE parent;
--error ER_LOCK_WAIT_TIMEOUT
+DROP TABLE parent;
+--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE parent FORCE, ALGORITHM=COPY;
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE parent FORCE, ALGORITHM=INPLACE;
@@ -1095,7 +1108,13 @@ TRUNCATE TABLE parent;
ALTER TABLE parent FORCE, ALGORITHM=COPY;
ALTER TABLE parent FORCE, ALGORITHM=INPLACE;
ALTER TABLE parent ADD COLUMN b INT, ALGORITHM=INSTANT;
-DROP TABLE child, parent;
+SET foreign_key_checks=ON;
+--error ER_TRUNCATE_ILLEGAL_FK
+TRUNCATE TABLE parent;
+ALTER TABLE parent FORCE, ALGORITHM=COPY;
+ALTER TABLE parent FORCE, ALGORITHM=INPLACE;
+RENAME TABLE parent TO transparent;
+DROP TABLE child, transparent;
--echo #
--echo # MDEV-26217 Failing assertion: list.count > 0 in ut_list_remove
diff --git a/mysql-test/suite/innodb/t/full_crc32_import.test b/mysql-test/suite/innodb/t/full_crc32_import.test
index 0eb31f8d..6f02b2ab 100644
--- a/mysql-test/suite/innodb/t/full_crc32_import.test
+++ b/mysql-test/suite/innodb/t/full_crc32_import.test
@@ -63,6 +63,12 @@ ALTER TABLE t1 DROP INDEX b;
ALTER TABLE t1 IMPORT TABLESPACE;
--enable_warnings
SHOW CREATE TABLE t1;
+
+--echo # Auto increment value must be more than maximum column value
+SELECT MAX(a) FROM t1;
+SELECT auto_increment FROM information_schema.tables
+WHERE table_name like 't1';
+
UPDATE t1 set b = repeat("de", 100) where b = repeat("cd", 200);
--replace_column 9 #
explain SELECT a FROM t1 where b = repeat("de", 100);
@@ -145,6 +151,12 @@ ALTER TABLE t1 DROP INDEX idx1;
ALTER TABLE t1 IMPORT TABLESPACE;
--disable_warnings
SHOW CREATE TABLE t1;
+
+--echo # Auto increment value must be more than maximum column value
+SELECT MAX(c1) FROM t1;
+SELECT auto_increment FROM information_schema.tables
+WHERE table_name like 't1';
+
UPDATE t1 SET C2 = ST_GeomFromText('POINT(0 0)');
SELECT COUNT(*) FROM t1;
DELETE FROM t1;
diff --git a/mysql-test/suite/innodb/t/group_commit_crash.test b/mysql-test/suite/innodb/t/group_commit_crash.test
index 12f7ba20..b0ed854f 100644
--- a/mysql-test/suite/innodb/t/group_commit_crash.test
+++ b/mysql-test/suite/innodb/t/group_commit_crash.test
@@ -51,7 +51,7 @@ while ($numtests)
START TRANSACTION;
insert into t1 select * from t2;
# Write file to make mysql-test-run.pl expect crash
- --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+ --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
eval call setcrash($numtests);
diff --git a/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test b/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test
index 6115e3f0..9b7de7ce 100644
--- a/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test
+++ b/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test
@@ -51,7 +51,7 @@ while ($numtests)
START TRANSACTION;
insert into t1 select * from t2;
# Write file to make mysql-test-run.pl expect crash
- --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+ --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
eval call setcrash($numtests);
diff --git a/mysql-test/suite/innodb/t/import_bugs.test b/mysql-test/suite/innodb/t/import_bugs.test
index 7fcab9f9..d22b4b67 100644
--- a/mysql-test/suite/innodb/t/import_bugs.test
+++ b/mysql-test/suite/innodb/t/import_bugs.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/have_sequence.inc
call mtr.add_suppression("Index for table 'imp_t1' is corrupt; try to repair it");
@@ -23,6 +24,67 @@ DROP TABLE imp_t1, t1;
SET GLOBAL innodb_checksum_algorithm=@save_innodb_checksum_algorithm;
--echo #
+--echo # MDEV-33400 Adaptive hash index corruption after DISCARD TABLESPACE
+--echo #
+
+SET @save_adaptive=@@GLOBAL.innodb_adaptive_hash_index;
+SET GLOBAL innodb_adaptive_hash_index=ON;
+
+CREATE TABLE t (a INT PRIMARY KEY) ENGINE=INNODB;
+INSERT INTO t SELECT * FROM seq_1_to_131;
+ALTER TABLE t ADD hid INT DEFAULT 2;
+INSERT INTO t VALUES (251,1);
+ALTER TABLE t DISCARD TABLESPACE;
+CHECK TABLE mysql.innodb_table_stats;
+DROP TABLE t;
+SET GLOBAL innodb_adaptive_hash_index=@save_adaptive;
+
+--echo # End of 10.4 tests
+
+--echo #
+--echo # MDEV-18288: Transportable Tablespaces leave AUTO_INCREMENT in mismatched
+--echo # state, causing INSERT errors in newly imported tables when .cfg is not used.
+--echo #
+
+CREATE TABLE t1(
+ id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+) ENGINE=INNODB;
+
+CREATE TABLE t2 LIKE t1;
+
+ALTER TABLE t2 DISCARD TABLESPACE;
+
+INSERT INTO t1() VALUES();
+INSERT INTO t1() VALUES();
+
+FLUSH TABLES test.t1 FOR EXPORT;
+
+--echo # Copy data file
+--copy_file $datadir/test/t1.ibd $datadir/test/t2.ibd
+
+--echo # Skip CFG file copy
+#--copy_file $datadir/test/t1.cfg $datadir/test/t2.cfg
+--remove_file $datadir/test/t1.cfg
+
+UNLOCK TABLES;
+DROP TABLE t1;
+
+--replace_regex /opening '.*\/test\//opening '.\/test\//
+ALTER TABLE t2 IMPORT TABLESPACE;
+
+SELECT * FROM t2 ORDER BY id;
+
+INSERT INTO t2() VALUES();
+INSERT INTO t2() VALUES();
+INSERT INTO t2() VALUES();
+
+SELECT * FROM t2 ORDER BY id;
+DROP TABLE t2;
+
+--echo # End of 10.5 tests
+
+--echo #
--echo # MDEV-27006 Assertion `!lock_trx_has_sys_table_locks(trx)'
--echo # failed in dberr_t row_discard_tablespace_for_mysql
--echo # (dict_table_t*, trx_t*)
diff --git a/mysql-test/suite/innodb/t/import_hidden_fts.test b/mysql-test/suite/innodb/t/import_hidden_fts.test
new file mode 100644
index 00000000..4129e258
--- /dev/null
+++ b/mysql-test/suite/innodb/t/import_hidden_fts.test
@@ -0,0 +1,46 @@
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+# Table with virtual, fulltext, instant add, instant drop column
+# and purgeable rows
+call mtr.add_suppression("InnoDB: Added system generated FTS_DOC_ID and FTS_DOC_ID_INDEX while importing the tablespace");
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+ f2 CHAR(2) not null, fulltext f_idx(f2),
+ f3 INT as (f1) VIRTUAL, INDEX(f3),
+ f4 INT as (f1) STORED, INDEX(f4),
+ f5 INT as (f1) VIRTUAL)ENGINE=InnoDB;
+INSERT INTO t1(f1, f2) VALUES(1, "on");
+INSERT INTO t1(f1, f2) SELECT seq, "si" FROM seq_2_to_256;
+ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL;
+ALTER TABLE t1 DROP COLUMN f6;
+ALTER TABLE t1 DROP INDEX f_idx;
+connect(con1,localhost,root,,);
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+
+connection default;
+DELETE FROM t1 WHERE f1 > 1;
+FLUSH TABLE t1 FOR EXPORT;
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "t1");
+EOF
+UNLOCK TABLES;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+ f2 CHAR(2) not null,
+ f3 INT as (f1) VIRTUAL, INDEX(f3),
+ f4 INT as (f1) STORED, INDEX(f4),
+ f5 INT as (f1) VIRTUAL)ENGINE=InnoDB;
+ALTER TABLE t1 DISCARD TABLESPACE;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+
+--disable_warnings
+ALTER TABLE t1 IMPORT TABLESPACE;
+--enable_warnings
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/import_hidden_fts_debug.test b/mysql-test/suite/innodb/t/import_hidden_fts_debug.test
new file mode 100644
index 00000000..e3d8680d
--- /dev/null
+++ b/mysql-test/suite/innodb/t/import_hidden_fts_debug.test
@@ -0,0 +1,101 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+ f2 CHAR(2) NOT NULL, FULLTEXT f_idx(f2),
+ f3 INT as (f1) VIRTUAL, INDEX(f3))ENGINE=InnoDB;
+INSERT INTO t1(f1, f2) VALUES(1, "on");
+ALTER TABLE t1 DROP INDEX f_idx;
+FLUSH TABLE t1 FOR EXPORT;
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "t1");
+EOF
+UNLOCK TABLES;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+ f2 CHAR(2) NOT NULL,
+ f3 CHAR(2) NOT NULL,
+ f4 INT AS (f1) VIRTUAL, INDEX(f4))ENGINE=InnoDB;
+ALTER TABLE t1 DISCARD TABLESPACE;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+--error ER_TABLE_SCHEMA_MISMATCH
+ALTER TABLE t1 IMPORT TABLESPACE;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+ f2 CHAR(2) NOT NULL,
+ f3 INT as (f1) VIRTUAL, INDEX(f3))ENGINE=InnoDB;
+ALTER TABLE t1 DISCARD TABLESPACE;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+
+--disable_warnings
+SET DEBUG_DBUG="+d,ib_import_set_index_root_failure";
+--error ER_TOO_MANY_CONCURRENT_TRXS
+ALTER TABLE t1 IMPORT TABLESPACE;
+SET DEBUG_DBUG="-d,ib_import_set_index_root_failure";
+
+SET DEBUG_DBUG="+d,ib_import_vcol_update_fail";
+--error ER_DUP_KEY
+ALTER TABLE t1 IMPORT TABLESPACE;
+SET DEBUG_DBUG="-d,ib_import_vcol_update_fail";
+
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+
+SET DEBUG_DBUG="+d,ib_import_fts_error";
+--error ER_DUP_KEY
+ALTER TABLE t1 IMPORT TABLESPACE;
+SET DEBUG_DBUG="-d,ib_import_fts_error";
+--enable_warnings
+
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_unlink_tablespace("test", "t1");
+EOF
+
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS
+WHERE table_id IN (SELECT table_id FROM information_schema.innodb_sys_tables where name="test/t1");
+
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# Manually add the FTS_DOC_ID Column with mismatched data type
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+ FTS_DOC_ID BIGINT SIGNED NOT NULL,
+ f2 CHAR(2) NOT NULL,
+ FULLTEXT f_idx(f2))ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, 1, "on");
+ALTER TABLE t1 DROP INDEX f_idx;
+FLUSH TABLE t1 FOR EXPORT;
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "t1");
+EOF
+UNLOCK TABLES;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
+ f2 CHAR(2) NOT NULL)ENGINE=InnoDB;
+ALTER TABLE t1 DISCARD TABLESPACE;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+--error ER_TABLE_SCHEMA_MISMATCH
+ALTER TABLE t1 IMPORT TABLESPACE;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/index_length.test b/mysql-test/suite/innodb/t/index_length.test
index bf4940d4..03e61a5a 100644
--- a/mysql-test/suite/innodb/t/index_length.test
+++ b/mysql-test/suite/innodb/t/index_length.test
@@ -20,4 +20,12 @@ WHERE table_schema = 'test' AND table_name = 't1';
disconnect stop_purge;
DROP TABLE t1;
+--echo #
+--echo # MDEV-22855 Assertion (!field->prefix_len ||
+--echo # field->fixed_len == field->prefix_len)
+--echo # failed in btr_node_ptr_max_size
+--echo #
+CREATE TABLE t1(c CHAR(194) CHARACTER SET UTF32, KEY k1(c(193)))ENGINE=InnoDB;
+INSERT INTO t1 SET c='';
+DROP TABLE t1;
--echo # End of 10.4 tests
diff --git a/mysql-test/suite/innodb/t/index_merge_threshold.test b/mysql-test/suite/innodb/t/index_merge_threshold.test
index cb8e117d..acadf4f0 100644
--- a/mysql-test/suite/innodb/t/index_merge_threshold.test
+++ b/mysql-test/suite/innodb/t/index_merge_threshold.test
@@ -10,6 +10,7 @@
#
# Check actual behavior for table, partitioned table and temporary table
# #############################################################
+--source include/have_innodb.inc
--source include/have_innodb_16k.inc
--source include/have_partition.inc
diff --git a/mysql-test/suite/innodb/t/innodb-alter-debug.test b/mysql-test/suite/innodb/t/innodb-alter-debug.test
index c4a68ac7..6b94bfd2 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-debug.test
@@ -144,15 +144,14 @@ DROP TABLE t;
--echo #
create table t1(f1 int not null primary key,
-
- f2 int not null, index idx(f2))engine=innodb;
+ f2 int not null, index idx(f2), index i(f2,f1))engine=innodb;
insert into t1 values(1, 1);
connect(con1,localhost,root,,,);
SET DEBUG_SYNC='before_delete_table_stats SIGNAL blocked WAIT_FOR go';
-SET innodb_lock_wait_timeout=0;
-send ALTER TABLE t1 FORCE, ALGORITHM=COPY;
+send SET STATEMENT innodb_lock_wait_timeout=0 FOR
+ALTER TABLE t1 FORCE, ALGORITHM=COPY;
connection default;
SET DEBUG_SYNC='now WAIT_FOR blocked';
@@ -167,6 +166,21 @@ connection default;
COMMIT;
SET DEBUG_SYNC=RESET;
+RENAME TABLE mysql.innodb_table_stats TO mysql.innodb_table_stats_hidden;
+connection con1;
+SET DEBUG_SYNC='innodb_commit_inplace_before_lock SIGNAL blocked WAIT_FOR go';
+send ALTER TABLE t1 DROP INDEX i;
+
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR blocked';
+RENAME TABLE mysql.innodb_table_stats_hidden TO mysql.innodb_table_stats;
+SET DEBUG_SYNC='now SIGNAL go';
+
+connection con1;
+reap;
+connection default;
+SET DEBUG_SYNC=RESET;
+
connection con1;
ALTER TABLE t1 RENAME KEY idx TO idx1, ALGORITHM=COPY;
disconnect con1;
diff --git a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
index 2534f03d..0b6cbabb 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
@@ -35,7 +35,7 @@ let datadir= `select @@datadir`;
CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
SET debug_dbug='+d,innodb_alter_commit_crash_before_commit';
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--error 2013
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
diff --git a/mysql-test/suite/innodb/t/innodb-corrupted-table.test b/mysql-test/suite/innodb/t/innodb-corrupted-table.test
index a064f08d..dcdaa618 100644
--- a/mysql-test/suite/innodb/t/innodb-corrupted-table.test
+++ b/mysql-test/suite/innodb/t/innodb-corrupted-table.test
@@ -23,14 +23,14 @@ alter table t1 add primary key (pk);
--echo # Stop the server, replace the frm with the old one and restart the server
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--remove_file $datadir/test/t1.frm
--copy_file $MYSQLTEST_VARDIR/tmp/t1.frm $datadir/test/t1.frm
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
diff --git a/mysql-test/suite/innodb/t/innodb-lru-force-no-free-page.test b/mysql-test/suite/innodb/t/innodb-lru-force-no-free-page.test
deleted file mode 100644
index d4f08b5a..00000000
--- a/mysql-test/suite/innodb/t/innodb-lru-force-no-free-page.test
+++ /dev/null
@@ -1,24 +0,0 @@
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/not_embedded.inc
-
-call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
-
-SET @saved_debug = @@SESSION.debug_dbug;
-SET SESSION debug_dbug="+d,ib_lru_force_no_free_page";
-
-CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB;
-BEGIN;
-INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
-COMMIT;
-
-SET debug_dbug = @saved_debug;
-
-DROP TABLE t1;
-
-#
-# There should be only one message
-#
-let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
---let SEARCH_PATTERN=InnoDB: Difficult to find free blocks
---source include/search_pattern_in_file.inc
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
index e642a949..2d3b5b3f 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
@@ -43,7 +43,7 @@ INSERT INTO t1 VALUES(1),(2),(3);
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
---exec echo wait > $_expect_file_name
+--write_line wait $_expect_file_name
SET SESSION debug_dbug="+d,ib_discard_before_commit_crash";
--error 2013
ALTER TABLE t1 DISCARD TABLESPACE;
@@ -57,7 +57,7 @@ SET GLOBAL innodb_file_per_table = 1;
CREATE TABLE t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES(1),(2),(3);
---exec echo wait > $_expect_file_name
+--write_line wait $_expect_file_name
SET SESSION debug_dbug="+d,ib_discard_after_commit_crash";
--error 2013
ALTER TABLE t1 DISCARD TABLESPACE;
@@ -101,7 +101,7 @@ EOF
--error ER_TABLESPACE_DISCARDED
SELECT * FROM t1;
---exec echo wait > $_expect_file_name
+--write_line wait $_expect_file_name
SET SESSION debug_dbug="+d,ib_import_before_commit_crash";
--error 2013
ALTER TABLE t1 IMPORT TABLESPACE;
diff --git a/mysql-test/suite/innodb/t/innodb_bug60196.test b/mysql-test/suite/innodb/t/innodb_bug60196.test
index 7f1f5c40..41b9a4d8 100644
--- a/mysql-test/suite/innodb/t/innodb_bug60196.test
+++ b/mysql-test/suite/innodb/t/innodb_bug60196.test
@@ -58,7 +58,7 @@ SELECT * FROM bug_60196;
--echo # Restart server.
# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Turn on reconnect
--enable_reconnect
@@ -132,7 +132,7 @@ SELECT * FROM Bug_60309;
--echo # Restart server.
# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Turn on reconnect
--enable_reconnect
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_stats.test b/mysql-test/suite/innodb/t/innodb_defrag_stats.test
index ef79d8d6..3730eb65 100644
--- a/mysql-test/suite/innodb/t/innodb_defrag_stats.test
+++ b/mysql-test/suite/innodb/t/innodb_defrag_stats.test
@@ -35,7 +35,7 @@ SELECT @@GLOBAL.innodb_force_recovery<2 "have background defragmentation";
# Wait for defrag_pool to be processed.
let $wait_timeout=30;
-let $wait_condition = SELECT COUNT(*)>0 FROM mysql.innodb_index_stats;
+let $wait_condition = SELECT COUNT(*)>5 FROM mysql.innodb_index_stats;
--source include/wait_condition.inc
--sorted_result
diff --git a/mysql-test/suite/innodb/t/innodb_stats_fetch.test b/mysql-test/suite/innodb/t/innodb_stats_fetch.test
index 99fc115a..d02cd3b8 100644
--- a/mysql-test/suite/innodb/t/innodb_stats_fetch.test
+++ b/mysql-test/suite/innodb/t/innodb_stats_fetch.test
@@ -96,3 +96,11 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_VIRTUAL LIMIT ROWS EXAMINED 5;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN LIMIT ROWS EXAMINED 5;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS LIMIT ROWS EXAMINED 5;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-33462 Disallow LOCK=NONE operation on statistics table
+--echo #
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE mysql.innodb_table_stats FORCE, LOCK=NONE;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE mysql.innodb_index_stats FORCE, LOCK=NONE;
diff --git a/mysql-test/suite/innodb/t/innodb_timeout_rollback.test b/mysql-test/suite/innodb/t/innodb_timeout_rollback.test
index 44e8acdd..aa282352 100644
--- a/mysql-test/suite/innodb/t/innodb_timeout_rollback.test
+++ b/mysql-test/suite/innodb/t/innodb_timeout_rollback.test
@@ -1,4 +1,5 @@
+--source include/have_innodb.inc
--source include/innodb_rollback_on_timeout.inc
---echo End of 5.0 tests
+--echo # End of 5.0 tests
diff --git a/mysql-test/suite/innodb/t/innodb_ut_format_name.test b/mysql-test/suite/innodb/t/innodb_ut_format_name.test
deleted file mode 100644
index 6e4023c7..00000000
--- a/mysql-test/suite/innodb/t/innodb_ut_format_name.test
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Test ut_format_name()
-#
-
--- source include/have_debug.inc
--- source include/have_innodb.inc
-
-CREATE TABLE t (c INT) ENGINE=INNODB;
-
-# This will invoke test_ut_format_name() in debug builds
-
-SET @save_dbug = @@debug_dbug;
-SET debug_dbug = '+d,test_ut_format_name';
-
-DROP TABLE t;
-
-SET debug_dbug = @save_dbug;
diff --git a/mysql-test/suite/innodb/t/insert_into_empty.test b/mysql-test/suite/innodb/t/insert_into_empty.test
index baba5a14..cc631bca 100644
--- a/mysql-test/suite/innodb/t/insert_into_empty.test
+++ b/mysql-test/suite/innodb/t/insert_into_empty.test
@@ -271,6 +271,16 @@ connection default;
disconnect con1;
SELECT * FROM t1;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-33979 Disallow bulk insert operation during
+--echo # partition update statement
+--echo #
+CREATE TABLE t1(a INT KEY)ENGINE=InnoDB
+ PARTITION BY KEY(a) PARTITIONS 16;
+INSERT INTO t1 VALUES(1);
+UPDATE t1 SET a = 2 WHERE a = 1;
+DROP TABLE t1;
--echo # End of 10.6 tests
--echo #
@@ -495,3 +505,54 @@ DROP TABLE t1;
CREATE TABLE t (a CHAR CHARACTER SET utf8) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
INSERT t SELECT left(seq,1) FROM seq_1_to_43691;
DROP TABLE t;
+
+--echo #
+--echo # MDEV-32453 Bulk insert fails to apply when trigger
+--echo # does insert operation
+--echo #
+CREATE TABLE t(c INT)ENGINE=InnoDB;
+CREATE TRIGGER t2_ai AFTER INSERT ON t FOR EACH ROW SET @a:=(SELECT * FROM t);
+BEGIN;
+--error ER_SUBQUERY_NO_1_ROW
+INSERT INTO t VALUES (1),(1);
+COMMIT;
+DROP TABLE t;
+
+--echo #
+--echo # MDEV-33868 Assertion `trx->bulk_insert' failed in
+--echo # innodb_prepare_commit_versioned
+--echo #
+CREATE TABLE t (id INT) ENGINE=InnoDB;
+--replace_result $MYSQLTEST_VARDIR VARDIR
+--disable_ps2_protocol
+eval select 1 into outfile "$MYSQLTEST_VARDIR/tmp/t.outfile";
+--enable_ps2_protocol
+BEGIN;
+--replace_result $MYSQLTEST_VARDIR VARDIR
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t.outfile' INTO TABLE t;
+COMMIT;
+DROP TABLE t;
+--remove_file $MYSQLTEST_VARDIR/tmp/t.outfile
+
+--echo #
+--echo # MDEV-33934 Assertion `!check_foreigns' failed in
+--echo # trx_t::bulk_insert_apply_for_table(dict_table_t*)
+--echo #
+CREATE TABLE t1(f1 INT,f2 INT,KEY(f1))engine=innodb;
+BEGIN;
+INSERT INTO t1 VALUES();
+SET STATEMENT FOREIGN_KEY_CHECKS=1 FOR SELECT * FROM t1;
+COMMIT;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-33970 Assertion `!m.first->second.is_bulk_insert()'
+--echo # failed in trx_undo_report_row_operation()
+--echo #
+CREATE TABLE t1(c1 INT,c2 CHAR) ENGINE=INNODB PARTITION BY KEY(c1) PARTITIONS 2;
+begin;
+INSERT INTO t1 VALUES(2,0);
+DELETE FROM t1;
+commit;
+DROP TABLE t1;
+--echo # End of 10.11 tests
diff --git a/mysql-test/suite/innodb/t/instant_alter_crash.test b/mysql-test/suite/innodb/t/instant_alter_crash.test
index f51f61e3..76b85b77 100644
--- a/mysql-test/suite/innodb/t/instant_alter_crash.test
+++ b/mysql-test/suite/innodb/t/instant_alter_crash.test
@@ -230,29 +230,3 @@ CHECK TABLE t2;
DROP TABLE t1,t2;
--list_files $MYSQLD_DATADIR/test
-
---echo #
---echo # MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
---echo # ADD PRIMARY KEY or OPTIMIZE TABLE
---echo #
-CREATE TABLE t1(f1 year default null, f2 year default null,
- f3 text, f4 year default null, f5 year default null,
- f6 year default null, f7 year default null,
- f8 year default null)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
-INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
-ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
-set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
-send ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ADD COLUMN f10 YEAR DEFAULT NULL, ALGORITHM=INPLACE;
-
-connect(con1,localhost,root,,,);
-SET DEBUG_SYNC="now WAIT_FOR con1_insert";
-INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
-INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
-SET DEBUG_SYNC="now SIGNAL con1_finish";
-
-connection default;
-reap;
-disconnect con1;
-SET DEBUG_SYNC=RESET;
-CHECK TABLE t1;
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/instant_alter_debug.test b/mysql-test/suite/innodb/t/instant_alter_debug.test
index f11d0bd0..953f7663 100644
--- a/mysql-test/suite/innodb/t/instant_alter_debug.test
+++ b/mysql-test/suite/innodb/t/instant_alter_debug.test
@@ -551,11 +551,62 @@ SET DEBUG_SYNC="now WAIT_FOR try_insert";
--error ER_LOCK_WAIT_TIMEOUT
INSERT INTO t1 VALUES(1, 2);
SET DEBUG_SYNC="now SIGNAL alter_progress";
-disconnect con1;
connection default;
reap;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
+--echo # ADD PRIMARY KEY or OPTIMIZE TABLE
+--echo #
+CREATE TABLE t1(f1 year default null, f2 year default null,
+ f3 text, f4 year default null, f5 year default null,
+ f6 year default null, f7 year default null,
+ f8 year default null)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
+ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
+set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
+send ALTER TABLE t1 ADD COLUMN f10 YEAR DEFAULT NULL, FORCE, ALGORITHM=INPLACE;
+
+connection con1;
+SET DEBUG_SYNC="now WAIT_FOR con1_insert";
+INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
+INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
+SET DEBUG_SYNC="now SIGNAL con1_finish";
+
+connection default;
+reap;
+CHECK TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-19044 Alter table corrupts while applying the
+--echo # modification log
+--echo #
+CREATE TABLE t1 (
+ f1 INT,
+ f2 INT,
+ f3 char(19) CHARACTER SET utf8mb3,
+ f4 VARCHAR(500),
+ f5 TEXT)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(3, 1, REPEAT('a', 2), REPEAT("b", 20),'a');
+ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL, ALGORITHM=INSTANT;
+INSERT INTO t1 VALUES(1, 2, REPEAT('InnoDB', 2),
+ REPEAT("MariaDB", 20), REPEAT('a', 8000), 12);
+INSERT INTO t1 VALUES(1, 2, REPEAT('MYSQL', 2),
+ REPEAT("MariaDB", 20), REPEAT('a', 8000), 12);
+SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL con1_begin WAIT_FOR con1_update';
+send ALTER TABLE t1 MODIFY COLUMN f2 INT NOT NULL, FORCE, ALGORITHM=INPLACE;
+connection con1;
+SET DEBUG_SYNC='now WAIT_FOR con1_begin';
+UPDATE t1 SET f2=204 order by f1 limit 2;
+SET DEBUG_SYNC='now SIGNAL con1_update';
+connection default;
+reap;
+disconnect con1;
SET DEBUG_SYNC=reset;
+CHECK TABLE t1;
+DROP TABLE t1;
--echo # End of 10.4 tests
diff --git a/mysql-test/suite/innodb/t/instant_alter_extend.test b/mysql-test/suite/innodb/t/instant_alter_extend.test
index 7258ba6d..636527e5 100644
--- a/mysql-test/suite/innodb/t/instant_alter_extend.test
+++ b/mysql-test/suite/innodb/t/instant_alter_extend.test
@@ -256,3 +256,16 @@ select * from t1;
check table t1;
drop database best;
+
+--echo #
+--echo # MDEV-33214 Table is getting rebuild with
+--echo # ALTER TABLE ADD COLUMN
+--echo #
+use test;
+CREATE TABLE t1(f1 INT, f2 VARCHAR(10)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+INSERT INTO t1 VALUES(1,'abc'),(2,'def');
+ALTER TABLE t1 ADD (f3 VARCHAR(5000), f4 VARCHAR(20)), ALGORITHM=instant;
+ALTER TABLE t1 ADD f5 TEXT, ALGORITHM=INSTANT;
+DROP TABLE t1;
+
+--echo # End of 10.4 tests
diff --git a/mysql-test/suite/innodb/t/instant_alter_import.test b/mysql-test/suite/innodb/t/instant_alter_import.test
index 3a811def..fa35c582 100644
--- a/mysql-test/suite/innodb/t/instant_alter_import.test
+++ b/mysql-test/suite/innodb/t/instant_alter_import.test
@@ -83,6 +83,7 @@ flush tables t2 for export;
unlock tables;
alter table t1 import tablespace;
+--source include/restart_mysqld.inc
select * from t1;
--remove_file $MYSQLD_DATADIR/test/t1.ibd
diff --git a/mysql-test/suite/innodb/t/lock_insert_into_empty.test b/mysql-test/suite/innodb/t/lock_insert_into_empty.test
index 91d2bcdd..42409e8c 100644
--- a/mysql-test/suite/innodb/t/lock_insert_into_empty.test
+++ b/mysql-test/suite/innodb/t/lock_insert_into_empty.test
@@ -51,6 +51,7 @@ CREATE TABLE t1 (k INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 SET k=1;
START TRANSACTION;
INSERT INTO t1 SET k=2;
+SELECT count(*) > 0 FROM mysql.innodb_index_stats lock in share mode;
--connect (con1,localhost,root,,test)
SET innodb_lock_wait_timeout=0;
@@ -59,5 +60,6 @@ CREATE TABLE t2 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB
AS SELECT k FROM t1;
--disconnect con1
--connection default
-
+SET innodb_lock_wait_timeout=default;
DROP TABLE t1;
+DROP TABLE IF EXISTS t2;
diff --git a/mysql-test/suite/innodb/t/lock_isolation.test b/mysql-test/suite/innodb/t/lock_isolation.test
new file mode 100644
index 00000000..5c60f6e7
--- /dev/null
+++ b/mysql-test/suite/innodb/t/lock_isolation.test
@@ -0,0 +1,149 @@
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-26642 Weird SELECT view when a record is
+--echo # modified to the same value by two transactions
+--echo # MDEV-32898 Phantom rows caused by updates of PRIMARY KEY
+--echo #
+
+CREATE TABLE t(a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+INSERT INTO t VALUES (1,1),(2,2);
+BEGIN; SELECT * FROM t LOCK IN SHARE MODE;
+--connect con_weird,localhost,root
+BEGIN;
+SELECT * FROM t;
+--connect consistent,localhost,root
+SET innodb_snapshot_isolation=ON;
+BEGIN;
+SELECT * FROM t;
+--connection default
+UPDATE t SET a=3 WHERE b=2;
+COMMIT;
+--connection consistent
+--error ER_CHECKREAD
+UPDATE t SET b=3;
+SELECT * FROM t;
+COMMIT;
+--connection con_weird
+UPDATE t SET b=3;
+SELECT * FROM t;
+COMMIT;
+--connection default
+SELECT * FROM t;
+DROP TABLE t;
+
+--echo #
+--echo # MDEV-26643 Inconsistent behaviors of UPDATE under
+--echo # READ UNCOMMITTED and READ COMMITTED isolation level
+--echo #
+
+CREATE TABLE t(a INT, b INT) ENGINE=InnoDB;
+INSERT INTO t VALUES(NULL, 1), (2, 2);
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+BEGIN; UPDATE t SET a = 10;
+
+--connection consistent
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+--send UPDATE t SET b = 20 WHERE a
+
+--connection default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = 'Updating'
+ and info = 'UPDATE t SET b = 20 WHERE a';
+--source include/wait_condition.inc
+
+COMMIT;
+
+--connection consistent
+--reap
+SELECT * FROM t;
+
+--connection default
+TRUNCATE TABLE t;
+INSERT INTO t VALUES(NULL, 1), (2, 2);
+BEGIN; UPDATE t SET a = 10;
+
+--connection consistent
+SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+--send UPDATE t SET b = 20 WHERE a
+
+--connection default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where info = 'UPDATE t SET b = 20 WHERE a';
+--source include/wait_condition.inc
+
+COMMIT;
+
+--connection consistent
+--reap
+SELECT * FROM t;
+
+--connection default
+TRUNCATE TABLE t;
+INSERT INTO t VALUES(NULL, 1), (2, 2);
+BEGIN; UPDATE t SET a = 10;
+
+--connection con_weird
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+send UPDATE t SET b = 20 WHERE a;
+
+--connection default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = 'Updating'
+ and info = 'UPDATE t SET b = 20 WHERE a';
+--source include/wait_condition.inc
+
+SELECT * FROM t;
+COMMIT;
+
+--connection con_weird
+--reap
+COMMIT;
+
+--connection default
+SELECT * FROM t;
+DROP TABLE t;
+
+--echo #
+--echo # MDEV-33802 Weird read view after ROLLBACK of other transactions
+--echo #
+
+CREATE TABLE t(a INT PRIMARY KEY, b INT UNIQUE) ENGINE=InnoDB;
+INSERT INTO t SET a=1;
+
+BEGIN; INSERT INTO t SET a=2;
+
+--connection consistent
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+--disable_ps2_protocol
+--error ER_CHECKREAD
+SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
+--enable_ps2_protocol
+
+--connection con_weird
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+send
+SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
+
+--connection default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = 'Sending data'
+ and info LIKE 'SELECT * FROM t %';
+--source include/wait_condition.inc
+ROLLBACK;
+
+--connection con_weird
+--reap
+SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
+--disconnect con_weird
+
+--connection consistent
+SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
+--disconnect consistent
+
+--connection default
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb/t/log_file_name.test b/mysql-test/suite/innodb/t/log_file_name.test
index f88a13db..371d10c9 100644
--- a/mysql-test/suite/innodb/t/log_file_name.test
+++ b/mysql-test/suite/innodb/t/log_file_name.test
@@ -206,7 +206,7 @@ print FILE "\0" x 16384;
close(FILE);
EOF
---exec echo "" > $MYSQLD_DATADIR/test/u2.ibd
+--write_line "" $MYSQLD_DATADIR/test/u2.ibd
--copy_file $MYSQLD_DATADIR/test/u6.ibd $MYSQLD_DATADIR/test/u4.ibd
diff --git a/mysql-test/suite/innodb/t/log_upgrade_101_flags.test b/mysql-test/suite/innodb/t/log_upgrade_101_flags.test
new file mode 100644
index 00000000..4358ccfa
--- /dev/null
+++ b/mysql-test/suite/innodb/t/log_upgrade_101_flags.test
@@ -0,0 +1,91 @@
+--source include/have_innodb.inc
+--source include/big_test.inc
+--source include/not_embedded.inc
+call mtr.add_suppression("InnoDB: The change buffer is corrupted");
+call mtr.add_suppression("InnoDB: Tablespace size stored in header is 768 pages, but the sum of data file sizes is 384 pages");
+call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of file");
+--source include/shutdown_mysqld.inc
+let bugdir= $MYSQLTEST_VARDIR/tmp/log_upgrade;
+--mkdir $bugdir
+--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $dirs= --innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir
+
+# Test case similar to log_upgrade.test
+perl;
+do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl";
+my $polynomial = 0x82f63b78; # CRC-32C
+
+die unless open OUT, ">", "$ENV{bugdir}/ibdata1";
+binmode OUT;
+
+my $head = pack("Nx[18]", 0);
+# Add FSP_SPACE_FLAGS as 49152 (10.1.0...10.1.20), page_size = 32k
+my $body = pack("x[8]Nx[4]Nx[2]Nx[32696]", 768, 49152, 97937874);
+my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
+# Dummy pages 1..6.
+print OUT chr(0) x (6 * 32768);
+# Dictionary header page (page 7).
+$head = pack("Nx[18]", 7);
+$body = pack("x[32]Nx[8]Nx[32674]", 8, 9);
+$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
+
+# Empty SYS_TABLES page (page 8).
+$head = pack("NNNx[8]n", 8, ~0, ~0, 17855);
+$body = pack("nnx[31]Cx[20]", 2, 124, 1);
+$body .= pack("nxnn", 0x801, 3, 116) . "infimum";
+$body .= pack("xnxnxx", 0x901, 0x803) . "supremum";
+$body .= pack("x[32632]nn", 116, 101);
+$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
+
+# Empty SYS_INDEXES page (page 9).
+$head = pack("NNNx[8]n", 9, ~0, ~0, 17855);
+$body = pack("nnx[31]Cx[20]", 2, 124, 3);
+$body .= pack("nxnn", 0x801, 3, 116) . "infimum";
+$body .= pack("xnxnxx", 0x901, 0x803) . "supremum";
+$body .= pack("x[32632]nn", 116, 101);
+$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
+
+die unless seek(OUT, 768 * 16384 - 1, 0);
+print OUT chr(0);
+close OUT or die;
+
+die unless open OUT, ">", "$ENV{bugdir}/ib_logfile0";
+binmode OUT;
+$_= pack("Nx[5]nx[5]", 1, 0x1286) . "BogoDB 4.3.2.1" . chr(0) x 478;
+print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
+# checkpoint page 1 and all-zero checkpoint 2
+$_= pack("x[13]nCNNx[484]", 0x1286, 12, 2, 0x80c);
+print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
+die unless seek(OUT, 0x1FFFFFFFF, 0);
+print OUT chr(0);
+close OUT or die;
+die unless open OUT, ">", "$ENV{bugdir}/ib_logfile1";
+binmode OUT;
+die unless seek(OUT, 0x800, 0); # the first 2048 bytes are unused!
+$_= pack("Nnnx[500]", 0x80000944, 12, 12);
+print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
+die unless seek(OUT, 0x1FFFFFFFF, 0);
+print OUT chr(0);
+close OUT or die;
+EOF
+
+--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m --innodb_page_size=32k --innodb_buffer_pool_size=10M
+--source include/start_mysqld.inc
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+--source include/shutdown_mysqld.inc
+--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
+--source include/search_pattern_in_file.inc
+--let $restart_parameters= $dirs
+
+--remove_files_wildcard $bugdir
+--rmdir $bugdir
+--let $restart_parameters=
+--source include/start_mysqld.inc
+
+--echo # End of 10.5 tests
diff --git a/mysql-test/suite/innodb/t/monitor.test b/mysql-test/suite/innodb/t/monitor.test
index 77483d62..69545c9c 100644
--- a/mysql-test/suite/innodb/t/monitor.test
+++ b/mysql-test/suite/innodb/t/monitor.test
@@ -5,11 +5,11 @@
# sys_vars.innodb_monitor_enable_basic
--source include/have_innodb.inc
-# Test turn on/off the monitor counter with "all" option
-# By default, they will be off.
select name, if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics;
+create temporary table orig_innodb_metrics as select name, enabled from information_schema.innodb_metrics;
+
set global innodb_monitor_disable = All;
select name from information_schema.innodb_metrics where enabled;
@@ -315,18 +315,22 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
let $innodb_monitor_enable = `SELECT @@innodb_monitor_enable`;
-SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+SELECT /*1*/ NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
SET GLOBAL innodb_monitor_enable='module_buffer_page';
INSERT INTO t1 VALUES (1), (2), (3), (4); FLUSH TABLES t1 FOR EXPORT;
UNLOCK TABLES;
-SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+
+let $wait_condition= select count > 0 from information_schema.innodb_metrics where name like 'buffer_page_written_index_leaf';
+source include/wait_condition.inc;
+
+SELECT /*2*/ NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
SET GLOBAL innodb_monitor_disable='module_buffer_page';
SET GLOBAL innodb_monitor_reset_all='module_buffer_page';
-SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+SELECT /*3*/ NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
SET GLOBAL innodb_monitor_enable='%';
@@ -334,18 +338,22 @@ SET GLOBAL innodb_monitor_enable='%';
SET GLOBAL innodb_monitor_reset_all= '%', innodb_compression_algorithm= foo;
INSERT INTO t1 VALUES (5), (6), (7), (8); FLUSH TABLES t1 FOR EXPORT;
UNLOCK TABLES;
-SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+
+let $wait_condition= select count > 0 from information_schema.innodb_metrics where name like 'buffer_page_written_index_leaf';
+source include/wait_condition.inc;
+
+SELECT /*4*/ NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
SET GLOBAL innodb_monitor_disable='%';
SET GLOBAL innodb_monitor_reset_all='%';
-SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+SELECT /*5*/ NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
SET GLOBAL innodb_monitor_enable='ALL';
INSERT INTO t1 VALUES (9), (10), (11), (12); FLUSH TABLES t1 FOR EXPORT;
UNLOCK TABLES;
-SELECT NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+SELECT /*6*/ NAME, COUNT > 0 FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
LIKE 'buffer_page_written_index_leaf';
DROP TABLE t1;
@@ -462,8 +470,36 @@ DROP TABLE fl2;
DROP TABLE fl1;
DROP TABLE fl0;
---disable_warnings
-SET GLOBAL innodb_monitor_enable=default;
-SET GLOBAL innodb_monitor_disable=default;
-SET GLOBAL innodb_monitor_reset_all=default;
---enable_warnings
+set global innodb_monitor_disable = 'adaptive\\_hash\\_p%';
+set global innodb_monitor_disable = 'adaptive\\_hash\\_r%';
+set global innodb_monitor_disable = 'buffer\\_LRU\\_batch\\_n%';
+set global innodb_monitor_disable = 'buffer\\_LRU\\_batch\\_s%';
+set global innodb_monitor_disable = 'buffer\\_LRU\\_g%';
+set global innodb_monitor_disable = 'buffer\\_LRU\\_s%';
+set global innodb_monitor_disable = 'buffer\\_LRU\\_u%';
+set global innodb_monitor_disable = 'buffer\\_f%';
+set global innodb_monitor_disable = 'buffer\\_page\\_%';
+set global innodb_monitor_disable = 'c%';
+set global innodb_monitor_disable = 'ddl%';
+set global innodb_monitor_disable = 'icp%';
+set global innodb_monitor_disable = 'index\\_p%';
+set global innodb_monitor_disable = 'innodb\\_di%';
+set global innodb_monitor_disable = 'innodb\\_l%';
+set global innodb_monitor_disable = 'innodb\\_m%';
+set global innodb_monitor_disable = 'lock\\_re%';
+set global innodb_monitor_disable = 'lock\\_ta%';
+set global innodb_monitor_disable = 'log%';
+set global innodb_monitor_disable = 'm%';
+set global innodb_monitor_disable = 'p%';
+set global innodb_monitor_disable = 't%';
+set global innodb_monitor_enable = 'log\\_w%';
+set global innodb_monitor_enable = 'trx_rseg_history_len';
+set global innodb_monitor_enable = 'trx_undo_slots_cached';
+
+set global innodb_monitor_enable=default;
+set global innodb_monitor_disable=default;
+set global innodb_monitor_reset_all=default;
+
+select name, orig.enabled, new.enabled from
+ orig_innodb_metrics orig join information_schema.innodb_metrics new using(name)
+ where orig.enabled != new.enabled;
diff --git a/mysql-test/suite/innodb/t/purge_secondary.test b/mysql-test/suite/innodb/t/purge_secondary.test
index 8a38a418..ec02c726 100644
--- a/mysql-test/suite/innodb/t/purge_secondary.test
+++ b/mysql-test/suite/innodb/t/purge_secondary.test
@@ -4,10 +4,6 @@
SET @save_stats_persistent = @@GLOBAL.innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent = 0;
---disable_query_log
-call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
---enable_query_log
-
CREATE TABLE t1 (
a SERIAL, b CHAR(255) NOT NULL DEFAULT '', c BOOLEAN DEFAULT false,
l LINESTRING NOT NULL DEFAULT ST_linefromtext('linestring(448 -689,
diff --git a/mysql-test/suite/innodb/t/rename_table.test b/mysql-test/suite/innodb/t/rename_table.test
index 654f8809..a6181342 100644
--- a/mysql-test/suite/innodb/t/rename_table.test
+++ b/mysql-test/suite/innodb/t/rename_table.test
@@ -32,17 +32,22 @@ DROP DATABASE abc_def;
DROP DATABASE abc_def2;
-call mtr.add_suppression("InnoDB: (Operating system error|Error number \\d+ means|Cannot rename file)");
+call mtr.add_suppression("InnoDB: Cannot rename '.*t1.ibd' to '.*non_existing_db.*' because the target schema directory doesn't exist");
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(100);
--replace_result "\\" "/"
--error ER_ERROR_ON_RENAME
RENAME TABLE t1 TO non_existing_db.t1;
---let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot rename file '.*t1\.ibd' to '.*non_existing_db
+--let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot rename '.*t1\.ibd' to '.*non_existing_db
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
--source include/search_pattern_in_file.inc
+SET GLOBAL innodb_fast_shutdown=2;
+--source include/restart_mysqld.inc
+
+SELECT * FROM t1;
# Cleanup
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/row_size_error_log_warnings_3.test b/mysql-test/suite/innodb/t/row_size_error_log_warnings_3.test
index 24029a48..47fedc52 100644
--- a/mysql-test/suite/innodb/t/row_size_error_log_warnings_3.test
+++ b/mysql-test/suite/innodb/t/row_size_error_log_warnings_3.test
@@ -85,3 +85,19 @@ CREATE TABLE t1(f1 char(200), f2 char(200), f3 char(200),
f29(10), f30(10), f31(10), f32(10),
f33(10)))
ENGINE=InnoDB;
+
+--echo #
+--echo # MDEV-31161 Assertion failures upon adding a too long key
+--echo # to table with COMPRESSED row format
+--echo #
+--let $page_size= `SELECT @@GLOBAL.innodb_page_size`
+CREATE TABLE t1(pk INT PRIMARY KEY, f1 INT, f2 TEXT)ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+INSERT INTO t1 (pk) VALUES (1);
+let $error_code = 0;
+if ($page_size == 4096) {
+let $error_code = ER_TOO_BIG_ROWSIZE;
+}
+
+--error $error_code
+ALTER TABLE t1 ADD KEY (f1), ADD KEY (f2(1000));
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test
index b09ff7c7..ee1474bb 100644
--- a/mysql-test/suite/innodb/t/temporary_table.test
+++ b/mysql-test/suite/innodb/t/temporary_table.test
@@ -135,7 +135,7 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
# We cannot use include/restart_mysqld.inc in this particular test,
# because SHOW STATUS would fail due to unwritable (nonexistent) tmpdir.
--source include/shutdown_mysqld.inc
---exec echo "restart: --tmpdir=/dev/null/$MYSQL_TMP_DIR --skip-innodb-fast-shutdown" > $_expect_file_name
+--write_line "restart: --tmpdir=/dev/null/$MYSQL_TMP_DIR --skip-innodb-fast-shutdown" $_expect_file_name
--enable_reconnect
--disable_result_log
--disable_query_log
diff --git a/mysql-test/suite/innodb/t/undo_space_dblwr.test b/mysql-test/suite/innodb/t/undo_space_dblwr.test
index b6fd6738..52b19a4b 100644
--- a/mysql-test/suite/innodb/t/undo_space_dblwr.test
+++ b/mysql-test/suite/innodb/t/undo_space_dblwr.test
@@ -9,19 +9,19 @@ show variables like 'innodb_doublewrite';
create table t1(f1 int not null, f2 int not null)engine=innodb;
insert into t1 values (1, 1);
---source include/wait_all_purged.inc
+# Slow shutdown and restart to make sure ibuf merge is finished
+SET GLOBAL innodb_fast_shutdown = 0;
+let $shutdown_timeout=;
+let $restart_parameters=--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0;
+--source include/restart_mysqld.inc
-set GLOBAL innodb_log_checkpoint_now=1;
--source ../include/no_checkpoint_start.inc
-
--echo # Make the first page dirty for undo tablespace
set global innodb_saved_page_number_debug = 0;
set global innodb_fil_make_page_dirty_debug = 1;
-SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
-SET GLOBAL innodb_max_dirty_pages_pct=0.0;
+SET GLOBAL innodb_buf_flush_list_now = 1;
-sleep 1;
--let CLEANUP_IF_CHECKPOINT=drop table t1;
--source ../include/no_checkpoint_end.inc
diff --git a/mysql-test/suite/innodb/t/undo_truncate.test b/mysql-test/suite/innodb/t/undo_truncate.test
index 18cc4f36..9abf08ff 100644
--- a/mysql-test/suite/innodb/t/undo_truncate.test
+++ b/mysql-test/suite/innodb/t/undo_truncate.test
@@ -13,7 +13,7 @@ call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operation
# Re-create the undo log tablespaces after slow shutdown
SET GLOBAL innodb_fast_shutdown=0;
-let $restart_parameters="--innodb_undo_tablespaces=2";
+let $restart_parameters=--innodb_undo_tablespaces=2;
--source include/restart_mysqld.inc
SET GLOBAL innodb_undo_log_truncate = 0;
@@ -46,6 +46,7 @@ connection con1; reap; send delete from t1;
connection con2; reap; delete from t2;
connection con1; reap;
+SET GLOBAL innodb_max_undo_log_size = @@GLOBAL.innodb_page_size * 4294967296;
SET GLOBAL innodb_undo_log_truncate = 1;
commit; disconnect con1;
connection con2; commit; disconnect con2;
@@ -57,6 +58,8 @@ let $trx_before= `SHOW ENGINE INNODB STATUS`;
let $trx_before= `select substr('$trx_before',9)+2`;
SET GLOBAL innodb_max_purge_lag_wait=0;
+SET GLOBAL innodb_max_undo_log_size=DEFAULT;
+SET GLOBAL innodb_max_purge_lag_wait=0;
set global innodb_fast_shutdown=0;
let $restart_parameters=;
--source include/restart_mysqld.inc
diff --git a/mysql-test/suite/innodb/t/undo_truncate_recover.test b/mysql-test/suite/innodb/t/undo_truncate_recover.test
index 148c3f93..988b28f7 100644
--- a/mysql-test/suite/innodb/t/undo_truncate_recover.test
+++ b/mysql-test/suite/innodb/t/undo_truncate_recover.test
@@ -13,7 +13,7 @@
# Re-create the undo log tablespaces after slow shutdown
SET GLOBAL innodb_fast_shutdown=0;
-let $restart_parameters="--innodb_undo_tablespaces=2";
+let $restart_parameters=--innodb_undo_tablespaces=2;
--source include/restart_mysqld.inc
SET GLOBAL innodb_undo_log_truncate = 1;