1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-27 05:41:41 +03:00

Merge branch '10.1' into 10.2

This commit is contained in:
Oleksandr Byelkin
2019-05-04 17:04:55 +02:00
205 changed files with 2788 additions and 657 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -569,6 +569,26 @@ SELECT COUNT(*) FROM t1;
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 #

View File

@@ -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;

View File

@@ -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