summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-11-06 16:24:16 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-11-06 16:24:16 +0200
commit074c68409921032f8a64416cc4d5ebc35d95dca9 (patch)
tree615c99d326fd2ce8c0e3b533b40f0e4e3475bbc1 /mysql-test/suite
parent563efeceece09154f71da6303244b1df36875428 (diff)
parentdf563e0c037f9b2cdb22e145575f92a121b4b529 (diff)
downloadmariadb-git-074c68409921032f8a64416cc4d5ebc35d95dca9.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result12
-rw-r--r--mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test19
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_index.result32
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_index.test31
-rw-r--r--mysql-test/suite/heap/heap_btree.result4
-rw-r--r--mysql-test/suite/heap/heap_btree.test9
-rw-r--r--mysql-test/suite/innodb/include/innodb_binlog.combinations3
-rw-r--r--mysql-test/suite/innodb/include/innodb_binlog.inc3
-rw-r--r--mysql-test/suite/innodb/r/alter_inplace_perfschema.result20
-rw-r--r--mysql-test/suite/innodb/r/auto_increment_dup,skip-log-bin.rdiff51
-rw-r--r--mysql-test/suite/innodb/r/auto_increment_dup.result22
-rw-r--r--mysql-test/suite/innodb/r/foreign_key.result59
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-debug.result18
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter.result140
-rw-r--r--mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff132
-rw-r--r--mysql-test/suite/innodb/r/table_flags,32k,release.rdiff (renamed from mysql-test/suite/innodb/r/table_flags,32k.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff132
-rw-r--r--mysql-test/suite/innodb/r/table_flags,64k,release.rdiff (renamed from mysql-test/suite/innodb/r/table_flags,64k.rdiff)0
-rw-r--r--mysql-test/suite/innodb/r/table_flags,debug.rdiff122
-rw-r--r--mysql-test/suite/innodb/t/alter_inplace_perfschema.opt2
-rw-r--r--mysql-test/suite/innodb/t/alter_inplace_perfschema.test40
-rw-r--r--mysql-test/suite/innodb/t/auto_increment_dup.test40
-rw-r--r--mysql-test/suite/innodb/t/foreign_key.test94
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-debug.test25
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter.test101
-rw-r--r--mysql-test/suite/innodb/t/table_flags.test5
-rw-r--r--mysql-test/suite/innodb_gis/r/rtree_concurrent_srch.result4
-rw-r--r--mysql-test/suite/innodb_gis/t/rtree_concurrent_srch.test2
-rw-r--r--mysql-test/suite/maria/fulltext2.result86
-rw-r--r--mysql-test/suite/maria/fulltext2.test77
-rw-r--r--mysql-test/suite/rpl/include/rpl_lower_case_table_names.test141
-rw-r--r--mysql-test/suite/rpl/r/rpl_15919.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_lcase_tblnames_rewrite_db.result38
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_lcase_tblnames.result60
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_lcase_tblnames.result57
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result4
-rw-r--r--mysql-test/suite/rpl/t/rpl_15919-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_15919.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test60
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_lcase_tblnames-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test12
-rw-r--r--mysql-test/suite/sql_sequence/create.result9
-rw-r--r--mysql-test/suite/sql_sequence/create.test11
-rw-r--r--mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_32.result7
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_64.result5
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic,32bit.rdiff13
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result7
-rw-r--r--mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff118
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result2
-rw-r--r--mysql-test/suite/sys_vars/r/thread_pool_size_high.result1
-rw-r--r--mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test20
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test4
-rw-r--r--mysql-test/suite/sys_vars/t/thread_pool_size_high.test1
-rw-r--r--mysql-test/suite/vcol/r/races.result16
-rw-r--r--mysql-test/suite/vcol/t/races.test22
-rw-r--r--mysql-test/suite/versioning/innodb.combinations5
-rw-r--r--mysql-test/suite/versioning/innodb.inc1
-rw-r--r--mysql-test/suite/versioning/r/alter.result2
-rw-r--r--mysql-test/suite/versioning/r/online.result131
-rw-r--r--mysql-test/suite/versioning/r/trx_id_versioning_attribute_persistence.result86
-rw-r--r--mysql-test/suite/versioning/t/online.test145
-rw-r--r--mysql-test/suite/versioning/t/trx_id_versioning_attribute_persistence.test87
70 files changed, 2069 insertions, 365 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result b/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result
index 99f2a57835f..fdcfb4bfa01 100644
--- a/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result
+++ b/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result
@@ -17,6 +17,12 @@ master-bin.000002 #
SET @@SESSION.gtid_domain_id=1;
SET @@SESSION.server_id=1;
CREATE TABLE t (a int);
+SELECT @@GLOBAL.gtid_binlog_state, @@GLOBAL.gtid_binlog_pos;
+@@GLOBAL.gtid_binlog_state @@GLOBAL.gtid_binlog_pos
+1-1-1 1-1-1
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Rotate # # master-bin.000002;pos=POS
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files.
FLUSH BINARY LOGS;
@@ -74,5 +80,11 @@ the following command succeeds with warnings
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
Warnings:
Warning 1076 The current gtid binlog state is incompatible with a former one having a gtid '11-11-1' which is less than the '11-11-11' of the gtid list describing an earlier state. The state may have been affected by manually injecting a lower sequence number gtid or via replication.
+RESET MASTER;
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (4294967296);
+ERROR HY000: The value of gtid domain being deleted ('4294967296') exceeds its maximum size of 32 bit unsigned integer
+FLUSH BINARY LOGS DELETE_DOMAIN_ID = (4294967295);
+Warnings:
+Warning 1076 The gtid domain being deleted ('4294967295') is not in the current binlog state
DROP TABLE t;
RESET MASTER;
diff --git a/mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test b/mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test
index 0faafa35a1b..8311f4bd800 100644
--- a/mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test
+++ b/mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test
@@ -28,6 +28,9 @@ FLUSH BINARY LOGS DELETE_DOMAIN_ID = (99);
SET @@SESSION.gtid_domain_id=1;
SET @@SESSION.server_id=1;
CREATE TABLE t (a int);
+SELECT @@GLOBAL.gtid_binlog_state, @@GLOBAL.gtid_binlog_pos;
+--let $binlog_start=
+--source include/show_binlog_events.inc
--error ER_BINLOG_CANT_DELETE_GTID_DOMAIN
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
@@ -129,6 +132,22 @@ SELECT @gtid_binlog_state_saved "as original state", @@GLOBAL.gtid_binlog_state
--echo the following command succeeds with warnings
--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID = ($del_d_id)
+# cleanup: forget the out-of-order
+RESET MASTER;
+
+#
+# MDEV-14431
+# Check rejection to delete a domain with value exceeding its range's maximum
+#
+--let $d_max_plus_1=`SELECT 1 << 32`
+--error ER_BINLOG_CANT_DELETE_GTID_DOMAIN
+--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID = ($d_max_plus_1)
+
+# accepted maximum:
+--let $d_max=`SELECT (1 << 32) - 1`
+--error 0
+--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID = ($d_max)
+
#
# Cleanup
#
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_index.result b/mysql-test/suite/gcol/r/innodb_virtual_index.result
index 48efd4edeb1..8d4762e1b90 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_index.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_index.result
@@ -207,3 +207,35 @@ t1 CREATE TABLE `t1` (
KEY `n` (`col2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
DROP TABLE t1;
+#
+# Bug #27968952 INNODB CRASH/CORRUPTION WITH TEXT PREFIX INDEXES
+#
+CREATE TABLE t1(
+a INT NOT NULL UNIQUE,
+b INT NOT NULL,
+c TEXT GENERATED ALWAYS AS (a <> b) VIRTUAL,
+d TEXT NOT NULL,
+UNIQUE KEY (c(1)), KEY(d(1))
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+SET @t = REPEAT('t',@@innodb_page_size);
+INSERT INTO t1 (a,b,d) VALUES (1,0,@t), (0,0,@t);
+UPDATE t1 SET b = a;
+ERROR 23000: Duplicate entry '0' for key 'c'
+REPLACE INTO t1 SET a = 0, b = 1, d = 'd';
+SELECT * FROM t1;
+a b c d
+0 1 1 d
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+CREATE TABLE t1(
+a VARCHAR(1000) GENERATED ALWAYS AS ('1') VIRTUAL,
+b VARCHAR(1000) NOT NULL,
+c VARCHAR(1000) GENERATED ALWAYS AS (b) STORED,
+KEY (b(1)),
+KEY (a(1))
+) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+INSERT INTO t1(b) VALUES(REPEAT('b',1000));
+DELETE FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_index.test b/mysql-test/suite/gcol/t/innodb_virtual_index.test
index 6604a6d94f4..8f4e09fdf31 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_index.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_index.test
@@ -232,3 +232,34 @@ CREATE TABLE t1 (col1 int(10)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE t1 ADD col2 char(21) AS (col1 * col1), ADD INDEX n (col2);
SHOW CREATE TABLE t1;
DROP TABLE t1;
+
+--echo #
+--echo # Bug #27968952 INNODB CRASH/CORRUPTION WITH TEXT PREFIX INDEXES
+--echo #
+
+CREATE TABLE t1(
+ a INT NOT NULL UNIQUE,
+ b INT NOT NULL,
+ c TEXT GENERATED ALWAYS AS (a <> b) VIRTUAL,
+ d TEXT NOT NULL,
+ UNIQUE KEY (c(1)), KEY(d(1))
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+SET @t = REPEAT('t',@@innodb_page_size);
+INSERT INTO t1 (a,b,d) VALUES (1,0,@t), (0,0,@t);
+--error ER_DUP_ENTRY
+UPDATE t1 SET b = a;
+REPLACE INTO t1 SET a = 0, b = 1, d = 'd';
+SELECT * FROM t1;
+CHECK TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(
+ a VARCHAR(1000) GENERATED ALWAYS AS ('1') VIRTUAL,
+ b VARCHAR(1000) NOT NULL,
+ c VARCHAR(1000) GENERATED ALWAYS AS (b) STORED,
+ KEY (b(1)),
+ KEY (a(1))
+) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+INSERT INTO t1(b) VALUES(REPEAT('b',1000));
+DELETE FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/heap/heap_btree.result b/mysql-test/suite/heap/heap_btree.result
index 12a011778c6..83d1bcb6c92 100644
--- a/mysql-test/suite/heap/heap_btree.result
+++ b/mysql-test/suite/heap/heap_btree.result
@@ -379,3 +379,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range uniq_id uniq_id 8 NULL 4 Using where
drop table t1;
End of 5.3 tests
+create table t1 (id int, a varchar(300) not null, key using btree(a)) engine=heap;
+insert t1 values (1, repeat('a', 300));
+drop table t1;
+End of 5.5 tests
diff --git a/mysql-test/suite/heap/heap_btree.test b/mysql-test/suite/heap/heap_btree.test
index 02c09f52263..aca41c430b3 100644
--- a/mysql-test/suite/heap/heap_btree.test
+++ b/mysql-test/suite/heap/heap_btree.test
@@ -279,3 +279,12 @@ explain select 0+a from t1 where a in (869751,736494,226312,802616);
drop table t1;
--echo End of 5.3 tests
+
+#
+# Bug#27799513: POTENTIAL DOUBLE FREE OR CORRUPTION OF HEAP INFO (HP_INFO)
+#
+create table t1 (id int, a varchar(300) not null, key using btree(a)) engine=heap;
+insert t1 values (1, repeat('a', 300));
+drop table t1;
+
+--echo End of 5.5 tests
diff --git a/mysql-test/suite/innodb/include/innodb_binlog.combinations b/mysql-test/suite/innodb/include/innodb_binlog.combinations
new file mode 100644
index 00000000000..46d31e733b1
--- /dev/null
+++ b/mysql-test/suite/innodb/include/innodb_binlog.combinations
@@ -0,0 +1,3 @@
+[log-bin]
+log-bin
+[skip-log-bin]
diff --git a/mysql-test/suite/innodb/include/innodb_binlog.inc b/mysql-test/suite/innodb/include/innodb_binlog.inc
new file mode 100644
index 00000000000..3f6ece2422e
--- /dev/null
+++ b/mysql-test/suite/innodb/include/innodb_binlog.inc
@@ -0,0 +1,3 @@
+# See innodb_binlog.combinations
+# --log-bin is ignored in the embedded server
+--source include/not_embedded.inc
diff --git a/mysql-test/suite/innodb/r/alter_inplace_perfschema.result b/mysql-test/suite/innodb/r/alter_inplace_perfschema.result
new file mode 100644
index 00000000000..68e25664031
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_inplace_perfschema.result
@@ -0,0 +1,20 @@
+connect ddl, localhost, root,,;
+update performance_schema.setup_instruments set enabled='yes';
+update performance_schema.setup_consumers set enabled='yes';
+CREATE TABLE t1 (a serial, b varchar(255)) ENGINE=InnoDB;
+BEGIN;
+COMMIT;
+SET DEBUG_SYNC = 'row_log_apply_before SIGNAL go WAIT_FOR gone';
+ALTER TABLE t1 ADD INDEX(b), ALGORITHM=INPLACE;
+connection default;
+SET DEBUG_SYNC = 'now WAIT_FOR go';
+SELECT DISTINCT object_name FROM performance_schema.events_waits_history_long
+WHERE event_name LIKE '%wait%io%file%innodb%innodb_temp_file%';
+object_name
+tmp/Innodb Merge Temp File
+SET DEBUG_SYNC = 'now SIGNAL gone';
+connection ddl;
+disconnect ddl;
+connection default;
+SET DEBUG_SYNC = 'RESET';
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/auto_increment_dup,skip-log-bin.rdiff b/mysql-test/suite/innodb/r/auto_increment_dup,skip-log-bin.rdiff
new file mode 100644
index 00000000000..7b4ec54eed8
--- /dev/null
+++ b/mysql-test/suite/innodb/r/auto_increment_dup,skip-log-bin.rdiff
@@ -0,0 +1,51 @@
+--- auto_increment_dup.result
++++ auto_increment_dup,skip-log-bin.reject
+@@ -89,13 +89,14 @@
+ SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue';
+ affected rows: 0
+ INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
++affected rows: 3
++info: Records: 3 Duplicates: 0 Warnings: 0
+ connection con1;
+ #
+ # 2 duplicates
+ #
+-affected rows: 3
+-info: Records: 3 Duplicates: 0 Warnings: 0
++affected rows: 4
++info: Records: 3 Duplicates: 1 Warnings: 0
+ connection default;
+ #
+ # 3 rows
+@@ -103,19 +104,21 @@
+ SELECT * FROM t1 order by k;
+ id k c
+ 1 1 NULL
+-2 2 NULL
+-3 3 NULL
+-affected rows: 3
++4 2 1
++2 3 NULL
++5 4 NULL
++6 5 NULL
++affected rows: 5
+ INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+-affected rows: 4
+-info: Records: 3 Duplicates: 1 Warnings: 0
++affected rows: 6
++info: Records: 3 Duplicates: 3 Warnings: 0
+ SELECT * FROM t1 order by k;
+ id k c
+ 1 1 NULL
+-2 2 2
+-3 3 NULL
+-7 4 NULL
+-8 5 NULL
++4 2 2
++2 3 NULL
++5 4 2
++6 5 2
+ affected rows: 5
+ disconnect con1;
+ disconnect con2;
diff --git a/mysql-test/suite/innodb/r/auto_increment_dup.result b/mysql-test/suite/innodb/r/auto_increment_dup.result
index fa0921b57a5..1467a459fc1 100644
--- a/mysql-test/suite/innodb/r/auto_increment_dup.result
+++ b/mysql-test/suite/innodb/r/auto_increment_dup.result
@@ -1,4 +1,3 @@
-drop table if exists t1;
set global transaction isolation level repeatable read;
CREATE TABLE t1(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -79,20 +78,13 @@ affected rows: 0
#
# Parallel execution
#
-connect con1, localhost, root;
connect con2, localhost, root;
SET DEBUG_SYNC='now WAIT_FOR write_row_done';
-connection con1;
-#
-# Connection 1
-#
+connect con1, localhost, root;
SET DEBUG_SYNC='ha_write_row_end SIGNAL write_row_done WAIT_FOR continue';
affected rows: 0
INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1';
connection con2;
-#
-# Connection 2
-#
affected rows: 0
SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue';
affected rows: 0
@@ -140,18 +132,10 @@ k INT,
c CHAR(1),
UNIQUE KEY(k)) ENGINE=InnoDB;
connect con1, localhost, root;
-connect con2, localhost, root;
-connection con1;
-#
-# Connection 1
-#
SET DEBUG_SYNC='ha_write_row_end SIGNAL continue2 WAIT_FOR continue1';
affected rows: 0
INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1';
-connection con2;
-#
-# Connection 2
-#
+connect con2, localhost, root;
SET DEBUG_SYNC='ha_write_row_start WAIT_FOR continue2';
affected rows: 0
SET DEBUG_SYNC='after_mysql_insert SIGNAL continue1';
@@ -159,6 +143,7 @@ affected rows: 0
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
affected rows: 3
info: Records: 3 Duplicates: 0 Warnings: 0
+disconnect con2;
connection con1;
affected rows: 4
info: Records: 3 Duplicates: 1 Warnings: 0
@@ -174,7 +159,6 @@ id k c
5 4 NULL
6 5 NULL
disconnect con1;
-disconnect con2;
connection default;
DROP TABLE t1;
set global transaction isolation level repeatable read;
diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result
index a151651b594..7195f3e7c3f 100644
--- a/mysql-test/suite/innodb/r/foreign_key.result
+++ b/mysql-test/suite/innodb/r/foreign_key.result
@@ -171,6 +171,43 @@ UNLOCK TABLES;
DROP TABLES staff, store;
SET FOREIGN_KEY_CHECKS=1;
#
+# MDEV-17531 Crash in RENAME TABLE with FOREIGN KEY and FULLTEXT INDEX
+#
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE DATABASE best;
+CREATE TABLE t3 (a INT PRIMARY KEY,
+CONSTRAINT t2_ibfk_1 FOREIGN KEY (a) REFERENCES t1(a)) ENGINE=InnoDB;
+CREATE TABLE best.t2 (a INT PRIMARY KEY, b TEXT, FULLTEXT INDEX(b),
+FOREIGN KEY (a) REFERENCES test.t1(a)) ENGINE=InnoDB;
+RENAME TABLE best.t2 TO test.t2;
+ERROR 42S01: Table 't2' already exists
+SHOW CREATE TABLE best.t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL,
+ `b` text DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ FULLTEXT KEY `b` (`b`),
+ CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP DATABASE best;
+#
+# MDEV-17541 KILL QUERY during lock wait in FOREIGN KEY check hangs
+#
+connect fk, localhost, root,,;
+INSERT INTO t1 SET a=1;
+BEGIN;
+DELETE FROM t1;
+connection default;
+INSERT INTO t3 SET a=1;
+connection fk;
+kill query @id;
+connection default;
+ERROR 70100: Query execution was interrupted
+disconnect fk;
+DROP TABLE t3,t1;
+# Start of 10.2 tests
+#
# MDEV-13246 Stale rows despite ON DELETE CASCADE constraint
#
CREATE TABLE users (
@@ -252,7 +289,6 @@ DELETE FROM t1 WHERE id = 1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection con1;
COMMIT;
-disconnect con1;
connection default;
SELECT * FROM t2;
id ref_id f
@@ -332,7 +368,26 @@ PRIMARY KEY (store_id),
UNIQUE KEY idx_unique_manager (manager_staff_id),
CONSTRAINT fk_store_staff FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB;
-SET FOREIGN_KEY_CHECKS=DEFAULT;
LOCK TABLE staff WRITE;
UNLOCK TABLES;
DROP TABLES staff, store;
+SET FOREIGN_KEY_CHECKS=1;
+#
+# MDEV-17541 KILL QUERY during lock wait in FOREIGN KEY check hangs
+#
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT PRIMARY KEY, FOREIGN KEY (a) REFERENCES t1(a))
+ENGINE=InnoDB;
+connection con1;
+INSERT INTO t1 SET a=1;
+BEGIN;
+DELETE FROM t1;
+connection default;
+INSERT INTO t2 SET a=1;
+connection con1;
+kill query @id;
+connection default;
+ERROR 70100: Query execution was interrupted
+disconnect con1;
+DROP TABLE t2,t1;
+# End of 10.2 tests
diff --git a/mysql-test/suite/innodb/r/innodb-alter-debug.result b/mysql-test/suite/innodb/r/innodb-alter-debug.result
index d455e54be3d..73037247272 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-debug.result
@@ -52,10 +52,26 @@ set DEBUG_SYNC = 'now WAIT_FOR s1';
update t1 set a=1 where id=2;
ERROR 23000: Duplicate entry '1' for key 'uk'
SET DEBUG_SYNC = 'now SIGNAL s2';
-disconnect con1;
/* connection default */
connection default;
/* reap */ alter table t1 force, add b int, ALGORITHM=inplace;
ERROR 23000: Duplicate entry '1' for key 'uk'
SET DEBUG_SYNC = 'RESET';
drop table t1;
+#
+# Bug #27753193 ASSERTION `PREBUILT->TRX->ERROR_KEY_NUM <
+# HA_ALTER_INFO->KEY_COUNT'
+CREATE TABLE t1 (a INT, UNIQUE KEY(a)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET DEBUG_SYNC = 'row_log_table_apply1_before signal S1 WAIT_FOR S2';
+ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
+connection con1;
+SET DEBUG_SYNC = 'now WAIT_FOR S1';
+INSERT INTO t1 VALUES (1);
+ERROR 23000: Duplicate entry '1' for key 'a'
+SET DEBUG_SYNC = 'now SIGNAL S2';
+disconnect con1;
+connection default;
+ERROR 23000: Duplicate entry '1' for key 'a'
+SET DEBUG_SYNC='RESET';
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-test/suite/innodb/r/innodb-alter.result
index 8f8a30d832d..7b0a43297e0 100644
--- a/mysql-test/suite/innodb/r/innodb-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-alter.result
@@ -728,6 +728,7 @@ t2 CREATE TABLE `t2` (
CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`c2`) REFERENCES `t1` (`c1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
ALTER TABLE t1 CHANGE COLUMN c1 C1 INT;
+ALTER TABLE t2 CHANGE COLUMN c2 C2 INT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -737,24 +738,149 @@ t1 CREATE TABLE `t1` (
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c2` int(11) NOT NULL,
- KEY `c2` (`c2`),
+ `C2` int(11) DEFAULT NULL,
+ KEY `c2` (`C2`),
CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`c2`) REFERENCES `t1` (`c1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 CHANGE COLUMN C1 c5 INT;
+ALTER TABLE t2 CHANGE COLUMN C2 c6 INT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `C1` int(11) NOT NULL,
- PRIMARY KEY (`C1`)
+ `c5` int(11) NOT NULL,
+ PRIMARY KEY (`c5`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c2` int(11) NOT NULL,
- KEY `c2` (`c2`),
- CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`c2`) REFERENCES `t1` (`c1`)
+ `c6` int(11) DEFAULT NULL,
+ KEY `c2` (`c6`),
+ CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`c6`) REFERENCES `t1` (`c5`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT C.NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS C INNER JOIN
+INFORMATION_SCHEMA.INNODB_SYS_TABLES T ON C.TABLE_ID=T.TABLE_ID
+WHERE T.NAME='test/t1';
+NAME
+c5
+SELECT F.NAME FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS F INNER JOIN
+INFORMATION_SCHEMA.INNODB_SYS_INDEXES I ON F.INDEX_ID=I.INDEX_ID INNER JOIN
+INFORMATION_SCHEMA.INNODB_SYS_TABLES T ON I.TABLE_ID=T.TABLE_ID
+WHERE T.NAME='test/t1' AND I.NAME='PRIMARY';
+NAME
+c5
+SELECT C.REF_COL_NAME, C.FOR_COL_NAME FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS C INNER JOIN
+INFORMATION_SCHEMA.INNODB_SYS_FOREIGN F ON C.ID=F.ID
+WHERE F.FOR_NAME='test/t2';
+REF_COL_NAME FOR_COL_NAME
+c5 c6
DROP TABLE t2, t1;
+# virtual columns case too
+CREATE TABLE t1 (a INT, b INT GENERATED ALWAYS AS (a) VIRTUAL) ENGINE = InnoDB;
+ALTER TABLE t1 CHANGE COLUMN a A INT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `A` int(11) DEFAULT NULL,
+ `b` int(11) GENERATED ALWAYS AS (`A`) VIRTUAL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT C.NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS C INNER JOIN
+INFORMATION_SCHEMA.INNODB_SYS_TABLES T ON C.TABLE_ID=T.TABLE_ID
+WHERE T.NAME='test/t1';
+NAME
+a
+b
+DROP TABLE t1;
+# different FOREIGN KEY cases
+CREATE TABLE t1 (
+a INT UNIQUE KEY,
+b INT UNIQUE KEY,
+c INT UNIQUE KEY,
+d INT UNIQUE KEY
+) ENGINE=INNODB;
+CREATE TABLE t2 (
+aa INT,
+bb INT,
+cc INT,
+dd INT
+) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1, 1, 1, 1);
+INSERT INTO t2 VALUES (1, 1, 1, 1);
+ALTER TABLE t1 CHANGE a A INT, ALGORITHM=INPLACE;
+ALTER TABLE t1 CHANGE c C INT, ALGORITHM=INPLACE;
+ALTER TABLE t2 CHANGE cc CC INT, ALGORITHM=INPLACE;
+ALTER TABLE t2 CHANGE dd DD INT, ALGORITHM=INPLACE;
+SET foreign_key_checks=0;
+ALTER TABLE t2
+ADD FOREIGN KEY(aa) REFERENCES t1(a),
+ADD FOREIGN KEY(bb) REFERENCES t1(b),
+ADD FOREIGN KEY(cc) REFERENCES t1(c),
+ADD FOREIGN KEY(dd) REFERENCES t1(d),
+ALGORITHM=INPLACE;
+ALTER TABLE t1 CHANGE b B INT, ALGORITHM=INPLACE;
+ALTER TABLE t2 CHANGE aa AA INT, ALGORITHM=INPLACE;
+ALTER TABLE t1 CHANGE d D INT, ALGORITHM=INPLACE;
+ALTER TABLE t2 CHANGE bb BB INT, ALGORITHM=INPLACE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `A` int(11) DEFAULT NULL,
+ `B` int(11) DEFAULT NULL,
+ `C` int(11) DEFAULT NULL,
+ `D` int(11) DEFAULT NULL,
+ UNIQUE KEY `a` (`A`),
+ UNIQUE KEY `b` (`B`),
+ UNIQUE KEY `c` (`C`),
+ UNIQUE KEY `d` (`D`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `AA` int(11) DEFAULT NULL,
+ `BB` int(11) DEFAULT NULL,
+ `CC` int(11) DEFAULT NULL,
+ `DD` int(11) DEFAULT NULL,
+ KEY `aa` (`AA`),
+ KEY `bb` (`BB`),
+ KEY `CC` (`CC`),
+ KEY `DD` (`DD`),
+ CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`aa`) REFERENCES `t1` (`a`),
+ CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`bb`) REFERENCES `t1` (`b`),
+ CONSTRAINT `t2_ibfk_3` FOREIGN KEY (`cc`) REFERENCES `t1` (`c`),
+ CONSTRAINT `t2_ibfk_4` FOREIGN KEY (`dd`) REFERENCES `t1` (`d`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DELETE FROM t1 WHERE a=1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`aa`) REFERENCES `t1` (`a`))
+DELETE FROM t1 WHERE A=1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`aa`) REFERENCES `t1` (`a`))
+DELETE FROM t1 WHERE b=1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`aa`) REFERENCES `t1` (`a`))
+DELETE FROM t1 WHERE B=1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`aa`) REFERENCES `t1` (`a`))
+DELETE FROM t1 WHERE c=1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`aa`) REFERENCES `t1` (`a`))
+DELETE FROM t1 WHERE C=1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`aa`) REFERENCES `t1` (`a`))
+DELETE FROM t1 WHERE d=1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`aa`) REFERENCES `t1` (`a`))
+DELETE FROM t1 WHERE D=1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`aa`) REFERENCES `t1` (`a`))
+DROP TABLE t2, t1;
+# virtual columns case too
+CREATE TABLE t1 (a INT, b INT GENERATED ALWAYS AS (a) VIRTUAL) ENGINE = InnoDB;
+ALTER TABLE t1 CHANGE COLUMN a A INT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `A` int(11) DEFAULT NULL,
+ `b` int(11) GENERATED ALWAYS AS (`A`) VIRTUAL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT C.NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS C INNER JOIN
+INFORMATION_SCHEMA.INNODB_SYS_TABLES T ON C.TABLE_ID=T.TABLE_ID
+WHERE T.NAME='test/t1';
+NAME
+a
+b
+DROP TABLE t1;
#
# BUG 20029625 - HANDLE_FATAL_SIGNAL (SIG=11) IN
# DICT_MEM_TABLE_COL_RENAME_LOW
diff --git a/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff
new file mode 100644
index 00000000000..7e851cf5634
--- /dev/null
+++ b/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff
@@ -0,0 +1,132 @@
+--- suite/innodb/r/table_flags.result
++++ suite/innodb/r/table_flags,32k,debug.reject
+@@ -5,96 +5,98 @@
+ SET innodb_strict_mode=OFF;
+ CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
+ KEY_BLOCK_SIZE=1;
++Warnings:
++Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k. Assuming ROW_FORMAT=DYNAMIC.
+ SET innodb_strict_mode=ON;
+ CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
+ PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
+ SYS_TABLES clustered index root page (8):
+ N_RECS=10; LEVEL=0; INDEX_ID=0x0000000000000001
+-header=0x01000003016e (NAME=0x696e66696d756d00)
+-header=0x00002815008d (NAME='SYS_DATAFILES',
++header=0x0100000301bf (NAME=0x696e66696d756d00)
++header=0x0000301500de (NAME='SYS_DATAFILES',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000e,
++ ID=0x000000000000000f,
+ N_COLS=0x00000002,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x0000101500d5 (NAME='SYS_FOREIGN',
++header=0x000018150126 (NAME='SYS_FOREIGN',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000b,
++ ID=0x000000000000000c,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
++header=0x000020150173 (NAME='SYS_FOREIGN_COLS',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000c,
++ ID=0x000000000000000d,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x0400201501b8 (NAME='SYS_TABLESPACES',
++header=0x040028150209 (NAME='SYS_TABLESPACES',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000d,
++ ID=0x000000000000000e,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x000030150244 (NAME='SYS_VIRTUAL',
++header=0x000038150251 (NAME='SYS_VIRTUAL',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000f,
++ ID=0x0000000000000010,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x000040150288 (NAME='test/tc',
++header=0x000040150295 (NAME='test/tc',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000011,
++ ID=0x0000000000000012,
+ N_COLS=0x80000001,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000002)
+-header=0x000048150310 (NAME='test/td',
++header=0x00004815031d (NAME='test/td',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000012,
++ ID=0x0000000000000013,
+ N_COLS=0x80000001,
+ TYPE=0x00000021,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000003)
+-header=0x000058150200 (NAME='test/tp',
++header=0x00005815008d (NAME='test/tp',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000014,
++ ID=0x0000000000000015,
+ N_COLS=0x80000001,
+ TYPE=0x000009a1,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000005)
+-header=0x0000381502cc (NAME='test/tr',
++header=0x0000101502d9 (NAME='test/tr',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000010,
++ ID=0x0000000000000011,
+ N_COLS=0x00000001,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+@@ -104,9 +106,9 @@
+ header=0x000050150074 (NAME='test/tz',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000013,
++ ID=0x0000000000000014,
+ N_COLS=0x80000001,
+- TYPE=0x00000023,
++ TYPE=0x00000021,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
diff --git a/mysql-test/suite/innodb/r/table_flags,32k.rdiff b/mysql-test/suite/innodb/r/table_flags,32k,release.rdiff
index ce1ff623d50..ce1ff623d50 100644
--- a/mysql-test/suite/innodb/r/table_flags,32k.rdiff
+++ b/mysql-test/suite/innodb/r/table_flags,32k,release.rdiff
diff --git a/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff
new file mode 100644
index 00000000000..da52f17fa68
--- /dev/null
+++ b/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff
@@ -0,0 +1,132 @@
+--- suite/innodb/r/table_flags.result
++++ suite/innodb/r/table_flags,64k,debug.reject
+@@ -5,96 +5,98 @@
+ SET innodb_strict_mode=OFF;
+ CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
+ KEY_BLOCK_SIZE=1;
++Warnings:
++Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k. Assuming ROW_FORMAT=DYNAMIC.
+ SET innodb_strict_mode=ON;
+ CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
+ PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
+ SYS_TABLES clustered index root page (8):
+ N_RECS=10; LEVEL=0; INDEX_ID=0x0000000000000001
+-header=0x01000003016e (NAME=0x696e66696d756d00)
+-header=0x00002815008d (NAME='SYS_DATAFILES',
++header=0x0100000301bf (NAME=0x696e66696d756d00)
++header=0x0000301500de (NAME='SYS_DATAFILES',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000e,
++ ID=0x000000000000000f,
+ N_COLS=0x00000002,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x0000101500d5 (NAME='SYS_FOREIGN',
++header=0x000018150126 (NAME='SYS_FOREIGN',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000b,
++ ID=0x000000000000000c,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
++header=0x000020150173 (NAME='SYS_FOREIGN_COLS',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000c,
++ ID=0x000000000000000d,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x0400201501b8 (NAME='SYS_TABLESPACES',
++header=0x040028150209 (NAME='SYS_TABLESPACES',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000d,
++ ID=0x000000000000000e,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x000030150244 (NAME='SYS_VIRTUAL',
++header=0x000038150251 (NAME='SYS_VIRTUAL',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000f,
++ ID=0x0000000000000010,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x000040150288 (NAME='test/tc',
++header=0x000040150295 (NAME='test/tc',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000011,
++ ID=0x0000000000000012,
+ N_COLS=0x80000001,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000002)
+-header=0x000048150310 (NAME='test/td',
++header=0x00004815031d (NAME='test/td',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000012,
++ ID=0x0000000000000013,
+ N_COLS=0x80000001,
+ TYPE=0x00000021,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000003)
+-header=0x000058150200 (NAME='test/tp',
++header=0x00005815008d (NAME='test/tp',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000014,
++ ID=0x0000000000000015,
+ N_COLS=0x80000001,
+ TYPE=0x000009a1,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000005)
+-header=0x0000381502cc (NAME='test/tr',
++header=0x0000101502d9 (NAME='test/tr',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000010,
++ ID=0x0000000000000011,
+ N_COLS=0x00000001,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+@@ -104,9 +106,9 @@
+ header=0x000050150074 (NAME='test/tz',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000013,
++ ID=0x0000000000000014,
+ N_COLS=0x80000001,
+- TYPE=0x00000023,
++ TYPE=0x00000021,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
diff --git a/mysql-test/suite/innodb/r/table_flags,64k.rdiff b/mysql-test/suite/innodb/r/table_flags,64k,release.rdiff
index f2ba1280be3..f2ba1280be3 100644
--- a/mysql-test/suite/innodb/r/table_flags,64k.rdiff
+++ b/mysql-test/suite/innodb/r/table_flags,64k,release.rdiff
diff --git a/mysql-test/suite/innodb/r/table_flags,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,debug.rdiff
new file mode 100644
index 00000000000..16f748468dd
--- /dev/null
+++ b/mysql-test/suite/innodb/r/table_flags,debug.rdiff
@@ -0,0 +1,122 @@
+--- suite/innodb/r/table_flags.result
++++ suite/innodb/r/table_flags,debug.reject
+@@ -10,91 +10,91 @@
+ PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
+ SYS_TABLES clustered index root page (8):
+ N_RECS=10; LEVEL=0; INDEX_ID=0x0000000000000001
+-header=0x01000003016e (NAME=0x696e66696d756d00)
+-header=0x00002815008d (NAME='SYS_DATAFILES',
++header=0x0100000301bf (NAME=0x696e66696d756d00)
++header=0x0000301500de (NAME='SYS_DATAFILES',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000e,
++ ID=0x000000000000000f,
+ N_COLS=0x00000002,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x0000101500d5 (NAME='SYS_FOREIGN',
++header=0x000018150126 (NAME='SYS_FOREIGN',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000b,
++ ID=0x000000000000000c,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
++header=0x000020150173 (NAME='SYS_FOREIGN_COLS',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000c,
++ ID=0x000000000000000d,
+ N_COLS=0x00000004,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x0400201501b8 (NAME='SYS_TABLESPACES',
++header=0x040028150209 (NAME='SYS_TABLESPACES',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000d,
++ ID=0x000000000000000e,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x000030150244 (NAME='SYS_VIRTUAL',
++header=0x000038150251 (NAME='SYS_VIRTUAL',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x000000000000000f,
++ ID=0x0000000000000010,
+ N_COLS=0x00000003,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000040,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000000)
+-header=0x000040150288 (NAME='test/tc',
++header=0x000040150295 (NAME='test/tc',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000011,
++ ID=0x0000000000000012,
+ N_COLS=0x80000001,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000002)
+-header=0x000048150310 (NAME='test/td',
++header=0x00004815031d (NAME='test/td',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000012,
++ ID=0x0000000000000013,
+ N_COLS=0x80000001,
+ TYPE=0x00000021,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000003)
+-header=0x000058150200 (NAME='test/tp',
++header=0x00005815008d (NAME='test/tp',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000014,
++ ID=0x0000000000000015,
+ N_COLS=0x80000001,
+ TYPE=0x000009a1,
+ MIX_ID=0x0000000000000000,
+ MIX_LEN=0x00000050,
+ CLUSTER_NAME=NULL(0 bytes),
+ SPACE=0x00000005)
+-header=0x0000381502cc (NAME='test/tr',
++header=0x0000101502d9 (NAME='test/tr',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000010,
++ ID=0x0000000000000011,
+ N_COLS=0x00000001,
+ TYPE=0x00000001,
+ MIX_ID=0x0000000000000000,
+@@ -104,7 +104,7 @@
+ header=0x000050150074 (NAME='test/tz',
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+- ID=0x0000000000000013,
++ ID=0x0000000000000014,
+ N_COLS=0x80000001,
+ TYPE=0x00000023,
+ MIX_ID=0x0000000000000000,
diff --git a/mysql-test/suite/innodb/t/alter_inplace_perfschema.opt b/mysql-test/suite/innodb/t/alter_inplace_perfschema.opt
new file mode 100644
index 00000000000..f56125521fc
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_inplace_perfschema.opt
@@ -0,0 +1,2 @@
+--innodb-sort-buffer-size=64k
+--tmpdir=$MYSQLTEST_VARDIR/tmp
diff --git a/mysql-test/suite/innodb/t/alter_inplace_perfschema.test b/mysql-test/suite/innodb/t/alter_inplace_perfschema.test
new file mode 100644
index 00000000000..b832596647f
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_inplace_perfschema.test
@@ -0,0 +1,40 @@
+--source include/have_innodb.inc
+--source include/have_perfschema.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/not_embedded.inc
+
+connect (ddl, localhost, root,,);
+update performance_schema.setup_instruments set enabled='yes';
+update performance_schema.setup_consumers set enabled='yes';
+CREATE TABLE t1 (a serial, b varchar(255)) ENGINE=InnoDB;
+
+BEGIN;
+let $n=247;
+--disable_query_log
+while ($n) {
+dec $n;
+INSERT INTO t1 SELECT NULL, REPEAT('b',255);
+}
+--enable_query_log
+COMMIT;
+
+SET DEBUG_SYNC = 'row_log_apply_before SIGNAL go WAIT_FOR gone';
+send ALTER TABLE t1 ADD INDEX(b), ALGORITHM=INPLACE;
+
+connection default;
+SET DEBUG_SYNC = 'now WAIT_FOR go';
+--replace_regex /.*[\\\/]tmp/tmp/
+SELECT DISTINCT object_name FROM performance_schema.events_waits_history_long
+WHERE event_name LIKE '%wait%io%file%innodb%innodb_temp_file%';
+
+#--exec lsof -p `pidof mysqld`
+SET DEBUG_SYNC = 'now SIGNAL gone';
+
+connection ddl;
+reap;
+disconnect ddl;
+
+connection default;
+SET DEBUG_SYNC = 'RESET';
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/auto_increment_dup.test b/mysql-test/suite/innodb/t/auto_increment_dup.test
index 45e4559a038..aa399e5966d 100644
--- a/mysql-test/suite/innodb/t/auto_increment_dup.test
+++ b/mysql-test/suite/innodb/t/auto_increment_dup.test
@@ -4,11 +4,11 @@
##########################################################################
--source include/have_innodb.inc
+--source include/have_debug.inc
--source include/have_debug_sync.inc
+--source include/innodb_binlog.inc
---disable_warnings
-drop table if exists t1;
---enable_warnings
+let $stmt= `SELECT @@GLOBAL.log_bin`;
set global transaction isolation level repeatable read;
@@ -69,29 +69,28 @@ CREATE TABLE t1(
k INT,
c CHAR(1),
UNIQUE KEY(k)) ENGINE=InnoDB;
-
+
--echo #
--echo # Parallel execution
--echo #
---connect(con1, localhost, root)
--connect(con2, localhost, root)
-
--send SET DEBUG_SYNC='now WAIT_FOR write_row_done'
---connection con1
---echo #
---echo # Connection 1
---echo #
+
+--connect(con1, localhost, root)
SET DEBUG_SYNC='ha_write_row_end SIGNAL write_row_done WAIT_FOR continue';
--send INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1'
--connection con2
---echo #
---echo # Connection 2
---echo #
--reap
+
SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue';
+if ($stmt) {
--error ER_LOCK_WAIT_TIMEOUT
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+}
+if (!$stmt) {
+INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+}
--connection con1
--echo #
@@ -138,23 +137,14 @@ CREATE TABLE t1(
--enable_info
--connect(con1, localhost, root)
---connect(con2, localhost, root)
-
---connection con1
-
---echo #
---echo # Connection 1
---echo #
SET DEBUG_SYNC='ha_write_row_end SIGNAL continue2 WAIT_FOR continue1';
--send INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1'
---connection con2
---echo #
---echo # Connection 2
---echo #
+--connect(con2, localhost, root)
SET DEBUG_SYNC='ha_write_row_start WAIT_FOR continue2';
SET DEBUG_SYNC='after_mysql_insert SIGNAL continue1';
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+--disconnect con2
--connection con1
--reap
@@ -167,11 +157,9 @@ SET DEBUG_SYNC='RESET';
SELECT * FROM t1 ORDER BY k;
--disconnect con1
---disconnect con2
--connection default
DROP TABLE t1;
set global transaction isolation level repeatable read;
-
diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test
index 7a8a9295ee7..6e8658c4e3e 100644
--- a/mysql-test/suite/innodb/t/foreign_key.test
+++ b/mysql-test/suite/innodb/t/foreign_key.test
@@ -138,9 +138,62 @@ SET FOREIGN_KEY_CHECKS=DEFAULT;
LOCK TABLE staff WRITE;
UNLOCK TABLES;
DROP TABLES staff, store;
+
SET FOREIGN_KEY_CHECKS=1;
--echo #
+--echo # MDEV-17531 Crash in RENAME TABLE with FOREIGN KEY and FULLTEXT INDEX
+--echo #
+
+--disable_query_log
+call mtr.add_suppression("InnoDB: Possible reasons:");
+call mtr.add_suppression("InnoDB: \\([12]\\) Table ");
+call mtr.add_suppression("InnoDB: If table `test`\\.`t2` is a temporary table");
+--enable_query_log
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE DATABASE best;
+CREATE TABLE t3 (a INT PRIMARY KEY,
+CONSTRAINT t2_ibfk_1 FOREIGN KEY (a) REFERENCES t1(a)) ENGINE=InnoDB;
+CREATE TABLE best.t2 (a INT PRIMARY KEY, b TEXT, FULLTEXT INDEX(b),
+FOREIGN KEY (a) REFERENCES test.t1(a)) ENGINE=InnoDB;
+--replace_regex /Table '.*t2'/Table 't2'/
+--error ER_TABLE_EXISTS_ERROR
+RENAME TABLE best.t2 TO test.t2;
+SHOW CREATE TABLE best.t2;
+DROP DATABASE best;
+
+--echo #
+--echo # MDEV-17541 KILL QUERY during lock wait in FOREIGN KEY check hangs
+--echo #
+connect (fk, localhost, root,,);
+INSERT INTO t1 SET a=1;
+BEGIN;
+DELETE FROM t1;
+
+connection default;
+let $ID= `SELECT @id := CONNECTION_ID()`;
+send INSERT INTO t3 SET a=1;
+
+connection fk;
+# Check that the above SELECT is blocked
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = 'update' and info = 'INSERT INTO t3 SET a=1';
+--source include/wait_condition.inc
+let $ignore= `SELECT @id := $ID`;
+kill query @id;
+
+connection default;
+--error ER_QUERY_INTERRUPTED
+reap;
+disconnect fk;
+
+DROP TABLE t3,t1;
+
+--echo # Start of 10.2 tests
+
+--echo #
--echo # MDEV-13246 Stale rows despite ON DELETE CASCADE constraint
--echo #
@@ -228,7 +281,6 @@ DELETE FROM t1 WHERE id = 1;
--connection con1
COMMIT;
---disconnect con1
--connection default
SELECT * FROM t2;
@@ -288,8 +340,6 @@ insert into t1 values(1, 1);
insert into t2(f1) values(1);
drop table t2, t1;
---source include/wait_until_count_sessions.inc
-
#
# MDEV-12669 Circular foreign keys cause a loop and OOM upon LOCK TABLE
#
@@ -308,8 +358,44 @@ CREATE TABLE store (
UNIQUE KEY idx_unique_manager (manager_staff_id),
CONSTRAINT fk_store_staff FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB;
-SET FOREIGN_KEY_CHECKS=DEFAULT;
LOCK TABLE staff WRITE;
UNLOCK TABLES;
DROP TABLES staff, store;
+SET FOREIGN_KEY_CHECKS=1;
+
+--echo #
+--echo # MDEV-17541 KILL QUERY during lock wait in FOREIGN KEY check hangs
+--echo #
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT PRIMARY KEY, FOREIGN KEY (a) REFERENCES t1(a))
+ENGINE=InnoDB;
+
+connection con1;
+INSERT INTO t1 SET a=1;
+BEGIN;
+DELETE FROM t1;
+
+connection default;
+let $ID= `SELECT @id := CONNECTION_ID()`;
+send INSERT INTO t2 SET a=1;
+
+connection con1;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = 'update' and info = 'INSERT INTO t2 SET a=1';
+--source include/wait_condition.inc
+let $ignore= `SELECT @id := $ID`;
+kill query @id;
+
+connection default;
+--error ER_QUERY_INTERRUPTED
+reap;
+disconnect con1;
+
+DROP TABLE t2,t1;
+
+--echo # End of 10.2 tests
+
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb/t/innodb-alter-debug.test b/mysql-test/suite/innodb/t/innodb-alter-debug.test
index a779aecb71f..5c8025265e5 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-debug.test
@@ -64,7 +64,6 @@ set DEBUG_SYNC = 'now WAIT_FOR s1';
--error ER_DUP_ENTRY
update t1 set a=1 where id=2;
SET DEBUG_SYNC = 'now SIGNAL s2';
-disconnect con1;
--echo /* connection default */
connection default;
@@ -75,5 +74,29 @@ SET DEBUG_SYNC = 'RESET';
drop table t1;
+--echo #
+--echo # Bug #27753193 ASSERTION `PREBUILT->TRX->ERROR_KEY_NUM <
+--echo # HA_ALTER_INFO->KEY_COUNT'
+
+CREATE TABLE t1 (a INT, UNIQUE KEY(a)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+SET DEBUG_SYNC = 'row_log_table_apply1_before signal S1 WAIT_FOR S2';
+send ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
+
+connection con1;
+SET DEBUG_SYNC = 'now WAIT_FOR S1';
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1);
+SET DEBUG_SYNC = 'now SIGNAL S2';
+disconnect con1;
+
+CONNECTION default;
+--error ER_DUP_ENTRY
+reap;
+SET DEBUG_SYNC='RESET';
+
+DROP TABLE t1;
+
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb/t/innodb-alter.test b/mysql-test/suite/innodb/t/innodb-alter.test
index 4f2ea5f3540..a7f1eb56dce 100644
--- a/mysql-test/suite/innodb/t/innodb-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-alter.test
@@ -442,15 +442,110 @@ CREATE TABLE t2(c2 INT NOT NULL, FOREIGN KEY(c2) REFERENCES t1(c1))ENGINE=INNODB
SHOW CREATE TABLE t1;
SHOW CREATE TABLE t2;
ALTER TABLE t1 CHANGE COLUMN c1 C1 INT;
+ALTER TABLE t2 CHANGE COLUMN c2 C2 INT;
SHOW CREATE TABLE t1;
SHOW CREATE TABLE t2;
-# FIXME: MDEV-13671 InnoDB should use case-insensitive column name comparisons
-# like the rest of the server
-#ALTER TABLE t1 CHANGE COLUMN C1 c5 INT;
+ALTER TABLE t1 CHANGE COLUMN C1 c5 INT;
+ALTER TABLE t2 CHANGE COLUMN C2 c6 INT;
SHOW CREATE TABLE t1;
SHOW CREATE TABLE t2;
+
+SELECT C.NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS C INNER JOIN
+ INFORMATION_SCHEMA.INNODB_SYS_TABLES T ON C.TABLE_ID=T.TABLE_ID
+ WHERE T.NAME='test/t1';
+
+SELECT F.NAME FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS F INNER JOIN
+ INFORMATION_SCHEMA.INNODB_SYS_INDEXES I ON F.INDEX_ID=I.INDEX_ID INNER JOIN
+ INFORMATION_SCHEMA.INNODB_SYS_TABLES T ON I.TABLE_ID=T.TABLE_ID
+ WHERE T.NAME='test/t1' AND I.NAME='PRIMARY';
+
+SELECT C.REF_COL_NAME, C.FOR_COL_NAME FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS C INNER JOIN
+ INFORMATION_SCHEMA.INNODB_SYS_FOREIGN F ON C.ID=F.ID
+ WHERE F.FOR_NAME='test/t2';
+
+DROP TABLE t2, t1;
+--echo # virtual columns case too
+CREATE TABLE t1 (a INT, b INT GENERATED ALWAYS AS (a) VIRTUAL) ENGINE = InnoDB;
+ALTER TABLE t1 CHANGE COLUMN a A INT;
+SHOW CREATE TABLE t1;
+SELECT C.NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS C INNER JOIN
+ INFORMATION_SCHEMA.INNODB_SYS_TABLES T ON C.TABLE_ID=T.TABLE_ID
+ WHERE T.NAME='test/t1';
+DROP TABLE t1;
+
+
+--echo # different FOREIGN KEY cases
+CREATE TABLE t1 (
+ a INT UNIQUE KEY,
+ b INT UNIQUE KEY,
+ c INT UNIQUE KEY,
+ d INT UNIQUE KEY
+) ENGINE=INNODB;
+CREATE TABLE t2 (
+ aa INT,
+ bb INT,
+ cc INT,
+ dd INT
+) ENGINE=INNODB;
+
+INSERT INTO t1 VALUES (1, 1, 1, 1);
+INSERT INTO t2 VALUES (1, 1, 1, 1);
+
+ALTER TABLE t1 CHANGE a A INT, ALGORITHM=INPLACE;
+ALTER TABLE t1 CHANGE c C INT, ALGORITHM=INPLACE;
+ALTER TABLE t2 CHANGE cc CC INT, ALGORITHM=INPLACE;
+ALTER TABLE t2 CHANGE dd DD INT, ALGORITHM=INPLACE;
+
+SET foreign_key_checks=0;
+ALTER TABLE t2
+ ADD FOREIGN KEY(aa) REFERENCES t1(a),
+ ADD FOREIGN KEY(bb) REFERENCES t1(b),
+ ADD FOREIGN KEY(cc) REFERENCES t1(c),
+ ADD FOREIGN KEY(dd) REFERENCES t1(d),
+ ALGORITHM=INPLACE;
+
+ALTER TABLE t1 CHANGE b B INT, ALGORITHM=INPLACE;
+ALTER TABLE t2 CHANGE aa AA INT, ALGORITHM=INPLACE;
+
+--source include/restart_mysqld.inc
+
+ALTER TABLE t1 CHANGE d D INT, ALGORITHM=INPLACE;
+ALTER TABLE t2 CHANGE bb BB INT, ALGORITHM=INPLACE;
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+--error ER_ROW_IS_REFERENCED_2
+DELETE FROM t1 WHERE a=1;
+--error ER_ROW_IS_REFERENCED_2
+DELETE FROM t1 WHERE A=1;
+
+--error ER_ROW_IS_REFERENCED_2
+DELETE FROM t1 WHERE b=1;
+--error ER_ROW_IS_REFERENCED_2
+DELETE FROM t1 WHERE B=1;
+
+--error ER_ROW_IS_REFERENCED_2
+DELETE FROM t1 WHERE c=1;
+--error ER_ROW_IS_REFERENCED_2
+DELETE FROM t1 WHERE C=1;
+
+--error ER_ROW_IS_REFERENCED_2
+DELETE FROM t1 WHERE d=1;
+--error ER_ROW_IS_REFERENCED_2
+DELETE FROM t1 WHERE D=1;
+
DROP TABLE t2, t1;
+--echo # virtual columns case too
+CREATE TABLE t1 (a INT, b INT GENERATED ALWAYS AS (a) VIRTUAL) ENGINE = InnoDB;
+ALTER TABLE t1 CHANGE COLUMN a A INT;
+SHOW CREATE TABLE t1;
+SELECT C.NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS C INNER JOIN
+ INFORMATION_SCHEMA.INNODB_SYS_TABLES T ON C.TABLE_ID=T.TABLE_ID
+ WHERE T.NAME='test/t1';
+DROP TABLE t1;
+
+
--echo #
--echo # BUG 20029625 - HANDLE_FATAL_SIGNAL (SIG=11) IN
--echo # DICT_MEM_TABLE_COL_RENAME_LOW
diff --git a/mysql-test/suite/innodb/t/table_flags.test b/mysql-test/suite/innodb/t/table_flags.test
index 6c9b5e7a8cd..284589a17c8 100644
--- a/mysql-test/suite/innodb/t/table_flags.test
+++ b/mysql-test/suite/innodb/t/table_flags.test
@@ -1,6 +1,7 @@
--source include/innodb_page_size.inc
# Embedded server tests do not support restarting
--source include/not_embedded.inc
+--source include/maybe_debug.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Table `mysql`\\.`innodb_table_stats` not found");
@@ -30,7 +31,9 @@ let bugdir= $MYSQLTEST_VARDIR/tmp/table_flags;
--let $d=$d --innodb-undo-tablespaces=0
--let $d=$d --innodb-purge-rseg-truncate-frequency=1
--let $d=$d --skip-innodb-fast-shutdown
-
+if ($have_debug) {
+--let $d=$d --debug=d,create_and_drop_garbage
+}
--let $restart_parameters=$d --innodb-stats-persistent=0
--source include/restart_mysqld.inc
diff --git a/mysql-test/suite/innodb_gis/r/rtree_concurrent_srch.result b/mysql-test/suite/innodb_gis/r/rtree_concurrent_srch.result
index 1b52059fff9..9c5db3e06aa 100644
--- a/mysql-test/suite/innodb_gis/r/rtree_concurrent_srch.result
+++ b/mysql-test/suite/innodb_gis/r/rtree_concurrent_srch.result
@@ -260,9 +260,7 @@ INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(6 6, 190 190)'));
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(7 7, 200 200)'));
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(8 8, 210 210)'));
connect a,localhost,root,,;
-SET SESSION debug="+d,rtr_pcur_move_to_next_return";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET SESSION debug_dbug='+d,rtr_pcur_move_to_next_return';
set transaction isolation level serializable;
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
diff --git a/mysql-test/suite/innodb_gis/t/rtree_concurrent_srch.test b/mysql-test/suite/innodb_gis/t/rtree_concurrent_srch.test
index c10ce368b11..43119415d47 100644
--- a/mysql-test/suite/innodb_gis/t/rtree_concurrent_srch.test
+++ b/mysql-test/suite/innodb_gis/t/rtree_concurrent_srch.test
@@ -307,7 +307,7 @@ INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(7 7, 200 200)'));
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(8 8, 210 210)'));
connect (a,localhost,root,,);
-SET SESSION debug="+d,rtr_pcur_move_to_next_return";
+SET SESSION debug_dbug='+d,rtr_pcur_move_to_next_return';
set transaction isolation level serializable;
start transaction;
diff --git a/mysql-test/suite/maria/fulltext2.result b/mysql-test/suite/maria/fulltext2.result
new file mode 100644
index 00000000000..1e4e6636ef6
--- /dev/null
+++ b/mysql-test/suite/maria/fulltext2.result
@@ -0,0 +1,86 @@
+CREATE TABLE t1 (
+i int(10) unsigned not null auto_increment primary key,
+a varchar(255) not null,
+FULLTEXT KEY (a)
+) ENGINE=Aria ROW_FORMAT=DYNAMIC MAX_ROWS=2000000000000;
+repair table t1 quick;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+select count(*) from t1 where match a against ('aaaxxx');
+count(*)
+0
+select count(*) from t1 where match a against ('aaayyy');
+count(*)
+150
+select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
+count(*)
+1024
+select count(*) from t1 where match a against ('aaayyy' in boolean mode);
+count(*)
+150
+select count(*) from t1 where match a against ('aaax*' in boolean mode);
+count(*)
+1024
+select count(*) from t1 where match a against ('aaay*' in boolean mode);
+count(*)
+150
+select count(*) from t1 where match a against ('aaa*' in boolean mode);
+count(*)
+1174
+insert t1 (a) values ('aaaxxx'),('aaayyy');
+select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
+count(*)
+1025
+select count(*) from t1 where match a against ('aaayyy');
+count(*)
+151
+insert t1 (a) values ('aaaxxx 000000');
+select count(*) from t1 where match a against ('000000');
+count(*)
+1
+delete from t1 where match a against ('000000');
+select count(*) from t1 where match a against ('000000');
+count(*)
+0
+select count(*) from t1 where match a against ('aaaxxx');
+count(*)
+0
+select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
+count(*)
+1025
+select count(*) from t1 where match a against ('aaayyy' in boolean mode);
+count(*)
+151
+select count(*) from t1 where a = 'aaaxxx';
+count(*)
+1025
+select count(*) from t1 where a = 'aaayyy';
+count(*)
+151
+insert t1 (a) values ('aaaxxx 000000');
+select count(*) from t1 where match a against ('000000');
+count(*)
+1
+select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
+count(*)
+1026
+update t1 set a='aaaxxx' where a = 'aaayyy';
+select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
+count(*)
+1177
+select count(*) from t1 where match a against ('aaayyy' in boolean mode);
+count(*)
+0
+drop table t1;
diff --git a/mysql-test/suite/maria/fulltext2.test b/mysql-test/suite/maria/fulltext2.test
new file mode 100644
index 00000000000..060b748eb4f
--- /dev/null
+++ b/mysql-test/suite/maria/fulltext2.test
@@ -0,0 +1,77 @@
+#
+# test of new fulltext search features
+#
+
+let collation=utf8_unicode_ci;
+source include/have_collation.inc;
+
+#
+# two-level tree
+#
+
+CREATE TABLE t1 (
+ i int(10) unsigned not null auto_increment primary key,
+ a varchar(255) not null,
+ FULLTEXT KEY (a)
+) ENGINE=Aria ROW_FORMAT=DYNAMIC MAX_ROWS=2000000000000;
+
+# two-level entry, second-level tree with depth 2
+disable_query_log;
+let $1=1024;
+while ($1)
+{
+ eval insert t1 (a) values ('aaaxxx');
+ dec $1;
+}
+
+# one-level entry (entries)
+let $1=150;
+while ($1)
+{
+ eval insert t1 (a) values ('aaayyy');
+ dec $1;
+}
+enable_query_log;
+
+repair table t1 quick;
+check table t1;
+repair table t1;
+check table t1;
+repair table t1;
+
+select count(*) from t1 where match a against ('aaaxxx');
+select count(*) from t1 where match a against ('aaayyy');
+select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
+select count(*) from t1 where match a against ('aaayyy' in boolean mode);
+
+select count(*) from t1 where match a against ('aaax*' in boolean mode);
+select count(*) from t1 where match a against ('aaay*' in boolean mode);
+select count(*) from t1 where match a against ('aaa*' in boolean mode);
+
+# mi_write:
+insert t1 (a) values ('aaaxxx'),('aaayyy');
+# call to enlarge_root() below
+select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
+select count(*) from t1 where match a against ('aaayyy');
+
+# mi_delete
+insert t1 (a) values ('aaaxxx 000000');
+select count(*) from t1 where match a against ('000000');
+delete from t1 where match a against ('000000');
+select count(*) from t1 where match a against ('000000');
+select count(*) from t1 where match a against ('aaaxxx');
+select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
+select count(*) from t1 where match a against ('aaayyy' in boolean mode);
+# double-check without index
+select count(*) from t1 where a = 'aaaxxx';
+select count(*) from t1 where a = 'aaayyy';
+
+# update
+insert t1 (a) values ('aaaxxx 000000');
+select count(*) from t1 where match a against ('000000');
+select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
+update t1 set a='aaaxxx' where a = 'aaayyy';
+select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
+select count(*) from t1 where match a against ('aaayyy' in boolean mode);
+
+drop table t1;
diff --git a/mysql-test/suite/rpl/include/rpl_lower_case_table_names.test b/mysql-test/suite/rpl/include/rpl_lower_case_table_names.test
new file mode 100644
index 00000000000..fa48142ee91
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_lower_case_table_names.test
@@ -0,0 +1,141 @@
+# BUG#37656
+#
+# This test aims at checking whether lower_case_table_names=1 option works
+# for database names and table names.
+#
+# This test checks the following (when lower_case_table_names=1 is set on slave):
+# (i) creating a database on upper case on master results in lower case
+# database name on slave
+# (ii) creating tables with upper case names on master results in lower case
+# table names on slave
+# (iii) loading data infile into capitalized table name on master replicates to
+# lower case table name on slave
+# (iv) Propagating changes from upper case table names on into correspondent
+# lower case table names on slave works.
+
+
+# setup: create database and tables
+-- echo ******** [ MASTER ] ********
+-- let $dbname_upper= BUG_37656
+-- let $dbname_lower= `SELECT LOWER('$dbname_upper')`
+-- eval CREATE DATABASE $dbname_upper
+-- eval use $dbname_upper
+
+# assert: database names are in upper case in master and lower
+# case in slave
+-- eval show databases like '$dbname_upper'
+sync_slave_with_master;
+-- echo ******** [ SLAVE ] ********
+--eval show databases like '$dbname_lower'
+
+-- connection master
+-- echo ******** [ MASTER ] ********
+CREATE TABLE T1 (a int);
+-- eval CREATE TABLE T2 (b int) ENGINE=$engine
+CREATE TABLE T3 (txt TEXT);
+
+# assert: that tables exist on master with upper case names
+show tables;
+
+# assert: that tables exist on slave but with lower case names
+-- sync_slave_with_master
+-- echo ******** [ SLAVE ] ********
+-- eval use $dbname_lower
+show tables;
+
+# action: lets create t1 for asserting below that t1 does not get changes
+# from master (slave configured with --replicate-ignore-db=$dbname_lower.t1)
+CREATE TABLE t1 (a INT);
+
+# action: fill data into tables
+-- connection master
+-- echo ******** [ MASTER ] ********
+-- eval use $dbname_upper
+INSERT INTO T1 VALUES (1);
+INSERT INTO T2 VALUES (1);
+if (`SELECT @@session.binlog_format != 'ROW'`)
+{
+ -- eval LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE $dbname_upper.T3
+}
+
+if (`SELECT @@session.binlog_format = 'ROW'`)
+{
+ use test;
+ -- eval INSERT INTO $dbname_upper.T1 VALUES (2)
+ -- eval INSERT INTO $dbname_upper.T2 VALUES (2)
+ -- eval LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE $dbname_upper.T3
+}
+# assert: lower case tables on lower case database on slave
+# get updates from upper case tables on upper case
+# database on master
+-- sync_slave_with_master
+-- echo ******** [ SLAVE ] ********
+
+# assert: changes for slave's t1 were filterd out
+if (`SELECT count(*) != 0 FROM t1`)
+{
+ -- echo UNEXPECTED DATA on $dbname_lower.t1 as table is filtered by replicate-ignore-table rules
+}
+
+-- let $diff_tables=master:$dbname_upper.T2, slave:$dbname_lower.t2
+-- source include/diff_tables.inc
+
+-- let $diff_tables=master:$dbname_upper.T3, slave:$dbname_lower.t3
+-- source include/diff_tables.inc
+
+# clean up
+-- connection master
+-- echo ******** [ MASTER ] ********
+-- eval DROP DATABASE $dbname_upper
+-- sync_slave_with_master
+
+
+#
+# BUG#50653: drop procedure implicitely treats db name in a case sensitive way
+#
+
+-- connection master
+
+-- let $dbname= B50653
+-- let $procname= b50653_proc
+
+-- eval CREATE DATABASE $dbname
+-- eval USE $dbname
+-- eval CREATE PROCEDURE $procname() BEGIN SELECT 1; END
+
+if (`SELECT count(*) = 1 FROM mysql.proc WHERE name like '$dbname'`)
+{
+ -- die Procedure not created on MASTER
+}
+
+-- sync_slave_with_master
+if (`SELECT count(*) = 1 FROM mysql.proc WHERE name like '$dbname'`)
+{
+ -- die Procedure not created on SLAVE
+}
+
+-- connection master
+-- eval DROP PROCEDURE $procname
+
+if (`SELECT count(*) FROM mysql.proc WHERE name like '$dbname'`)
+{
+ -- die Procedure not dropped on MASTER
+}
+
+-- sync_slave_with_master
+if (`SELECT count(*) FROM mysql.proc WHERE name like '$dbname'`)
+{
+ -- die Procedure not dropped on SLAVE
+}
+
+-- let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
+if ($last_error)
+{
+ -- die UNEXPECTED SLAVE SQL error: $last_error
+}
+
+-- connection master
+-- eval DROP DATABASE $dbname
+-- sync_slave_with_master
+
+-- source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_15919.result b/mysql-test/suite/rpl/r/rpl_15919.result
new file mode 100644
index 00000000000..4d2aaac44ef
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_15919.result
@@ -0,0 +1,19 @@
+include/master-slave.inc
+[connection master]
+connection master;
+create table RPL(a int);
+insert into RPL values(1);
+connection slave;
+select * from rpl;
+a
+1
+insert into RPL values(3);
+insert into rpl values(4);
+select * from rpl;
+a
+1
+3
+4
+connection master;
+drop table RPL;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_lcase_tblnames_rewrite_db.result b/mysql-test/suite/rpl/r/rpl_lcase_tblnames_rewrite_db.result
new file mode 100644
index 00000000000..f7010750b18
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_lcase_tblnames_rewrite_db.result
@@ -0,0 +1,38 @@
+include/master-slave.inc
+[connection master]
+SET SQL_LOG_BIN=0;
+CREATE DATABASE B37656;
+SET SQL_LOG_BIN=1;
+connection slave;
+CREATE DATABASE BUG37656;
+### action: show that database on slave is created in lowercase
+SHOW DATABASES LIKE '%37656';
+Database (%37656)
+bug37656
+connection master;
+USE B37656;
+CREATE TABLE T1 (a int);
+INSERT INTO T1 VALUES (1);
+### assertion: master contains capitalized case table
+SHOW TABLES;
+Tables_in_B37656
+T1
+connection slave;
+use bug37656;
+### assertion: slave contains lowered case table
+SHOW TABLES;
+Tables_in_bug37656
+t1
+### assertion: master and slave tables do not differ
+include/diff_tables.inc [master:B37656.T1, slave:bug37656.t1]
+connection master;
+SET SQL_LOG_BIN=0;
+DROP DATABASE B37656;
+SET SQL_LOG_BIN=1;
+SHOW DATABASES LIKE '%37656';
+Database (%37656)
+connection slave;
+DROP DATABASE BUG37656;
+SHOW DATABASES LIKE '%37656';
+Database (%37656)
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_lcase_tblnames.result b/mysql-test/suite/rpl/r/rpl_row_lcase_tblnames.result
new file mode 100644
index 00000000000..1184b77d8f6
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_lcase_tblnames.result
@@ -0,0 +1,60 @@
+include/master-slave.inc
+[connection master]
+******** [ MASTER ] ********
+CREATE DATABASE BUG_37656;
+use BUG_37656;
+show databases like 'BUG_37656';
+Database (BUG_37656)
+BUG_37656
+connection slave;
+******** [ SLAVE ] ********
+show databases like 'bug_37656';
+Database (bug_37656)
+bug_37656
+connection master;
+******** [ MASTER ] ********
+CREATE TABLE T1 (a int);
+CREATE TABLE T2 (b int) ENGINE=InnoDB;
+CREATE TABLE T3 (txt TEXT);
+show tables;
+Tables_in_BUG_37656
+T1
+T2
+T3
+connection slave;
+******** [ SLAVE ] ********
+use bug_37656;
+show tables;
+Tables_in_bug_37656
+t2
+t3
+CREATE TABLE t1 (a INT);
+connection master;
+******** [ MASTER ] ********
+use BUG_37656;
+INSERT INTO T1 VALUES (1);
+INSERT INTO T2 VALUES (1);
+use test;
+INSERT INTO BUG_37656.T1 VALUES (2);
+INSERT INTO BUG_37656.T2 VALUES (2);
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE BUG_37656.T3;
+connection slave;
+******** [ SLAVE ] ********
+include/diff_tables.inc [master:BUG_37656.T2, slave:bug_37656.t2]
+include/diff_tables.inc [master:BUG_37656.T3, slave:bug_37656.t3]
+connection master;
+******** [ MASTER ] ********
+DROP DATABASE BUG_37656;
+connection slave;
+connection master;
+CREATE DATABASE B50653;
+USE B50653;
+CREATE PROCEDURE b50653_proc() BEGIN SELECT 1; END;
+connection slave;
+connection master;
+DROP PROCEDURE b50653_proc;
+connection slave;
+connection master;
+DROP DATABASE B50653;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_lcase_tblnames.result b/mysql-test/suite/rpl/r/rpl_stm_lcase_tblnames.result
new file mode 100644
index 00000000000..abb93fca45c
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stm_lcase_tblnames.result
@@ -0,0 +1,57 @@
+include/master-slave.inc
+[connection master]
+******** [ MASTER ] ********
+CREATE DATABASE BUG_37656;
+use BUG_37656;
+show databases like 'BUG_37656';
+Database (BUG_37656)
+BUG_37656
+connection slave;
+******** [ SLAVE ] ********
+show databases like 'bug_37656';
+Database (bug_37656)
+bug_37656
+connection master;
+******** [ MASTER ] ********
+CREATE TABLE T1 (a int);
+CREATE TABLE T2 (b int) ENGINE=InnoDB;
+CREATE TABLE T3 (txt TEXT);
+show tables;
+Tables_in_BUG_37656
+T1
+T2
+T3
+connection slave;
+******** [ SLAVE ] ********
+use bug_37656;
+show tables;
+Tables_in_bug_37656
+t2
+t3
+CREATE TABLE t1 (a INT);
+connection master;
+******** [ MASTER ] ********
+use BUG_37656;
+INSERT INTO T1 VALUES (1);
+INSERT INTO T2 VALUES (1);
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE BUG_37656.T3;
+connection slave;
+******** [ SLAVE ] ********
+include/diff_tables.inc [master:BUG_37656.T2, slave:bug_37656.t2]
+include/diff_tables.inc [master:BUG_37656.T3, slave:bug_37656.t3]
+connection master;
+******** [ MASTER ] ********
+DROP DATABASE BUG_37656;
+connection slave;
+connection master;
+CREATE DATABASE B50653;
+USE B50653;
+CREATE PROCEDURE b50653_proc() BEGIN SELECT 1; END;
+connection slave;
+connection master;
+DROP PROCEDURE b50653_proc;
+connection slave;
+connection master;
+DROP DATABASE B50653;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
index 8b0280070ae..de16b24dcd5 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
@@ -12916,10 +12916,6 @@ ROLLBACK;
SET AUTOCOMMIT=1;
connection slave;
include/diff_tables.inc [master:t1, slave:t1]
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
connection master;
DROP TABLE `t1`;
connection slave;
diff --git a/mysql-test/suite/rpl/t/rpl_15919-slave.opt b/mysql-test/suite/rpl/t/rpl_15919-slave.opt
new file mode 100644
index 00000000000..62ab6dad1e0
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_15919-slave.opt
@@ -0,0 +1 @@
+--lower_case_table_names=1
diff --git a/mysql-test/suite/rpl/t/rpl_15919.test b/mysql-test/suite/rpl/t/rpl_15919.test
new file mode 100644
index 00000000000..a5b25929ad0
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_15919.test
@@ -0,0 +1,18 @@
+--source include/have_case_sensitive_file_system.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--connection master
+create table RPL(a int);
+insert into RPL values(1);
+
+--sync_slave_with_master
+select * from rpl;
+insert into RPL values(3);
+insert into rpl values(4);
+select * from rpl;
+
+--connection master
+drop table RPL;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db-slave.opt b/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db-slave.opt
new file mode 100644
index 00000000000..0031a57a693
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db-slave.opt
@@ -0,0 +1 @@
+--lower-case-table-names=1 "--replicate-rewrite-db=b37656->bug37656"
diff --git a/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test b/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test
new file mode 100644
index 00000000000..9c804d8206a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test
@@ -0,0 +1,60 @@
+# BUG#37656
+#
+# DESCRIPTION
+#
+#
+# This test case is tests whether replication works properly when
+# slave is configured with --lower-case-table-names=1 and replication
+# rewrite rules are in effect.
+#
+# It checks four issues:
+#
+# (i) master contains capitalized table name
+#
+# (ii) slave contains lowered case table name
+#
+# (iii) master and slave tables do not differ
+#
+-- source include/master-slave.inc
+-- source include/not_windows.inc
+
+SET SQL_LOG_BIN=0;
+CREATE DATABASE B37656;
+SET SQL_LOG_BIN=1;
+
+-- connection slave
+CREATE DATABASE BUG37656;
+
+-- echo ### action: show that database on slave is created in lowercase
+SHOW DATABASES LIKE '%37656';
+
+-- connection master
+USE B37656;
+CREATE TABLE T1 (a int);
+INSERT INTO T1 VALUES (1);
+
+-- echo ### assertion: master contains capitalized case table
+SHOW TABLES;
+
+-- sync_slave_with_master
+
+use bug37656;
+
+-- echo ### assertion: slave contains lowered case table
+SHOW TABLES;
+
+-- echo ### assertion: master and slave tables do not differ
+let $diff_tables= master:B37656.T1, slave:bug37656.t1;
+
+-- source include/diff_tables.inc
+
+-- connection master
+SET SQL_LOG_BIN=0;
+DROP DATABASE B37656;
+SET SQL_LOG_BIN=1;
+SHOW DATABASES LIKE '%37656';
+
+-- connection slave
+DROP DATABASE BUG37656;
+SHOW DATABASES LIKE '%37656';
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames-slave.opt b/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames-slave.opt
new file mode 100644
index 00000000000..7624b013dcd
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames-slave.opt
@@ -0,0 +1 @@
+--replicate-do-db=bug_37656 --replicate-ignore-table=buG_37656.T1 --replicate-do-table=bUg_37656.T2 --replicate-do-table=bUg_37656.T3 --lower-case-table-names=1
diff --git a/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test b/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test
new file mode 100644
index 00000000000..44c04dd62d3
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test
@@ -0,0 +1,12 @@
+# BUG#37656
+#
+# For details look into extra/rpl_tests/rpl_lower_case_table_names.test
+#
+
+-- source include/master-slave.inc
+-- source include/have_innodb.inc
+-- source include/not_windows.inc
+-- source include/have_binlog_format_row.inc
+
+-- let $engine=InnoDB
+-- source include/rpl_lower_case_table_names.test
diff --git a/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames-slave.opt b/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames-slave.opt
new file mode 100644
index 00000000000..8be29bbe976
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames-slave.opt
@@ -0,0 +1 @@
+--replicate-do-db=bug_37656 --replicate-ignore-table=bug_37656.t1 --replicate-do-table=bug_37656.t2 --replicate-do-table=bug_37656.t3 --lower-case-table-names=1
diff --git a/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test b/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test
new file mode 100644
index 00000000000..305c5b4b530
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test
@@ -0,0 +1,12 @@
+# BUG#37656
+#
+# For details look into extra/rpl_tests/rpl_lower_case_table_names.test
+#
+
+-- source include/master-slave.inc
+-- source include/have_innodb.inc
+-- source include/not_windows.inc
+-- source include/have_binlog_format_mixed_or_statement.inc
+
+-- let $engine=InnoDB
+-- source include/rpl_lower_case_table_names.test
diff --git a/mysql-test/suite/sql_sequence/create.result b/mysql-test/suite/sql_sequence/create.result
index cb683d158d8..55d45a75abf 100644
--- a/mysql-test/suite/sql_sequence/create.result
+++ b/mysql-test/suite/sql_sequence/create.result
@@ -644,3 +644,12 @@ TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
DROP SEQUENCE seq1;
CREATE TEMPORARY SEQUENCE seq1 ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
DROP TEMPORARY SEQUENCE seq1;
+#
+# MDEV-17503 CREATE SEQUENCE failed with innodb_force_primary_key =1
+#
+set global innodb_force_primary_key =1;
+CREATE SEQUENCE s1 START WITH 100 INCREMENT BY 10 ENGINE=innodb;
+set global innodb_force_primary_key=default;
+ALTER TABLE s1 ADD PRIMARY KEY (next_not_cached_value);
+ERROR HY000: Sequence 'test.s1' table structure is invalid (Sequence tables cannot have any keys)
+DROP SEQUENCE s1;
diff --git a/mysql-test/suite/sql_sequence/create.test b/mysql-test/suite/sql_sequence/create.test
index b2562058ca6..1bc62117526 100644
--- a/mysql-test/suite/sql_sequence/create.test
+++ b/mysql-test/suite/sql_sequence/create.test
@@ -462,3 +462,14 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME='test/seq1';
DROP SEQUENCE seq1;
CREATE TEMPORARY SEQUENCE seq1 ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
DROP TEMPORARY SEQUENCE seq1;
+
+--echo #
+--echo # MDEV-17503 CREATE SEQUENCE failed with innodb_force_primary_key =1
+--echo #
+
+set global innodb_force_primary_key =1;
+CREATE SEQUENCE s1 START WITH 100 INCREMENT BY 10 ENGINE=innodb;
+set global innodb_force_primary_key=default;
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+ALTER TABLE s1 ADD PRIMARY KEY (next_not_cached_value);
+DROP SEQUENCE s1;
diff --git a/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result b/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result
index 0a7c9a8169d..2e6b730f104 100644
--- a/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result
@@ -14,7 +14,7 @@ INSERT INTO t1 VALUES('3','1','1');
INSERT INTO t1 VALUES('4','1','1');
INSERT INTO t1 VALUES('5','1','1');
INSERT INTO t1 VALUES('6','1','1');
-LOCK TABLE v1 WRITE;
+LOCK TABLE v1 READ;
connection con1;
INSERT DELAYED INTO t1 VALUES('7','1','1');
INSERT DELAYED INTO t1 VALUES('8','1','1');
@@ -83,7 +83,7 @@ INSERT INTO t1 VALUES('3');
INSERT INTO t1 VALUES('4');
INSERT INTO t1 VALUES('5');
INSERT INTO t1 VALUES('6');
-LOCK TABLE v1 WRITE;
+LOCK TABLE v1 READ;
connection con1;
Asynchronous execute
INSERT DELAYED INTO t1 VALUES('7');
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_32.result b/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_32.result
new file mode 100644
index 00000000000..b3bec1eecdd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_32.result
@@ -0,0 +1,7 @@
+set global innodb_ft_result_cache_limit=5000000000;
+Warnings:
+Warning 1292 Truncated incorrect innodb_ft_result_cache_limit value: '5000000000'
+select @@innodb_ft_result_cache_limit;
+@@innodb_ft_result_cache_limit
+4294967295
+set global innodb_ft_result_cache_limit=2000000000;
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_64.result b/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_64.result
new file mode 100644
index 00000000000..c86331a8a1c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_64.result
@@ -0,0 +1,5 @@
+set global innodb_ft_result_cache_limit=5000000000;
+select @@innodb_ft_result_cache_limit;
+@@innodb_ft_result_cache_limit
+5000000000
+set global innodb_ft_result_cache_limit=2000000000;
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic,32bit.rdiff b/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic,32bit.rdiff
new file mode 100644
index 00000000000..8b670da6487
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic,32bit.rdiff
@@ -0,0 +1,13 @@
+--- innodb_ft_result_cache_limit_basic.result
++++ innodb_ft_result_cache_limit_basic,32bit.reject
+@@ -31,7 +31,9 @@
+ @@innodb_ft_result_cache_limit
+ 4294967295
+ set global innodb_ft_result_cache_limit=4*1024*1024*1024;
++Warnings:
++Warning 1292 Truncated incorrect innodb_ft_result_cache_limit value: '4294967296'
+ select @@innodb_ft_result_cache_limit;
+ @@innodb_ft_result_cache_limit
+-4294967296
++4294967295
+ set global innodb_ft_result_cache_limit = @save_limit;
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result
index 59f6431a65e..66748507877 100644
--- a/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result
@@ -15,6 +15,7 @@ INNODB_FT_RESULT_CACHE_LIMIT 2000000000
select * from information_schema.session_variables where variable_name='innodb_ft_result_cache_limit';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FT_RESULT_CACHE_LIMIT 2000000000
+SET @save_limit = @@innodb_ft_result_cache_limit;
set global innodb_ft_result_cache_limit=900000;
Warnings:
Warning 1292 Truncated incorrect innodb_ft_result_cache_limit value: '900000'
@@ -30,9 +31,7 @@ select @@innodb_ft_result_cache_limit;
@@innodb_ft_result_cache_limit
4294967295
set global innodb_ft_result_cache_limit=4*1024*1024*1024;
-Warnings:
-Warning 1292 Truncated incorrect innodb_ft_result_cache_limit value: '4294967296'
select @@innodb_ft_result_cache_limit;
@@innodb_ft_result_cache_limit
-4294967295
-set global innodb_ft_result_cache_limit=2000000000;
+4294967296
+set global innodb_ft_result_cache_limit = @save_limit;
diff --git a/mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result
index 04af87ae369..c869de7b837 100644
--- a/mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result
@@ -20,7 +20,7 @@ INSERT INTO t1 VALUES('3');
INSERT INTO t1 VALUES('4');
INSERT INTO t1 VALUES('5');
INSERT INTO t1 VALUES('6');
-LOCK TABLE v1 WRITE;
+LOCK TABLE v1 WRITE CONCURRENT;
connection con1;
** Asynchronous Execution **
UPDATE t1 SET a = CONCAT(a,"-updated");|
@@ -56,7 +56,7 @@ INSERT INTO t1 VALUES('3');
INSERT INTO t1 VALUES('4');
INSERT INTO t1 VALUES('5');
INSERT INTO t1 VALUES('6');
-LOCK TABLE v1 WRITE;
+LOCK TABLE v1 READ;
connection con1;
** Asynchronous Execution **
UPDATE t1 SET a = CONCAT(a,"-updated");|
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
index d99d0aeaf35..2f5fb044f1b 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
@@ -1,6 +1,6 @@
--- suite/sys_vars/r/sysvars_innodb.result 2017-09-14 10:37:46.000000000 +0000
+++ suite/sys_vars/r/sysvars_innodb,32bit.reject 2017-09-26 13:13:23.685012523 +0000
-@@ -54,7 +54,7 @@
+@@ -56,7 +56,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 8
VARIABLE_SCOPE GLOBAL
@@ -9,7 +9,7 @@
VARIABLE_COMMENT Number of InnoDB Adaptive Hash Index Partitions (default 8)
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 512
-@@ -68,7 +68,7 @@
+@@ -70,7 +70,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 150000
VARIABLE_SCOPE GLOBAL
@@ -18,7 +18,7 @@
VARIABLE_COMMENT The upper limit of the sleep delay in usec. Value of 0 disables it.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000000
-@@ -82,7 +82,7 @@
+@@ -84,7 +84,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 64
VARIABLE_SCOPE GLOBAL
@@ -27,7 +27,7 @@
VARIABLE_COMMENT Data file autoextend increment in megabytes
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1000
-@@ -96,7 +96,7 @@
+@@ -98,7 +98,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
@@ -36,7 +36,7 @@
VARIABLE_COMMENT The AUTOINC lock modes supported by InnoDB: 0 => Old style AUTOINC locking (for backward compatibility); 1 => New style AUTOINC locking; 2 => No AUTOINC locking (unsafe for SBR)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2
-@@ -180,10 +180,10 @@
+@@ -182,10 +182,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 134217728
VARIABLE_SCOPE GLOBAL
@@ -49,7 +49,7 @@
NUMERIC_BLOCK_SIZE 1048576
ENUM_VALUE_LIST NULL
READ_ONLY YES
-@@ -222,7 +222,7 @@
+@@ -224,7 +224,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 25
VARIABLE_SCOPE GLOBAL
@@ -58,7 +58,7 @@
VARIABLE_COMMENT Dump only the hottest N% of each buffer pool, defaults to 25
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100
-@@ -264,7 +264,7 @@
+@@ -266,7 +266,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -67,7 +67,7 @@
VARIABLE_COMMENT Number of buffer pool instances, set to higher value on high-end machines to increase scalability
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 64
-@@ -334,7 +334,7 @@
+@@ -336,7 +336,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -76,7 +76,7 @@
VARIABLE_COMMENT A number between [0, 100] that tells how oftern buffer pool dump status in percentages should be printed. E.g. 10 means that buffer pool dump status is printed when every 10% of number of buffer pool pages are dumped. Default is 0 (only start and end status is printed).
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 100
-@@ -446,7 +446,7 @@
+@@ -448,7 +448,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -85,7 +85,7 @@
VARIABLE_COMMENT Helps in performance tuning in heavily concurrent environments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000
-@@ -488,7 +488,7 @@
+@@ -490,7 +490,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 5
VARIABLE_SCOPE GLOBAL
@@ -94,7 +94,7 @@
VARIABLE_COMMENT If the compression failure rate of a table is greater than this number more padding is added to the pages to reduce the failures. A value of zero implies no padding
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 100
-@@ -516,7 +516,7 @@
+@@ -518,7 +518,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 50
VARIABLE_SCOPE GLOBAL
@@ -103,7 +103,7 @@
VARIABLE_COMMENT Percentage of empty space on a data page that can be reserved to make the page compressible.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 75
-@@ -530,10 +530,10 @@
+@@ -532,10 +532,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 5000
VARIABLE_SCOPE GLOBAL
@@ -116,7 +116,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -796,7 +796,7 @@
+@@ -798,7 +798,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 120
VARIABLE_SCOPE GLOBAL
@@ -125,7 +125,7 @@
VARIABLE_COMMENT Number of pages reserved in doublewrite buffer for batch flushing
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 127
-@@ -894,7 +894,7 @@
+@@ -896,7 +896,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 600
VARIABLE_SCOPE GLOBAL
@@ -134,7 +134,7 @@
VARIABLE_COMMENT Maximum number of seconds that semaphore times out in InnoDB.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -936,7 +936,7 @@
+@@ -938,7 +938,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -143,7 +143,7 @@
VARIABLE_COMMENT Make the first page of the given tablespace dirty.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -950,7 +950,7 @@
+@@ -952,7 +952,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 30
VARIABLE_SCOPE GLOBAL
@@ -152,7 +152,7 @@
VARIABLE_COMMENT Number of iterations over which the background flushing is averaged.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1000
-@@ -978,7 +978,7 @@
+@@ -980,7 +980,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
@@ -161,7 +161,7 @@
VARIABLE_COMMENT Controls the durability/speed trade-off for commits. Set to 0 (write and flush redo log to disk only once per second), 1 (flush to disk at each commit), 2 (write to log at commit but flush to disk only once per second) or 3 (flush to disk at prepare and at commit, slower and usually redundant). 1 and 3 guarantees that after a crash, committed transactions will not be lost and will be consistent with the binlog and other transactional engines. 2 can get inconsistent and lose transactions if there is a power failure or kernel crash but not if mysqld crashes. 0 has no guarantees in case of crash. 0 and 2 can be faster than 1 or 3.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 3
-@@ -1006,7 +1006,7 @@
+@@ -1008,7 +1008,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
@@ -170,7 +170,7 @@
VARIABLE_COMMENT Set to 0 (don't flush neighbors from buffer pool), 1 (flush contiguous neighbors from buffer pool) or 2 (flush neighbors from buffer pool), when flushing a block
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2
-@@ -1062,7 +1062,7 @@
+@@ -1064,7 +1064,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -179,7 +179,7 @@
VARIABLE_COMMENT Helps to save your data in case the disk image of the database becomes corrupt.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 6
-@@ -1090,7 +1090,7 @@
+@@ -1092,7 +1092,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 8000000
VARIABLE_SCOPE GLOBAL
@@ -188,7 +188,7 @@
VARIABLE_COMMENT InnoDB Fulltext search cache size in bytes
NUMERIC_MIN_VALUE 1600000
NUMERIC_MAX_VALUE 80000000
-@@ -1132,7 +1132,7 @@
+@@ -1134,7 +1134,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 84
VARIABLE_SCOPE GLOBAL
@@ -197,7 +197,7 @@
VARIABLE_COMMENT InnoDB Fulltext search maximum token size in characters
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 84
-@@ -1146,7 +1146,7 @@
+@@ -1148,7 +1148,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 3
VARIABLE_SCOPE GLOBAL
@@ -206,7 +206,7 @@
VARIABLE_COMMENT InnoDB Fulltext search minimum token size in characters
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16
-@@ -1160,7 +1160,7 @@
+@@ -1162,7 +1162,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 2000
VARIABLE_SCOPE GLOBAL
@@ -215,7 +215,7 @@
VARIABLE_COMMENT InnoDB Fulltext search number of words to optimize for each optimize table call
NUMERIC_MIN_VALUE 1000
NUMERIC_MAX_VALUE 10000
-@@ -1174,7 +1174,7 @@
+@@ -1176,10 +1176,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 2000000000
VARIABLE_SCOPE GLOBAL
@@ -223,8 +223,12 @@
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT InnoDB Fulltext search query result cache limit in bytes
NUMERIC_MIN_VALUE 1000000
- NUMERIC_MAX_VALUE 4294967295
-@@ -1202,7 +1202,7 @@
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 0
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -1204,7 +1204,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 2
VARIABLE_SCOPE GLOBAL
@@ -233,7 +237,7 @@
VARIABLE_COMMENT InnoDB Fulltext search parallel sort degree, will round up to nearest power of 2 number
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 16
-@@ -1216,7 +1216,7 @@
+@@ -1218,7 +1218,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 640000000
VARIABLE_SCOPE GLOBAL
@@ -242,7 +246,7 @@
VARIABLE_COMMENT Total memory allocated for InnoDB Fulltext Search cache
NUMERIC_MIN_VALUE 32000000
NUMERIC_MAX_VALUE 1600000000
-@@ -1244,7 +1244,7 @@
+@@ -1246,7 +1246,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
@@ -251,7 +255,7 @@
VARIABLE_COMMENT Up to what percentage of dirty pages should be flushed when innodb finds it has spare resources to do so.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 100
-@@ -1272,10 +1272,10 @@
+@@ -1274,10 +1274,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 200
VARIABLE_SCOPE GLOBAL
@@ -264,7 +268,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1284,12 +1284,12 @@
+@@ -1286,12 +1286,12 @@
SESSION_VALUE NULL
GLOBAL_VALUE 2000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
@@ -280,7 +284,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1342,7 +1342,7 @@
+@@ -1344,7 +1344,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 50
VARIABLE_SCOPE SESSION
@@ -289,7 +293,7 @@
VARIABLE_COMMENT Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1073741824
-@@ -1356,10 +1356,10 @@
+@@ -1358,10 +1358,10 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 16777216
VARIABLE_SCOPE GLOBAL
@@ -302,7 +306,7 @@
NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY YES
-@@ -1412,7 +1412,7 @@
+@@ -1414,7 +1414,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 2
VARIABLE_SCOPE GLOBAL
@@ -311,7 +315,7 @@
VARIABLE_COMMENT Number of log files in the log group. InnoDB writes to the files in a circular fashion.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100
-@@ -1454,7 +1454,7 @@
+@@ -1470,7 +1470,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 8192
VARIABLE_SCOPE GLOBAL
@@ -320,7 +324,7 @@
VARIABLE_COMMENT Redo log write ahead unit size to avoid read-on-write, it should match the OS cache block IO size
NUMERIC_MIN_VALUE 512
NUMERIC_MAX_VALUE 16384
-@@ -1468,10 +1468,10 @@
+@@ -1484,10 +1484,10 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 1024
VARIABLE_SCOPE GLOBAL
@@ -333,7 +337,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1524,10 +1524,10 @@
+@@ -1540,10 +1540,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -346,7 +350,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1538,7 +1538,7 @@
+@@ -1554,7 +1554,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -355,7 +359,7 @@
VARIABLE_COMMENT Maximum delay of user threads in micro-seconds
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 10000000
-@@ -1678,10 +1678,10 @@
+@@ -1694,10 +1694,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -368,7 +372,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES
-@@ -1706,7 +1706,7 @@
+@@ -1722,7 +1722,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4
VARIABLE_SCOPE GLOBAL
@@ -377,7 +381,7 @@
VARIABLE_COMMENT Page cleaner threads can be from 1 to 64. Default is 4.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 64
-@@ -1734,7 +1734,7 @@
+@@ -1750,7 +1750,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 16
VARIABLE_SCOPE GLOBAL
@@ -386,7 +390,7 @@
VARIABLE_COMMENT Number of rw_locks protecting buffer pool page_hash. Rounded up to the next power of 2
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1024
-@@ -1748,7 +1748,7 @@
+@@ -1764,7 +1764,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 16384
VARIABLE_SCOPE GLOBAL
@@ -395,7 +399,7 @@
VARIABLE_COMMENT Page size to use for all InnoDB tablespaces.
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 65536
-@@ -1790,7 +1790,7 @@
+@@ -1806,7 +1806,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 300
VARIABLE_SCOPE GLOBAL
@@ -404,7 +408,7 @@
VARIABLE_COMMENT Number of UNDO log pages to purge in one batch from the history list.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 5000
-@@ -1804,7 +1804,7 @@
+@@ -1820,7 +1820,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 128
VARIABLE_SCOPE GLOBAL
@@ -413,7 +417,7 @@
VARIABLE_COMMENT Dictates rate at which UNDO records are purged. Value N means purge rollback segment(s) on every Nth iteration of purge invocation
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 128
-@@ -1846,7 +1846,7 @@
+@@ -1834,7 +1834,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4
VARIABLE_SCOPE GLOBAL
@@ -422,7 +426,7 @@
VARIABLE_COMMENT Purge threads can be from 1 to 32. Default is 4.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 32
-@@ -1874,7 +1874,7 @@
+@@ -1862,7 +1862,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 56
VARIABLE_SCOPE GLOBAL
@@ -431,7 +435,7 @@
VARIABLE_COMMENT Number of pages that must be accessed sequentially for InnoDB to trigger a readahead.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 64
-@@ -1888,7 +1888,7 @@
+@@ -1876,7 +1876,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 4
VARIABLE_SCOPE GLOBAL
@@ -440,7 +444,7 @@
VARIABLE_COMMENT Number of background read I/O threads in InnoDB.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 64
-@@ -1916,10 +1916,10 @@
+@@ -1904,10 +1904,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -453,7 +457,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1944,7 +1944,7 @@
+@@ -1932,7 +1932,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 128
VARIABLE_SCOPE GLOBAL
@@ -462,7 +466,7 @@
VARIABLE_COMMENT Number of undo logs to use (deprecated).
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 128
-@@ -1958,7 +1958,7 @@
+@@ -1946,7 +1946,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -471,7 +475,7 @@
VARIABLE_COMMENT An InnoDB page number.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2014,7 +2014,7 @@
+@@ -2002,7 +2002,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1048576
VARIABLE_SCOPE GLOBAL
@@ -480,7 +484,7 @@
VARIABLE_COMMENT Memory buffer size for index creation
NUMERIC_MIN_VALUE 65536
NUMERIC_MAX_VALUE 67108864
-@@ -2224,7 +2224,7 @@
+@@ -2212,7 +2212,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
@@ -489,7 +493,7 @@
VARIABLE_COMMENT Size of the mutex/lock wait array.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1024
-@@ -2252,10 +2252,10 @@
+@@ -2240,10 +2240,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 30
VARIABLE_SCOPE GLOBAL
@@ -502,7 +506,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2294,7 +2294,7 @@
+@@ -2282,7 +2282,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -511,7 +515,7 @@
VARIABLE_COMMENT Helps in performance tuning in heavily concurrent environments. Sets the maximum number of threads allowed inside InnoDB. Value 0 will disable the thread throttling.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000
-@@ -2308,7 +2308,7 @@
+@@ -2296,7 +2296,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 10000
VARIABLE_SCOPE GLOBAL
@@ -520,7 +524,7 @@
VARIABLE_COMMENT Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000000
-@@ -2378,7 +2378,7 @@
+@@ -2366,7 +2366,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 128
VARIABLE_SCOPE GLOBAL
@@ -529,7 +533,7 @@
VARIABLE_COMMENT Number of undo logs to use.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 128
-@@ -2406,7 +2406,7 @@
+@@ -2394,7 +2394,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -538,7 +542,7 @@
VARIABLE_COMMENT Number of undo tablespaces to use.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 127
-@@ -2448,7 +2448,7 @@
+@@ -2422,7 +2422,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 4
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index 4b2024d1445..a6f626dd0b5 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -1179,7 +1179,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT InnoDB Fulltext search query result cache limit in bytes
NUMERIC_MIN_VALUE 1000000
-NUMERIC_MAX_VALUE 4294967295
+NUMERIC_MAX_VALUE 18446744073709551615
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
diff --git a/mysql-test/suite/sys_vars/r/thread_pool_size_high.result b/mysql-test/suite/sys_vars/r/thread_pool_size_high.result
index f581ae8e315..bc30104b79d 100644
--- a/mysql-test/suite/sys_vars/r/thread_pool_size_high.result
+++ b/mysql-test/suite/sys_vars/r/thread_pool_size_high.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Could not increase number of max_open_files to more than");
SELECT @@global.thread_pool_size;
@@global.thread_pool_size
200
diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
index 33c278dc118..fe0c579acf4 100644
--- a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
+++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
@@ -59,7 +59,7 @@ INSERT INTO t1 VALUES('4','1','1');
INSERT INTO t1 VALUES('5','1','1');
INSERT INTO t1 VALUES('6','1','1');
-LOCK TABLE v1 WRITE;
+LOCK TABLE v1 READ;
connection con1;
@@ -106,9 +106,8 @@ delimiter ;|
connection con0;
let $wait_condition=
- SELECT variable_value > @@global.delayed_insert_limit
- FROM information_schema.global_status
- WHERE variable_name like 'Not_flushed_delayed_rows';
+ SELECT COUNT(*) = 1 FROM information_schema.processlist
+ WHERE state = 'Waiting for table level lock' AND user='delayed';
--source include/wait_condition.inc
let $my_select= SELECT COUNT(*) FROM t1;
send;
@@ -130,13 +129,6 @@ connection con0;
--echo Asynchronous "reap" result
--echo The next result suffers from
--echo '# Bug#35386 insert delayed inserts 1 + limit rows instead of just limit rows'
-#
-# on UNLOCK TABLES both SELECT in the con0 and delayed insert thread in the
-# con1 were awaken. There's no FIFO for TL_WRITE_DELAYED and TL_READ,
-# so either the first delayed_insert_limit rows will be inserted
-# before select (which will see 21 row) or select will go first (and see 6 rows)
-#
---replace_result 6 21
reap;
connection default;
@@ -165,7 +157,7 @@ INSERT INTO t1 VALUES('4');
INSERT INTO t1 VALUES('5');
INSERT INTO t1 VALUES('6');
-LOCK TABLE v1 WRITE;
+LOCK TABLE v1 READ;
connection con1;
@@ -194,8 +186,8 @@ delimiter ;|
connection con0;
let $wait_condition=
- SELECT variable_value > 0 FROM information_schema.global_status
- WHERE variable_name like 'Not_flushed_delayed_rows';
+ SELECT COUNT(*) = 1 FROM information_schema.processlist
+ WHERE state = 'Waiting for table level lock' AND user='delayed';
--source include/wait_condition.inc
--echo Asynchronous execute
# Due to performance and server behaveiour the test observes values between 6 and 22.
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_32.test b/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_32.test
new file mode 100644
index 00000000000..d9defc7447b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_32.test
@@ -0,0 +1,9 @@
+--source include/have_32bit.inc
+--source include/have_innodb.inc
+
+let $innodb_ft_result_cache_limit_orig=`select @@innodb_ft_result_cache_limit`;
+
+set global innodb_ft_result_cache_limit=5000000000;
+select @@innodb_ft_result_cache_limit;
+
+eval set global innodb_ft_result_cache_limit=$innodb_ft_result_cache_limit_orig;
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_64.test b/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_64.test
new file mode 100644
index 00000000000..2606d2b5ca8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_64.test
@@ -0,0 +1,9 @@
+--source include/have_64bit.inc
+--source include/have_innodb.inc
+
+let $innodb_ft_result_cache_limit_orig=`select @@innodb_ft_result_cache_limit`;
+
+set global innodb_ft_result_cache_limit=5000000000;
+select @@innodb_ft_result_cache_limit;
+
+eval set global innodb_ft_result_cache_limit=$innodb_ft_result_cache_limit_orig;
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test
index 0a797a5ab5d..31cdfed4478 100644
--- a/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test
@@ -4,6 +4,7 @@
#
--source include/have_innodb.inc
+--source include/word_size.inc
#
# show the global and session values;
@@ -21,7 +22,7 @@ select * from information_schema.session_variables where variable_name='innodb_f
#
# test default, min, max value
#
-let $innodb_ft_result_cache_limit_orig=`select @@innodb_ft_result_cache_limit`;
+SET @save_limit = @@innodb_ft_result_cache_limit;
set global innodb_ft_result_cache_limit=900000;
select @@innodb_ft_result_cache_limit;
@@ -35,4 +36,4 @@ select @@innodb_ft_result_cache_limit;
set global innodb_ft_result_cache_limit=4*1024*1024*1024;
select @@innodb_ft_result_cache_limit;
-eval set global innodb_ft_result_cache_limit=$innodb_ft_result_cache_limit_orig;
+set global innodb_ft_result_cache_limit = @save_limit;
diff --git a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test
index 7939f3dfda0..b8f6d9551e3 100644
--- a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test
@@ -64,7 +64,7 @@ INSERT INTO t1 VALUES('4');
INSERT INTO t1 VALUES('5');
INSERT INTO t1 VALUES('6');
-LOCK TABLE v1 WRITE;
+LOCK TABLE v1 WRITE CONCURRENT;
connection con1;
@@ -130,7 +130,7 @@ INSERT INTO t1 VALUES('4');
INSERT INTO t1 VALUES('5');
INSERT INTO t1 VALUES('6');
-LOCK TABLE v1 WRITE;
+LOCK TABLE v1 READ;
connection con1;
diff --git a/mysql-test/suite/sys_vars/t/thread_pool_size_high.test b/mysql-test/suite/sys_vars/t/thread_pool_size_high.test
index 761aeee2b0a..d1e68f026f0 100644
--- a/mysql-test/suite/sys_vars/t/thread_pool_size_high.test
+++ b/mysql-test/suite/sys_vars/t/thread_pool_size_high.test
@@ -1,6 +1,7 @@
--source include/not_windows.inc
--source include/not_embedded.inc
--source include/have_pool_of_threads.inc
+call mtr.add_suppression("Could not increase number of max_open_files to more than");
SELECT @@global.thread_pool_size;
diff --git a/mysql-test/suite/vcol/r/races.result b/mysql-test/suite/vcol/r/races.result
new file mode 100644
index 00000000000..c46ed5ba2ef
--- /dev/null
+++ b/mysql-test/suite/vcol/r/races.result
@@ -0,0 +1,16 @@
+create table t1 (f text, vf tinytext as (f), key (vf(64))) engine=innodb;
+insert t1 (f) values ('foo');
+flush tables;
+connect con1,localhost,root,,test;
+set debug_sync='TABLE_after_field_clone WAIT_FOR go';
+delete from t1;
+connection default;
+select * from t1;
+f vf
+foo foo
+set debug_sync='now SIGNAL go';
+connection con1;
+disconnect con1;
+connection default;
+drop table t1;
+set debug_sync='reset';
diff --git a/mysql-test/suite/vcol/t/races.test b/mysql-test/suite/vcol/t/races.test
new file mode 100644
index 00000000000..1bf4e43dec9
--- /dev/null
+++ b/mysql-test/suite/vcol/t/races.test
@@ -0,0 +1,22 @@
+#
+# MDEV-17349 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed on concurrent SELECT and DELETE after RENAME from table with index on virtual column
+#
+source include/have_innodb.inc;
+source include/have_debug_sync.inc;
+create table t1 (f text, vf tinytext as (f), key (vf(64))) engine=innodb;
+insert t1 (f) values ('foo');
+flush tables;
+connect con1,localhost,root,,test;
+set debug_sync='TABLE_after_field_clone WAIT_FOR go';
+send delete from t1;
+connection default;
+let $wait_condition= select state like 'debug sync point%' from information_schema.processlist;
+source include/wait_condition.inc;
+select * from t1;
+set debug_sync='now SIGNAL go';
+connection con1;
+reap;
+disconnect con1;
+connection default;
+drop table t1;
+set debug_sync='reset';
diff --git a/mysql-test/suite/versioning/innodb.combinations b/mysql-test/suite/versioning/innodb.combinations
new file mode 100644
index 00000000000..1a0812cfafe
--- /dev/null
+++ b/mysql-test/suite/versioning/innodb.combinations
@@ -0,0 +1,5 @@
+[timestamp]
+default-storage-engine=innodb
+
+[trx_id]
+default-storage-engine=innodb
diff --git a/mysql-test/suite/versioning/innodb.inc b/mysql-test/suite/versioning/innodb.inc
new file mode 100644
index 00000000000..c841fece702
--- /dev/null
+++ b/mysql-test/suite/versioning/innodb.inc
@@ -0,0 +1 @@
+--source include/have_innodb.inc
diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result
index 6fac910fcb0..7cddc374f5f 100644
--- a/mysql-test/suite/versioning/r/alter.result
+++ b/mysql-test/suite/versioning/r/alter.result
@@ -372,7 +372,7 @@ a b
1 NULL
2 NULL
3 1
-4 4
+4 2
create or replace table t (a int) with system versioning;
insert into t values (1), (2), (3);
delete from t where a<3;
diff --git a/mysql-test/suite/versioning/r/online.result b/mysql-test/suite/versioning/r/online.result
index 4c1fed1ecfd..580500544d6 100644
--- a/mysql-test/suite/versioning/r/online.result
+++ b/mysql-test/suite/versioning/r/online.result
@@ -1,33 +1,128 @@
set system_versioning_alter_history=keep;
-create or replace table t (a int, b int) engine=innodb;
+create or replace table t (a int);
alter table t add system versioning, lock=none;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned tables. Try LOCK=SHARED
+ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned timestamp tables. Try LOCK=SHARED
+alter table t add system versioning, algorithm=inplace;
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Not implemented for system-versioned timestamp tables. Try ALGORITHM=COPY
alter table t add system versioning, lock=shared;
-alter table t drop column b, lock=none;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned tables. Try LOCK=SHARED
-alter table t drop column b, algorithm=inplace;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Not implemented for system-versioned tables. Try ALGORITHM=COPY
-alter table t add index idx(a), lock=none;
+alter table t add column b int, change column a a int without system versioning, lock=none;
alter table t drop system versioning, lock=none;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned tables. Try LOCK=SHARED
+ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned operations. Try LOCK=SHARED
alter table t drop system versioning, algorithm=inplace;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Not implemented for system-versioned tables. Try ALGORITHM=COPY
+create or replace table t (
+a int, b int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end)
+) with system versioning;
+insert into t values (1, 0);
+insert into t values (2, 0);
+delete from t where a = 2;
+alter table t drop column b, lock=none;
+alter table t add index idx(a), lock=none;
+select a, check_row(row_start, row_end) from t for system_time all order by a;
+a check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+# MDEV-17038 ALTER TABLE CHANGE COLUMN c1 c1 bigint NOT NULL -
+# generates error if table uses SYSTEM VERSIONING [tempesta-tech/mariadb#540]
+create or replace table t1 (a int, key(a)) with system versioning;
+create or replace table t2 like t;
+alter table t2 add foreign key(a) references t1(a);
+alter table t2 modify column a int not null, lock=none;
+drop table t2;
+drop table t1;
+# MDEV-16330 Allow instant change of WITH SYSTEM VERSIONING column attribute
+create or replace table t1 (
+a int,
+b int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning;
+create or replace table t2 (
+a int without system versioning,
+b int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning;
+insert into t1 values (1,1);
+insert into t2 values (1,1);
+set @@system_versioning_alter_history=keep;
+# without rebuild
+alter table t1
+change a a int without system versioning,
+algorithm=instant;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+alter table t2
+change a a int with system versioning,
+add primary key pk (a),
+algorithm=instant;
+ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
+# with rebuild
+alter table t2
+change a a int with system versioning,
+add primary key pk (a);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+update t1 set a=2;
+select count(*) from t1 for system_time all;
+count(*)
+1
+update t2 set a=2;
+select count(*) from t2 for system_time all;
+count(*)
+2
+drop table t1, t2;
+# rollback ALTER TABLE: nothing should change
+create or replace table t (
+a int,
+b int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning;
+insert into t values (1, 1);
+select c.prtype from information_schema.innodb_sys_columns as c
+join information_schema.innodb_sys_tables as t on c.table_id=t.table_id
+where t.name='test/t' and c.name='b';
+prtype
+50179
+set @@system_versioning_alter_history=keep;
+select c.prtype from information_schema.innodb_sys_columns as c
+join information_schema.innodb_sys_tables as t on c.table_id=t.table_id
+where t.name='test/t' and c.name='b';
+prtype
+50179
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `row_start` SYS_DATATYPE GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` SYS_DATATYPE GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select count(*) from t for system_time all;
+count(*)
+1
+update t set b=11;
+select count(*) from t for system_time all;
+count(*)
+2
+# Start of 10.4 tests
create or replace table t (a int, b int) engine=innodb;
alter table t
add s bigint unsigned as row start,
add e bigint unsigned as row end,
add period for system_time(s, e),
-add system versioning,
-lock=none;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned tables. Try LOCK=SHARED
-alter table t
-add s bigint unsigned as row start,
-add e bigint unsigned as row end,
-add period for system_time(s, e),
add system versioning;
alter table t drop column b, algorithm=instant;
alter table t add index idx(a), lock=none;
alter table t drop column s, drop column e;
alter table t drop system versioning, lock=none;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned tables. Try LOCK=SHARED
-drop table t;
+ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned operations. Try LOCK=SHARED
+drop database test;
+create database test;
diff --git a/mysql-test/suite/versioning/r/trx_id_versioning_attribute_persistence.result b/mysql-test/suite/versioning/r/trx_id_versioning_attribute_persistence.result
deleted file mode 100644
index bf555fb2a7d..00000000000
--- a/mysql-test/suite/versioning/r/trx_id_versioning_attribute_persistence.result
+++ /dev/null
@@ -1,86 +0,0 @@
-CREATE OR REPLACE TABLE t1 (
-a INT,
-b INT,
-row_start BIGINT UNSIGNED AS ROW START INVISIBLE,
-row_end BIGINT UNSIGNED AS ROW END INVISIBLE,
-PERIOD FOR SYSTEM_TIME(row_start, row_end)
-) WITH SYSTEM VERSIONING ENGINE=INNODB;
-CREATE OR REPLACE TABLE t2 (
-a INT WITHOUT SYSTEM VERSIONING,
-b INT,
-row_start BIGINT UNSIGNED AS ROW START INVISIBLE,
-row_end BIGINT UNSIGNED AS ROW END INVISIBLE,
-PERIOD FOR SYSTEM_TIME(row_start, row_end)
-) WITH SYSTEM VERSIONING ENGINE=INNODB;
-INSERT INTO t1 VALUES (1,1);
-INSERT INTO t2 VALUES (1,1);
-SET @@SYSTEM_VERSIONING_ALTER_HISTORY=KEEP;
-# without rebuild
-ALTER TABLE t1
-CHANGE a a INT WITHOUT SYSTEM VERSIONING,
-ALGORITHM=INSTANT;
-affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
-ALTER TABLE t2
-CHANGE a a INT WITH SYSTEM VERSIONING,
-ADD PRIMARY KEY pk (a),
-ALGORITHM=INSTANT;
-ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
-# with rebuild
-ALTER TABLE t2
-CHANGE a a INT WITH SYSTEM VERSIONING,
-ADD PRIMARY KEY pk (a);
-affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
-UPDATE t1 SET a=2;
-SELECT COUNT(*) FROM t1 FOR SYSTEM_TIME ALL;
-COUNT(*)
-1
-UPDATE t2 SET a=2;
-SELECT COUNT(*) FROM t2 FOR SYSTEM_TIME ALL;
-COUNT(*)
-2
-DROP TABLE t1, t2;
-# rollback ALTER TABLE: nothing should change
-CREATE TABLE t (
-a INT,
-b INT,
-row_start BIGINT UNSIGNED AS ROW START INVISIBLE,
-row_end BIGINT UNSIGNED AS ROW END INVISIBLE,
-PERIOD FOR SYSTEM_TIME(row_start, row_end)
-) WITH SYSTEM VERSIONING ENGINE=INNODB;
-INSERT INTO t VALUES (1, 1);
-SELECT C.PRTYPE FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS C
-JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t ON C.TABLE_ID=t.TABLE_ID
-WHERE t.NAME='test/t' AND C.NAME='b';
-PRTYPE
-50179
-SET @@SYSTEM_VERSIONING_ALTER_HISTORY=KEEP;
-SET @SAVED_DEBUG_DBUG = @@SESSION.DEBUG_DBUG;
-SET DEBUG_DBUG='+d,ib_commit_inplace_fail_1';
-ALTER TABLE t
-CHANGE b b INT WITHOUT SYSTEM VERSIONING;
-ERROR HY000: Internal error: Injected error!
-SET DEBUG_DBUG = @SAVED_DEBUG_DBUG;
-SELECT C.PRTYPE FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS C
-JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t ON C.TABLE_ID=t.TABLE_ID
-WHERE t.NAME='test/t' AND C.NAME='b';
-PRTYPE
-50179
-SHOW CREATE TABLE t;
-Table Create Table
-t CREATE TABLE `t` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL,
- `row_start` bigint(20) unsigned GENERATED ALWAYS AS ROW START INVISIBLE,
- `row_end` bigint(20) unsigned GENERATED ALWAYS AS ROW END INVISIBLE,
- PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
-SELECT COUNT(*) FROM t FOR SYSTEM_TIME ALL;
-COUNT(*)
-1
-UPDATE t SET b=11;
-SELECT COUNT(*) FROM t FOR SYSTEM_TIME ALL;
-COUNT(*)
-2
-DROP TABLE t;
diff --git a/mysql-test/suite/versioning/t/online.test b/mysql-test/suite/versioning/t/online.test
index 537609f48f3..9de4937d8da 100644
--- a/mysql-test/suite/versioning/t/online.test
+++ b/mysql-test/suite/versioning/t/online.test
@@ -1,32 +1,142 @@
---source include/have_innodb.inc
+--source suite/versioning/innodb.inc
+--source suite/versioning/common.inc
+--source include/maybe_debug.inc
set system_versioning_alter_history=keep;
-create or replace table t (a int, b int) engine=innodb;
-
+create or replace table t (a int);
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t add system versioning, lock=none;
-alter table t add system versioning, lock=shared;
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-alter table t drop column b, lock=none;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-alter table t drop column b, algorithm=inplace;
-alter table t add index idx(a), lock=none;
+alter table t add system versioning, algorithm=inplace;
+alter table t add system versioning, lock=shared;
+
+alter table t add column b int, change column a a int without system versioning, lock=none;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t drop system versioning, lock=none;
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t drop system versioning, algorithm=inplace;
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t (
+ a int, b int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end)
+) with system versioning;
+insert into t values (1, 0);
+insert into t values (2, 0);
+delete from t where a = 2;
+alter table t drop column b, lock=none;
+alter table t add index idx(a), lock=none;
+
+select a, check_row(row_start, row_end) from t for system_time all order by a;
-create or replace table t (a int, b int) engine=innodb;
+--echo # MDEV-17038 ALTER TABLE CHANGE COLUMN c1 c1 bigint NOT NULL -
+--echo # generates error if table uses SYSTEM VERSIONING [tempesta-tech/mariadb#540]
+create or replace table t1 (a int, key(a)) with system versioning;
+create or replace table t2 like t;
+alter table t2 add foreign key(a) references t1(a);
+alter table t2 modify column a int not null, lock=none;
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+drop table t2;
+drop table t1;
+
+--echo # MDEV-16330 Allow instant change of WITH SYSTEM VERSIONING column attribute
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t1 (
+ a int,
+ b int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning;
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t2 (
+ a int without system versioning,
+ b int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning;
+
+insert into t1 values (1,1);
+insert into t2 values (1,1);
+
+set @@system_versioning_alter_history=keep;
+
+--enable_info
+--echo # without rebuild
+alter table t1
+ change a a int without system versioning,
+ algorithm=instant;
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter table t2
+ change a a int with system versioning,
+ add primary key pk (a),
+ algorithm=instant;
+
+--echo # with rebuild
+alter table t2
+ change a a int with system versioning,
+ add primary key pk (a);
+--disable_info
+
+--source include/restart_mysqld.inc
+
+update t1 set a=2;
+select count(*) from t1 for system_time all;
+
+update t2 set a=2;
+select count(*) from t2 for system_time all;
+
+drop table t1, t2;
+
+--echo # rollback ALTER TABLE: nothing should change
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t (
+ a int,
+ b int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning;
+
+insert into t values (1, 1);
+
+select c.prtype from information_schema.innodb_sys_columns as c
+ join information_schema.innodb_sys_tables as t on c.table_id=t.table_id
+ where t.name='test/t' and c.name='b';
+
+set @@system_versioning_alter_history=keep;
+
+if ($have_debug) {
+--disable_query_log
+--disable_result_log
+set debug_dbug='+d,ib_commit_inplace_fail_1';
+--error ER_INTERNAL_ERROR
alter table t
- add s bigint unsigned as row start,
- add e bigint unsigned as row end,
- add period for system_time(s, e),
- add system versioning,
- lock=none;
+ change b b int without system versioning;
+set debug_dbug= default;
+--enable_query_log
+--enable_result_log
+}
+
+select c.prtype from information_schema.innodb_sys_columns as c
+ join information_schema.innodb_sys_tables as t on c.table_id=t.table_id
+ where t.name='test/t' and c.name='b';
+
+--replace_result $sys_datatype_expl SYS_DATATYPE
+show create table t;
+
+select count(*) from t for system_time all;
+update t set b=11;
+select count(*) from t for system_time all;
+
+--echo # Start of 10.4 tests
+
+create or replace table t (a int, b int) engine=innodb;
alter table t
add s bigint unsigned as row start,
add e bigint unsigned as row end,
@@ -38,4 +148,5 @@ alter table t drop column s, drop column e;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t drop system versioning, lock=none;
-drop table t;
+drop database test;
+create database test;
diff --git a/mysql-test/suite/versioning/t/trx_id_versioning_attribute_persistence.test b/mysql-test/suite/versioning/t/trx_id_versioning_attribute_persistence.test
deleted file mode 100644
index 4e92ee247e4..00000000000
--- a/mysql-test/suite/versioning/t/trx_id_versioning_attribute_persistence.test
+++ /dev/null
@@ -1,87 +0,0 @@
--- source include/have_innodb.inc
--- source include/have_debug.inc
-
-CREATE OR REPLACE TABLE t1 (
- a INT,
- b INT,
- row_start BIGINT UNSIGNED AS ROW START INVISIBLE,
- row_end BIGINT UNSIGNED AS ROW END INVISIBLE,
- PERIOD FOR SYSTEM_TIME(row_start, row_end)
-) WITH SYSTEM VERSIONING ENGINE=INNODB;
-
-CREATE OR REPLACE TABLE t2 (
- a INT WITHOUT SYSTEM VERSIONING,
- b INT,
- row_start BIGINT UNSIGNED AS ROW START INVISIBLE,
- row_end BIGINT UNSIGNED AS ROW END INVISIBLE,
- PERIOD FOR SYSTEM_TIME(row_start, row_end)
-) WITH SYSTEM VERSIONING ENGINE=INNODB;
-
-INSERT INTO t1 VALUES (1,1);
-INSERT INTO t2 VALUES (1,1);
-
-SET @@SYSTEM_VERSIONING_ALTER_HISTORY=KEEP;
-
---enable_info
---echo # without rebuild
-ALTER TABLE t1
- CHANGE a a INT WITHOUT SYSTEM VERSIONING,
- ALGORITHM=INSTANT;
-
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t2
- CHANGE a a INT WITH SYSTEM VERSIONING,
- ADD PRIMARY KEY pk (a),
- ALGORITHM=INSTANT;
-
---echo # with rebuild
-ALTER TABLE t2
- CHANGE a a INT WITH SYSTEM VERSIONING,
- ADD PRIMARY KEY pk (a);
---disable_info
-
---source include/restart_mysqld.inc
-
-UPDATE t1 SET a=2;
-SELECT COUNT(*) FROM t1 FOR SYSTEM_TIME ALL;
-
-UPDATE t2 SET a=2;
-SELECT COUNT(*) FROM t2 FOR SYSTEM_TIME ALL;
-
-DROP TABLE t1, t2;
-
---echo # rollback ALTER TABLE: nothing should change
-CREATE TABLE t (
- a INT,
- b INT,
- row_start BIGINT UNSIGNED AS ROW START INVISIBLE,
- row_end BIGINT UNSIGNED AS ROW END INVISIBLE,
- PERIOD FOR SYSTEM_TIME(row_start, row_end)
-) WITH SYSTEM VERSIONING ENGINE=INNODB;
-
-INSERT INTO t VALUES (1, 1);
-
-SELECT C.PRTYPE FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS C
- JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t ON C.TABLE_ID=t.TABLE_ID
- WHERE t.NAME='test/t' AND C.NAME='b';
-
-SET @@SYSTEM_VERSIONING_ALTER_HISTORY=KEEP;
-
-SET @SAVED_DEBUG_DBUG = @@SESSION.DEBUG_DBUG;
-SET DEBUG_DBUG='+d,ib_commit_inplace_fail_1';
---error ER_INTERNAL_ERROR
-ALTER TABLE t
- CHANGE b b INT WITHOUT SYSTEM VERSIONING;
-SET DEBUG_DBUG = @SAVED_DEBUG_DBUG;
-
-SELECT C.PRTYPE FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS AS C
- JOIN INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t ON C.TABLE_ID=t.TABLE_ID
- WHERE t.NAME='test/t' AND C.NAME='b';
-
-SHOW CREATE TABLE t;
-
-SELECT COUNT(*) FROM t FOR SYSTEM_TIME ALL;
-UPDATE t SET b=11;
-SELECT COUNT(*) FROM t FOR SYSTEM_TIME ALL;
-
-DROP TABLE t;