mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
Merge 10.2 into 10.3
This commit is contained in:
@@ -10,7 +10,6 @@ create table t2(a int, b int, key(a),key(b))engine=innodb;
|
||||
alter table t2 add constraint b foreign key (b) references t1(a);
|
||||
alter table t1 add constraint b1 foreign key (b) references t2(a);
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
alter table t2 add constraint b1 foreign key (b) references t1(a);
|
||||
|
||||
|
||||
@@ -334,3 +334,10 @@ DROP TABLE t1;
|
||||
|
||||
DROP PROCEDURE get_index_id;
|
||||
DROP PROCEDURE get_table_id;
|
||||
|
||||
# LEN must increase here
|
||||
create table t (a varchar(100)) engine=innodb;
|
||||
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
|
||||
alter table t modify a varchar(110), algorithm=inplace;
|
||||
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
|
||||
drop table t;
|
||||
|
||||
@@ -14,7 +14,6 @@ constraint c1 foreign key (f1) references t1(f1)) engine=InnoDB;
|
||||
create table t2 (f1 int primary key,
|
||||
constraint c1 foreign key (f1) references t1(f1)) engine=innodb;
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
alter table t2 add constraint c1 foreign key (f1) references t1(f1);
|
||||
|
||||
@@ -191,6 +190,57 @@ disconnect fk;
|
||||
|
||||
DROP TABLE t3,t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18222 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N
|
||||
--echo # or ASAN heap-use-after-free in dict_foreign_remove_from_cache upon CHANGE COLUMN
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT, UNIQUE(a), KEY(a)) ENGINE=InnoDB;
|
||||
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (a);
|
||||
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||
ALTER TABLE t1 CHANGE COLUMN a a TIME NOT NULL;
|
||||
ALTER TABLE t1 ADD pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY;
|
||||
ALTER TABLE t1 CHANGE COLUMN a b TIME;
|
||||
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18256 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N
|
||||
--echo # upon DROP FOREIGN KEY
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (b INT PRIMARY KEY, FOREIGN KEY fk1 (b) REFERENCES t1 (a))
|
||||
ENGINE=InnoDB;
|
||||
ALTER TABLE t2 DROP FOREIGN KEY fk1, DROP FOREIGN KEY fk1;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (f VARCHAR(256)) ENGINE=InnoDB;
|
||||
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||
ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x);
|
||||
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
|
||||
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (f VARCHAR(256), FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY)
|
||||
ENGINE=InnoDB;
|
||||
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||
ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x);
|
||||
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
|
||||
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18630 Conditional jump or move depends on uninitialised value
|
||||
--echo # in ib_push_warning / dict_create_foreign_constraints_low
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
ALTER IGNORE TABLE t1 ADD FOREIGN KEY (a) REFERENCES t2 (b);
|
||||
--replace_regex /#sql-[0-9_a-f-]*/#sql-temporary/
|
||||
SHOW WARNINGS;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # Start of 10.2 tests
|
||||
|
||||
--echo #
|
||||
|
||||
@@ -48,10 +48,8 @@ create table t2(a int, b int, constraint a foreign key a (a) references t1(a),
|
||||
constraint a foreign key a (a) references t1(b)) engine=innodb;
|
||||
show warnings;
|
||||
create table t2(a int, b int, constraint a foreign key a (a) references t1(a)) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
alter table t2 add constraint b foreign key (b) references t2(b);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t2, t1;
|
||||
|
||||
@@ -60,10 +58,8 @@ drop table t2, t1;
|
||||
#
|
||||
|
||||
create table t1 (f1 integer primary key) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
alter table t1 add constraint c1 foreign key (f1) references t11(f1);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
||||
@@ -87,15 +83,11 @@ create temporary table t1(a int not null primary key, b int, key(b)) engine=inno
|
||||
--echo Warning 150 Alter table `mysqld.1`.`t1` with foreign key constraint failed. Referenced table `mysqld.1`.`t1` not found in the data dictionary close to foreign key(b) references t1(a).
|
||||
--echo Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
--echo Warning 1215 Cannot add foreign key constraint
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
create temporary table t2(a int, foreign key(a) references t1(a)) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
alter table t1 add foreign key(b) references t1(a);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
||||
@@ -103,17 +95,13 @@ drop table t1;
|
||||
# Column numbers do not match
|
||||
#
|
||||
create table t1(a int not null primary key, b int, key(b)) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1239
|
||||
alter table t1 add foreign key(a,b) references t1(a);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t1;
|
||||
create table t1(a int not null primary key, b int, key(b)) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1239
|
||||
alter table t1 add foreign key(a) references t1(a,b);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
||||
@@ -121,15 +109,11 @@ drop table t1;
|
||||
# ON UPDATE/DELETE SET NULL on NOT NULL column
|
||||
#
|
||||
create table t1 (f1 integer not null primary key) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
alter table t1 add constraint c1 foreign key (f1) references t1(f1) on update set null;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
create table t2(a int not null, foreign key(a) references t1(f1) on delete set null) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
||||
@@ -137,9 +121,7 @@ drop table t1;
|
||||
# Incorrect types
|
||||
#
|
||||
create table t1 (id int not null primary key, f1 int, f2 int, key(f1)) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
create table t2(a char(20), key(a), foreign key(a) references t1(f1)) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
||||
@@ -115,11 +115,9 @@ CREATE TABLE t2 (
|
||||
CONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
--replace_regex /#sql-[0-9_a-f-]*/#sql-temporary/
|
||||
--error 1005
|
||||
ALTER TABLE t2 ADD CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE;
|
||||
|
||||
--replace_regex /#sql-[0-9_a-f-]*/#sql-temporary/
|
||||
show warnings;
|
||||
|
||||
drop table t2;
|
||||
|
||||
@@ -492,7 +492,6 @@ reap;
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
disconnect con1;
|
||||
CREATE TABLE t2 (c VARCHAR(64)) ENGINE=InnoDB;
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
ALTER TABLE t2 ADD FOREIGN KEY (c) REFERENCES t1 (c);
|
||||
DROP TABLE t2,t1;
|
||||
|
||||
@@ -218,7 +218,6 @@ alter table t4 add constraint dc foreign key (a) references t1(a);
|
||||
--disable_info
|
||||
show create table t4;
|
||||
# mysqltest first does replace_regex, then replace_result
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLD_DATADIR ./ master-data/ ''
|
||||
# a foreign key 'test/dc' already exists
|
||||
@@ -416,7 +415,6 @@ SET FOREIGN_KEY_CHECKS=0;
|
||||
--enable_info
|
||||
|
||||
# mysqltest first does replace_regex, then replace_result
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLD_DATADIR ./ master-data/ ''
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
@@ -426,7 +424,6 @@ ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1);
|
||||
# mysqltest first does replace_regex, then replace_result
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLD_DATADIR ./ master-data/ ''
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
@@ -441,7 +438,6 @@ ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1), ALGORITHM=INPLACE;
|
||||
|
||||
# mysqltest first does replace_regex, then replace_result
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLD_DATADIR ./ master-data/ ''
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
@@ -450,7 +446,6 @@ ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
|
||||
ALTER TABLE t1 MODIFY COLUMN c2 BIGINT(12) NOT NULL;
|
||||
# mysqltest first does replace_regex, then replace_result
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLD_DATADIR ./ master-data/ ''
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
|
||||
@@ -9,20 +9,16 @@ set global innodb_compression_algorithm = 1;
|
||||
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
|
||||
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_compressed=1;
|
||||
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_compressed=1;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed page_compressed=1;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
show create table innodb_compact;
|
||||
show create table innodb_dynamic;
|
||||
|
||||
# MDEV-7133: InnoDB: Assertion failure in thread 140737091569408 in file dict0mem.cc line 74
|
||||
# InnoDB: Failing assertion: dict_tf_is_valid(flags)
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_compressed=1;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
|
||||
show create table innodb_redundant;
|
||||
|
||||
@@ -26,14 +26,12 @@ select * from t1;
|
||||
--error ER_READ_ONLY_MODE
|
||||
insert into t1 values(2, 3);
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
alter table t1 add f3 int not null, algorithm=copy;
|
||||
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
alter table t1 add f3 int not null, algorithm=inplace;
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
drop index idx on t1;
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
@@ -66,14 +64,12 @@ select * from t2;
|
||||
--error ER_READ_ONLY_MODE
|
||||
insert into t2 values(2, 3);
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
alter table t2 add f3 int not null, algorithm=copy;
|
||||
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
alter table t2 add f3 int not null, algorithm=inplace;
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
drop index idx on t2;
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
# LEN must increase here
|
||||
create table t (a varchar(100)) engine=innodb;
|
||||
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
|
||||
alter table t modify a varchar(110), algorithm=inplace;
|
||||
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
|
||||
drop table t;
|
||||
@@ -38,13 +38,14 @@ update t1 set c = 'MariaDB';
|
||||
update t1 set c = 'InnoDB';
|
||||
eval set global debug_dbug = '+d,$SEARCH_PATTERN';
|
||||
commit;
|
||||
call mtr.add_suppression("InnoDB: innodb_undo_tablespaces=0 disables dedicated undo log tablespaces");
|
||||
# FIXME: remove this work-around, and generate less log!
|
||||
call mtr.add_suppression("InnoDB: The redo log transaction size ");
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
--source include/shutdown_mysqld.inc
|
||||
--source include/search_pattern_in_file.inc
|
||||
# FIXME: remove this work-around, and generate less log!
|
||||
--let $restart_parameters= --innodb-buffer-pool-size=16m
|
||||
--let $restart_parameters= --innodb-buffer-pool-size=16m --innodb-undo-tablespaces=1
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
drop table t1;
|
||||
|
||||
Reference in New Issue
Block a user