mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '11.1' into 11.2
This commit is contained in:
5
mysql-test/suite/innodb/t/alter_copy_bulk.combinations
Normal file
5
mysql-test/suite/innodb/t/alter_copy_bulk.combinations
Normal file
@@ -0,0 +1,5 @@
|
||||
[ON]
|
||||
--innodb_alter_copy_bulk=ON
|
||||
|
||||
[OFF]
|
||||
--innodb_alter_copy_bulk=OFF
|
44
mysql-test/suite/innodb/t/alter_copy_bulk.test
Normal file
44
mysql-test/suite/innodb/t/alter_copy_bulk.test
Normal file
@@ -0,0 +1,44 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_partition.inc
|
||||
--source include/have_sequence.inc
|
||||
SET @@alter_algorithm=COPY;
|
||||
|
||||
CREATE TABLE t1(f1 CHAR(200), f2 INT NOT NULL)engine=InnoDB;
|
||||
INSERT INTO t1 SELECT repeat('a', 200), seq FROM seq_1_to_2;
|
||||
# Buffer fits in the memory
|
||||
ALTER TABLE t1 FORCE;
|
||||
|
||||
# Insert more entries
|
||||
INSERT INTO t1 SELECT repeat('b', 200), seq FROM seq_3_to_65536;
|
||||
# Alter should use temporary file for sorting
|
||||
ALTER TABLE t1 ADD INDEX(f2);
|
||||
|
||||
# Error while buffering the insert operation
|
||||
--error ER_DUP_ENTRY
|
||||
ALTER TABLE t1 ADD PRIMARY KEY(f1(2));
|
||||
|
||||
INSERT INTO t1 VALUES(repeat('a', 200), 1);
|
||||
# Error while applying the bulk insert operation
|
||||
--error ER_DUP_ENTRY
|
||||
ALTER TABLE t1 ADD UNIQUE KEY(f2);
|
||||
|
||||
# Ignore shouldn't go through bulk operation
|
||||
ALTER IGNORE TABLE t1 MODIFY f1 CHAR(200) NOT NULL;
|
||||
|
||||
CREATE TABLE t2(f1 INT NOT NULL,
|
||||
FOREIGN KEY(f1) REFERENCES t1(f2))ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES(1);
|
||||
# Bulk operation shouldn't happen because of foreign key constraints
|
||||
ALTER TABLE t2 FORCE;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (f1 INT, f2 INT) ENGINE=InnoDB PARTITION BY HASH(f1) PARTITIONS 2;
|
||||
INSERT INTO t1 VALUES(1, 1);
|
||||
INSERT INTO t1 SELECT seq, seq * 2 FROM seq_1_to_2;
|
||||
# Buffer fits in the memory
|
||||
ALTER TABLE t1 FORCE;
|
||||
# Insert more entries
|
||||
INSERT INTO t1 SELECT seq, seq * 2 FROM seq_3_to_65536;
|
||||
# Alter should use temporary file for sorting
|
||||
ALTER TABLE t1 ADD INDEX(f2);
|
||||
DROP TABLE t1;
|
@@ -1186,6 +1186,30 @@ DROP TABLE binaries, collections;
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
f1 VARCHAR(32)BINARY NOT NULL,
|
||||
f2 VARCHAR(32)BINARY NOT NULL,
|
||||
PRIMARY KEY (f1),
|
||||
INDEX(f2)
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES('MySQL', 'InnoDB'), ('MariaDB', 'NDB');
|
||||
|
||||
CREATE TABLE t2
|
||||
(
|
||||
f1 VARCHAR(32)BINARY NOT NULL,
|
||||
f2 VARCHAR(255)BINARY NOT NULL,
|
||||
f3 int, PRIMARY KEY (f1), INDEX(f1), INDEX(f2)
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES('MySQL', 'MySQL', 1),
|
||||
('MariaDB', 'MariaDB', 1);
|
||||
ALTER TABLE t1 ADD FOREIGN KEY (f1) REFERENCES t2 (f2);
|
||||
# MDEV-33927 TODO: change the warning message
|
||||
--error ER_FK_CANNOT_DELETE_PARENT
|
||||
ALTER TABLE t2 ADD FOREIGN KEY (f2) REFERENCES t2 (f2),
|
||||
ADD UNIQUE INDEX(f3);
|
||||
drop table t1, t2;
|
||||
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
|
||||
|
||||
--echo # End of 10.11 tests
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
@@ -82,6 +82,26 @@ INSERT INTO t2() VALUES();
|
||||
SELECT * FROM t2 ORDER BY id;
|
||||
DROP TABLE t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-34181 Instant table aborts after discard tablespace
|
||||
--echo #
|
||||
CREATE TABLE t1(c3 INT, c2 INT, c1 INT KEY)ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1, 1, 1), (2, 2, 2);
|
||||
CREATE TABLE t2 (c1 INT KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES(1);
|
||||
ALTER TABLE t2 ADD c2 INT;
|
||||
FLUSH TABLES t1 FOR EXPORT;
|
||||
let $datadir=`select @@datadir`;
|
||||
--copy_file $datadir/test/t1.ibd $datadir/test/imp_t1.ibd
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
ALTER TABLE t2 ADD c3 INT FIRST;
|
||||
--copy_file $datadir/test/imp_t1.ibd $datadir/test/t2.ibd
|
||||
|
||||
--replace_regex /opening '.*\/test\//opening '.\/test\//
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
SHOW CREATE TABLE t2;
|
||||
DROP TABLE t2, t1;
|
||||
--echo # End of 10.5 tests
|
||||
|
||||
--echo #
|
||||
|
@@ -104,3 +104,15 @@ DROP TABLE t1;
|
||||
ALTER TABLE mysql.innodb_table_stats FORCE, LOCK=NONE, ALGORITHM=INPLACE;
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
ALTER TABLE mysql.innodb_index_stats FORCE, LOCK=NONE, ALGORITHM=INPLACE;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-34474 InnoDB: Failing assertion: stat_n_leaf_pages > 0
|
||||
--echo # in ha_innobase::estimate_rows_upper_bound
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t (c1 INT,c2 INT,
|
||||
INDEX(c1))STATS_PERSISTENT=1 ENGINE=INNODB;
|
||||
UPDATE mysql.innodb_index_stats SET stat_value=0 WHERE database_name like "test" and table_name like 't';
|
||||
UPDATE mysql.innodb_table_stats SET clustered_index_size= 0, sum_of_other_index_sizes=0 WHERE database_name like "test" and table_name like 't';
|
||||
UPDATE t SET c1=+1 ORDER BY c2;
|
||||
DROP TABLE t;
|
||||
|
26
mysql-test/suite/innodb/t/lock_release.test
Normal file
26
mysql-test/suite/innodb/t/lock_release.test
Normal file
@@ -0,0 +1,26 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_partition.inc
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-34542 Assertion `lock_trx_has_sys_table_locks(trx) == __null'
|
||||
--echo # failed in void row_mysql_unfreeze_data_dictionary(trx_t*)
|
||||
--echo #
|
||||
--echo #
|
||||
CREATE TABLE t1 (c1 CHAR(1) ,c2 INT) ENGINE=INNODB
|
||||
PARTITION BY LINEAR HASH ((c2)) PARTITIONS 512;
|
||||
CREATE TABLE t2 (a INT) ENGINE=INNODB;
|
||||
|
||||
set @old_table_open_cache= @@table_open_cache;
|
||||
XA START 'a';
|
||||
INSERT INTO mysql.innodb_index_stats SELECT * FROM mysql.innodb_index_stats WHERE table_name='';
|
||||
SET GLOBAL table_open_cache=10;
|
||||
INSERT into t2 (a) VALUES (1);
|
||||
SELECT * FROM t1;
|
||||
XA END 'a';
|
||||
XA PREPARE 'a';
|
||||
# Added sleep to make sure that InnoDB main thread is to remove
|
||||
# the innodb_index_stats from table cache
|
||||
SELECT sleep(3);
|
||||
XA ROLLBACK 'a';
|
||||
DROP TABLE t1, t2;
|
||||
SET GLOBAL table_open_cache=@old_table_open_cache;
|
Reference in New Issue
Block a user