diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-05-12 17:20:23 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-05-12 17:20:23 +0200 |
commit | c51f85f8823a845cd4a6aa1b2aa5af18484b2ab0 (patch) | |
tree | 65c45f6100c13dad90c33b86dc68be268139b0b8 /mysql-test/suite/innodb | |
parent | a89f199c64a1d2339de7c167ce64ec148061a4d3 (diff) | |
parent | 8ce702aa90c174566f4ac950e85cc7570bf9b647 (diff) | |
download | mariadb-git-c51f85f8823a845cd4a6aa1b2aa5af18484b2ab0.tar.gz |
Merge branch '10.2' into 10.3
Diffstat (limited to 'mysql-test/suite/innodb')
-rw-r--r-- | mysql-test/suite/innodb/r/foreign-keys.result | 24 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb-index.result | 27 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb-truncate.result | 13 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result | 6 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/xa_debug.result | 1 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/foreign-keys.test | 32 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb-index.test | 20 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb-truncate.test | 19 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/xa_debug.test | 1 |
9 files changed, 140 insertions, 3 deletions
diff --git a/mysql-test/suite/innodb/r/foreign-keys.result b/mysql-test/suite/innodb/r/foreign-keys.result index 447013d408d..c4cf3a6a72d 100644 --- a/mysql-test/suite/innodb/r/foreign-keys.result +++ b/mysql-test/suite/innodb/r/foreign-keys.result @@ -100,6 +100,30 @@ CREATE TABLE t2 (b INT, KEY(b)) ENGINE=InnoDB; INSERT INTO t2 VALUES(2); ALTER TABLE t2 ADD FOREIGN KEY(b) REFERENCES t1(a), LOCK=EXCLUSIVE; DROP TABLE t2, t1; +# +# MDEV-16060 - InnoDB: Failing assertion: ut_strcmp(index->name, key->name) +# +CREATE TABLE t1 (`pk` INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +FLUSH TABLES; +SET debug_sync='alter_table_intermediate_table_created SIGNAL ready WAIT_FOR go'; +ALTER TABLE t1 ADD FOREIGN KEY(pk) REFERENCES t2(pk) ON UPDATE CASCADE; +connect con1, localhost, root; +SET debug_sync='now WAIT_FOR ready'; +SET lock_wait_timeout=1; +UPDATE t2 SET pk=10 WHERE pk=1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +PREPARE stmt FROM 'UPDATE t2 SET pk=10 WHERE pk=1'; +DEALLOCATE PREPARE stmt; +FLUSH TABLE t2; +SET debug_sync='now SIGNAL go'; +connection default; +disconnect con1; +connection default; +SET debug_sync='reset'; +SHOW OPEN TABLES FROM test; +Database Table In_use Name_locked +DROP TABLE t1, t2; create table t1 (a int primary key, b int) engine=innodb; create table t2 (c int primary key, d int, foreign key (d) references t1 (a) on update cascade) engine=innodb; diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result index b64fd27fb35..bdc16ad7692 100644 --- a/mysql-test/suite/innodb/r/innodb-index.result +++ b/mysql-test/suite/innodb/r/innodb-index.result @@ -1212,6 +1212,33 @@ Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; # +# Bug#19811005 ALTER TABLE ADD INDEX DOES NOT UPDATE INDEX_LENGTH +# IN I_S TABLES +# +CREATE TABLE t1(a INT, b INT) ENGINE=INNODB, STATS_PERSISTENT=1; +SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D, +cast(INDEX_LENGTH/@@innodb_page_size as int) I +FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'; +D I +1 0 +ALTER TABLE t1 ADD INDEX (a); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D, +cast(INDEX_LENGTH/@@innodb_page_size as int) I +FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'; +D I +1 1 +ALTER TABLE t1 ADD INDEX (b); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D, +cast(INDEX_LENGTH/@@innodb_page_size as int) I +FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'; +D I +1 2 +DROP TABLE t1; +# # Bug #17657223 EXCESSIVE TEMPORARY FILE USAGE IN ALTER TABLE # SET GLOBAL innodb_monitor_enable = module_ddl; diff --git a/mysql-test/suite/innodb/r/innodb-truncate.result b/mysql-test/suite/innodb/r/innodb-truncate.result index a606868ae52..8610a892cc6 100644 --- a/mysql-test/suite/innodb/r/innodb-truncate.result +++ b/mysql-test/suite/innodb/r/innodb-truncate.result @@ -78,3 +78,16 @@ a 1 2 DROP TABLE t1; +call mtr.add_suppression('InnoDB: in RENAME TABLE table `test`.`t3`'); +SET FOREIGN_KEY_CHECKS= OFF; +CREATE TABLE t1 (f2 INT, f4 INT, KEY(f2), FOREIGN KEY (f4) REFERENCES t3 (f4)) ENGINE=InnoDB; +SET FOREIGN_KEY_CHECKS= ON; +CREATE TABLE t2 (f2 INT, FOREIGN KEY(f2) REFERENCES t1 (f2)) ENGINE=InnoDB; +CREATE TABLE t3 (a INT) ENGINE=InnoDB; +ERROR HY000: Can't create table `test`.`t3` (errno: 150 "Foreign key constraint is incorrectly formed") +ALTER TABLE t1 RENAME TO t3; +ERROR HY000: Error on rename of './test/t1' to './test/t3' (errno: 150 "Foreign key constraint is incorrectly formed") +ALTER TABLE t1 FORCE; +TRUNCATE TABLE t1; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f2`) REFERENCES `test`.`t3` (`f2`)) +DROP TABLE t2, t1; diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result index af0714148cf..d42285bf157 100644 --- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result +++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result @@ -204,9 +204,9 @@ log_lsn_checkpoint_age recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL log_lsn_buf_pool_oldest recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value The oldest modified block LSN in the buffer pool log_max_modified_age_async recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Maximum LSN difference; when exceeded, start asynchronous preflush log_max_modified_age_sync recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Maximum LSN difference; when exceeded, start synchronous preflush -log_pending_log_flushes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Pending log flushes -log_pending_checkpoint_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Pending checkpoints -log_num_log_io recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of log I/Os +log_pending_log_flushes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Pending log flushes +log_pending_checkpoint_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Pending checkpoints +log_num_log_io recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Number of log I/Os log_waits recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of log waits due to small log buffer (innodb_log_waits) log_write_requests recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of log write requests (innodb_log_write_requests) log_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of log writes (innodb_log_writes) diff --git a/mysql-test/suite/innodb/r/xa_debug.result b/mysql-test/suite/innodb/r/xa_debug.result index 902166f51c8..7c2bd9f92c2 100644 --- a/mysql-test/suite/innodb/r/xa_debug.result +++ b/mysql-test/suite/innodb/r/xa_debug.result @@ -252,6 +252,7 @@ insert into t1 values(1); xa end 'test1'; xa prepare 'test1'; connection default; +FLUSH TABLES; xa recover; formatID gtrid_length bqual_length data 1 5 0 test1 diff --git a/mysql-test/suite/innodb/t/foreign-keys.test b/mysql-test/suite/innodb/t/foreign-keys.test index 442467b7dbe..be2c891771b 100644 --- a/mysql-test/suite/innodb/t/foreign-keys.test +++ b/mysql-test/suite/innodb/t/foreign-keys.test @@ -127,6 +127,38 @@ INSERT INTO t2 VALUES(2); ALTER TABLE t2 ADD FOREIGN KEY(b) REFERENCES t1(a), LOCK=EXCLUSIVE; DROP TABLE t2, t1; + +--echo # +--echo # MDEV-16060 - InnoDB: Failing assertion: ut_strcmp(index->name, key->name) +--echo # +CREATE TABLE t1 (`pk` INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +FLUSH TABLES; + +SET debug_sync='alter_table_intermediate_table_created SIGNAL ready WAIT_FOR go'; +send ALTER TABLE t1 ADD FOREIGN KEY(pk) REFERENCES t2(pk) ON UPDATE CASCADE; + +connect con1, localhost, root; +SET debug_sync='now WAIT_FOR ready'; +SET lock_wait_timeout=1; # change to 0 in 10.3 +--error ER_LOCK_WAIT_TIMEOUT +UPDATE t2 SET pk=10 WHERE pk=1; +PREPARE stmt FROM 'UPDATE t2 SET pk=10 WHERE pk=1'; +DEALLOCATE PREPARE stmt; +FLUSH TABLE t2; +SET debug_sync='now SIGNAL go'; + +connection default; +reap; + +# Cleanup +disconnect con1; + +connection default; +SET debug_sync='reset'; +SHOW OPEN TABLES FROM test; +DROP TABLE t1, t2; + # # FK and prelocking: # child table accesses (reads and writes) wait for locks. diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test index 8bd3919af91..474b0e08935 100644 --- a/mysql-test/suite/innodb/t/innodb-index.test +++ b/mysql-test/suite/innodb/t/innodb-index.test @@ -570,6 +570,26 @@ CHECK TABLE t1; DROP TABLE t1; --echo # +--echo # Bug#19811005 ALTER TABLE ADD INDEX DOES NOT UPDATE INDEX_LENGTH +--echo # IN I_S TABLES +--echo # +let $i_s_query=SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D, +cast(INDEX_LENGTH/@@innodb_page_size as int) I +FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'; + +CREATE TABLE t1(a INT, b INT) ENGINE=INNODB, STATS_PERSISTENT=1; +eval $i_s_query; +--enable_info +ALTER TABLE t1 ADD INDEX (a); +--disable_info +eval $i_s_query; +--enable_info +ALTER TABLE t1 ADD INDEX (b); +--disable_info +eval $i_s_query; +DROP TABLE t1; + +--echo # --echo # Bug #17657223 EXCESSIVE TEMPORARY FILE USAGE IN ALTER TABLE --echo # diff --git a/mysql-test/suite/innodb/t/innodb-truncate.test b/mysql-test/suite/innodb/t/innodb-truncate.test index 8f9b1f1f0e9..71c0fcfea8b 100644 --- a/mysql-test/suite/innodb/t/innodb-truncate.test +++ b/mysql-test/suite/innodb/t/innodb-truncate.test @@ -1,4 +1,5 @@ --source include/have_innodb.inc +let $datadir=`select @@datadir`; --echo # --echo # TRUNCATE TABLE --echo # @@ -73,3 +74,21 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't1'; INSERT INTO t1 () VALUES (), (); SELECT a FROM t1 ORDER BY a; DROP TABLE t1; + +# +# MDEV-18923 Assertion `!lex_string_cmp(system_charset_info, fk_info->referenced_table, &table->s->table_name)' failed in fk_truncate_illegal_if_parent +# +call mtr.add_suppression('InnoDB: in RENAME TABLE table `test`.`t3`'); +SET FOREIGN_KEY_CHECKS= OFF; +CREATE TABLE t1 (f2 INT, f4 INT, KEY(f2), FOREIGN KEY (f4) REFERENCES t3 (f4)) ENGINE=InnoDB; +SET FOREIGN_KEY_CHECKS= ON; +CREATE TABLE t2 (f2 INT, FOREIGN KEY(f2) REFERENCES t1 (f2)) ENGINE=InnoDB; +--error ER_CANT_CREATE_TABLE +CREATE TABLE t3 (a INT) ENGINE=InnoDB; +--replace_result $datadir ./ +--error ER_ERROR_ON_RENAME +ALTER TABLE t1 RENAME TO t3; +ALTER TABLE t1 FORCE; +--error ER_TRUNCATE_ILLEGAL_FK +TRUNCATE TABLE t1; +DROP TABLE t2, t1; diff --git a/mysql-test/suite/innodb/t/xa_debug.test b/mysql-test/suite/innodb/t/xa_debug.test index 5724891bb65..5e38ba1124b 100644 --- a/mysql-test/suite/innodb/t/xa_debug.test +++ b/mysql-test/suite/innodb/t/xa_debug.test @@ -20,6 +20,7 @@ dec $trial; connection default; # Kill and restart the server. +FLUSH TABLES; -- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -- shutdown_server 0 -- source include/wait_until_disconnected.inc |