mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-13626 Merge InnoDB test cases from MySQL 5.7 (part 2)
Import the changes to innodb.innodb-index innodb.innodb-index-debug Note: As noted in MDEV-13613, due to the behaviour change in MDEV-11114, DROP COLUMN will not imply DROP/ADD PRIMARY/UNIQUE KEY, like it does in MySQL. The tests have been adjusted accordingly.
This commit is contained in:
@ -34,9 +34,8 @@ CREATE UNIQUE INDEX ui ON bug13861218(c1);
|
||||
SET DEBUG_DBUG = @saved_debug_dbug;
|
||||
DROP TABLE bug13861218;
|
||||
#
|
||||
# Bug #21762319 ADDING INDEXES ON EMPTY TABLE IS SLOW
|
||||
# WITH LARGE INNODB_SORT_BUFFER_SIZE.
|
||||
call mtr.add_suppression("InnoDB: Cannot create temporary merge file");
|
||||
# Bug #17657223 EXCESSIVE TEMPORARY FILE USAGE IN ALTER TABLE
|
||||
#
|
||||
create table t480(a serial)engine=innodb;
|
||||
insert into t480
|
||||
values(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
|
||||
@ -47,14 +46,252 @@ insert into t480 select 0 from t480;
|
||||
insert into t480 select 0 from t480;
|
||||
create table t1(f1 int auto_increment not null,
|
||||
f2 char(200) not null, f3 char(200) not null,
|
||||
f4 char(200) not null,primary key(f1))engine=innodb;
|
||||
insert into t1 select NULL,'aaa','bbb','ccc' from t480;
|
||||
insert into t1 select NULL,'aaaa','bbbb','cccc' from t480;
|
||||
insert into t1 select NULL,'aaaaa','bbbbb','ccccc' from t480;
|
||||
insert into t1 select NULL,'aaaaaa','bbbbbb','cccccc' from t480;
|
||||
insert into t1 select NULL,'aaaaaaa','bbbbbbb','ccccccc' from t480;
|
||||
insert into t1 select NULL,'aaaaaaaa','bbbbbbbb','cccccccc' from t480;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2880
|
||||
drop table t1, t480;
|
||||
primary key(f1,f2,f3), key(f1))engine=innodb;
|
||||
insert into t1 select NULL,'aaa','bbb' from t480;
|
||||
insert into t1 select NULL,'aaaa','bbbb' from t480;
|
||||
insert into t1 select NULL,'aaaaa','bbbbb' from t480;
|
||||
insert into t1 select NULL,'aaaaaa','bbbbbb' from t480;
|
||||
SET DEBUG_DBUG = '+d,row_merge_write_failure';
|
||||
alter table t1 drop primary key,add primary key(f2,f1);
|
||||
ERROR HY000: Temporary file write failure
|
||||
SET DEBUG_DBUG = @saved_debug_dbug;
|
||||
drop table t1;
|
||||
connect con1,localhost,root;
|
||||
create table t1(k1 int auto_increment primary key,
|
||||
k2 char(200),k3 char(200))engine=innodb;
|
||||
insert into t1 values(NULL,'a','b'), (NULL,'aa','bb');
|
||||
SET DEBUG_SYNC= 'row_merge_after_scan
|
||||
SIGNAL opened WAIT_FOR flushed';
|
||||
optimize table t1;
|
||||
connection default;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR opened';
|
||||
INSERT INTO t1 select NULL,'aaa','bbb' from t480;
|
||||
SET DEBUG_SYNC= 'now SIGNAL flushed';
|
||||
connection con1;
|
||||
/*con1 reap*/ Optimize table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t1 optimize status OK
|
||||
affected rows: 2
|
||||
SELECT COUNT(k1),k2,k3 FROM t1 GROUP BY k2,k3;
|
||||
COUNT(k1) k2 k3
|
||||
1 a b
|
||||
1 aa bb
|
||||
480 aaa bbb
|
||||
drop table t1;
|
||||
create table t1(k1 int auto_increment primary key,
|
||||
k2 char(200),k3 char(200))engine=innodb;
|
||||
SET DEBUG_SYNC= 'row_merge_after_scan
|
||||
SIGNAL opened WAIT_FOR flushed';
|
||||
ALTER TABLE t1 ADD COLUMN k4 int;
|
||||
connection default;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR opened';
|
||||
SET debug = '+d,row_log_tmpfile_fail';
|
||||
Warnings:
|
||||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
|
||||
INSERT INTO t1 select NULL,'aaa','bbb' from t480;
|
||||
INSERT INTO t1 select NULL,'aaaa','bbbb' from t480;
|
||||
SET DEBUG_SYNC= 'now SIGNAL flushed';
|
||||
SET DEBUG_DBUG = @saved_debug_dbug;
|
||||
connection con1;
|
||||
/*con1 reap*/ ALTER TABLE t1 ADD COLUMN k4 int;
|
||||
ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
|
||||
SELECT COUNT(k1),k2,k3 FROM t1 GROUP BY k2,k3;
|
||||
COUNT(k1) k2 k3
|
||||
480 aaa bbb
|
||||
480 aaaa bbbb
|
||||
disconnect con1;
|
||||
connection default;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`k1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`k2` char(200) DEFAULT NULL,
|
||||
`k3` char(200) DEFAULT NULL,
|
||||
PRIMARY KEY (`k1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1023 DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
drop table t480;
|
||||
SET DEBUG_SYNC='RESET';
|
||||
#
|
||||
# BUG#21612714 ALTER TABLE SORTING SKIPPED WHEN CHANGE PK AND DROP
|
||||
# LAST COLUMN OF OLD PK
|
||||
#
|
||||
SET DEBUG_DBUG = '+d,innodb_alter_table_pk_assert_no_sort';
|
||||
create table t1(o1 varchar(10), primary key(o1(2))) engine = innodb;
|
||||
insert into t1 values('abd'), ('acd');
|
||||
alter table t1 drop primary key, add primary key(o1(3)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), primary key(o1(2))) engine = innodb;
|
||||
insert into t1 values('abd'), ('acd');
|
||||
alter table t1 drop primary key, add primary key(o1), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), primary key(o1(2))) engine = innodb;
|
||||
insert into t1 values('abd'), ('acd');
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1(3), n1), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), primary key(o1(2))) engine = innodb;
|
||||
insert into t1 values('abd'), ('acd');
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1, n1), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 int not null, primary key(o1(2))) engine = innodb;
|
||||
insert into t1 values('abd', 1), ('acd', 2);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1(3), o2), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 int not null, primary key(o1(2))) engine = innodb;
|
||||
insert into t1 values('abd', 1), ('acd', 2);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1, o2), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), primary key(o1(3))) engine = innodb;
|
||||
insert into t1 values('abd'), ('acd');
|
||||
alter table t1 drop primary key, add primary key(o1(2)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), primary key(o1)) engine = innodb;
|
||||
insert into t1 values('abd'), ('acd');
|
||||
alter table t1 drop primary key, add primary key(o1(2)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 int, primary key(o1(3), o2)) engine = innodb;
|
||||
insert into t1 values('abd', 1), ('acd', 2);
|
||||
alter table t1 drop primary key, add primary key(o1(2)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 int, primary key(o1, o2)) engine = innodb;
|
||||
insert into t1 values('abd', 1), ('acd', 2);
|
||||
alter table t1 drop primary key, add primary key(o1(2)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 int, primary key(o1(3), o2)) engine = innodb;
|
||||
insert into t1 values('abd', 1), ('acd', 2);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1(2),n1), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 int, primary key(o1, o2)) engine = innodb;
|
||||
insert into t1 values('abd', 1), ('acd', 2);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1(2),n1), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 int, primary key(o1(3), o2)) engine = innodb;
|
||||
insert into t1 values('abd', 1), ('acd', 2);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1(3),n1), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 int, primary key(o1, o2)) engine = innodb;
|
||||
insert into t1 values('abd', 1), ('acd', 2);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1,n1), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 varchar(10), primary key(o1,o2(3))) engine = innodb;
|
||||
insert into t1 values(1,'abd'), (2,'acd');
|
||||
alter table t1 drop primary key, add primary key(o1,o2(2)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 varchar(10), primary key(o1,o2)) engine = innodb;
|
||||
insert into t1 values(1,'abd'), (2,'acd');
|
||||
alter table t1 drop primary key, add primary key(o1,o2(2)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 varchar(10), primary key(o1,o2(2))) engine = innodb;
|
||||
insert into t1 values(1, 'abd'), (2, 'acd');
|
||||
alter table t1 drop primary key, add primary key(o1,o2(3)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 varchar(10), primary key(o1,o2(2))) engine = innodb;
|
||||
insert into t1 values(1, 'abd'), (2, 'acd');
|
||||
alter table t1 drop primary key, add primary key(o1,o2), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 varchar(10), o3 int, primary key(o1,o2(3),o3)) engine = innodb;
|
||||
insert into t1 values(1, 'abd', 1), (2, 'acd', 2);
|
||||
alter table t1 drop primary key, add primary key(o1,o2(2)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 varchar(10), o3 int, primary key(o1,o2,o3)) engine = innodb;
|
||||
insert into t1 values(1, 'abd', 1), (2, 'acd', 2);
|
||||
alter table t1 drop primary key, add primary key(o1,o2(2)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 varchar(10), primary key(o1(3),o2(3))) engine = innodb;
|
||||
insert into t1 values('abd', 'acd'), ('acd', 'abd');
|
||||
alter table t1 drop primary key, add primary key(o1(3),o2(2)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 varchar(10), primary key(o1,o2)) engine = innodb;
|
||||
insert into t1 values('abd', 'acd'), ('acd', 'abd');
|
||||
alter table t1 drop primary key, add primary key(o1,o2(2)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 varchar(10), primary key(o1(3),o2(2))) engine = innodb;
|
||||
insert into t1 values('abd', 'acd'), ('acd', 'abd');
|
||||
alter table t1 drop primary key, add primary key(o1(3),o2(3)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 varchar(10), primary key(o1,o2(2))) engine = innodb;
|
||||
insert into t1 values('abd', 'acd'), ('acd', 'abd');
|
||||
alter table t1 drop primary key, add primary key(o1,o2), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 int, o3 varchar(10), primary key(o1(3),o2,o3(2))) engine = innodb;
|
||||
insert into t1 values('abd', 1, 'acd'), ('acd', 2, 'abd');
|
||||
alter table t1 drop primary key, add primary key(o1(3),o2,o3(3)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 int, o3 varchar(10), primary key(o1,o2,o3(2))) engine = innodb;
|
||||
insert into t1 values('abd', 1, 'acd'), ('acd', 2, 'abd');
|
||||
alter table t1 drop primary key, add primary key(o1,o2,o3), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 int, o3 varchar(10), primary key(o1(3),o2,o3(3))) engine = innodb;
|
||||
insert into t1 values('abd', 1, 'acd'), ('acd', 2, 'abd');
|
||||
alter table t1 drop primary key, add primary key(o1(3),o2,o3(2)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 varchar(10), o2 int, o3 varchar(10), primary key(o1,o2,o3(3))) engine = innodb;
|
||||
insert into t1 values('abd', 1, 'acd'), ('acd', 2, 'abd');
|
||||
alter table t1 drop primary key, add primary key(o1,o2,o3(2)), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int not null, primary key(o1)) engine = innodb;
|
||||
insert into t1 values(1,1),(2,2);
|
||||
alter table t1 drop primary key, add primary key(o1,o2), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int not null, primary key(o1)) engine = innodb;
|
||||
insert into t1 values(1,1),(2,2);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1,n1), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int not null, primary key(o1)) engine = innodb;
|
||||
insert into t1 values(1,1),(2,2);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(n1,o1), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int not null, primary key(o1)) engine = innodb;
|
||||
insert into t1 values(1,1),(2,2);
|
||||
alter table t1 add n1 int not null, add n2 int not null, drop primary key, add primary key(n1,o1,n2), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int not null, primary key(o1)) engine = innodb;
|
||||
insert into t1 values(1,1),(2,2);
|
||||
alter table t1 add n1 int not null, add n2 int not null, drop primary key, add primary key(n1,n2,o1), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int not null, primary key(o1)) engine = innodb;
|
||||
insert into t1 values(1,1),(2,2);
|
||||
alter table t1 add n1 int not null, add n2 int not null, drop primary key, add primary key(o1,n1,n2), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int not null, primary key(o1)) engine = innodb;
|
||||
insert into t1 values(1,1),(2,2);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1,o2,n1), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int not null, primary key(o1)) engine = innodb;
|
||||
insert into t1 values(1,1),(2,2);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1,n1,o2), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int not null, primary key(o1)) engine = innodb;
|
||||
insert into t1 values(1,1),(2,2);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(n1,o1,o2), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int not null, o3 int not null, primary key(o1)) engine = innodb;
|
||||
insert into t1 values(1,1,2),(2,2,1);
|
||||
alter table t1 drop primary key, add primary key(o1,o2,o3), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int not null, o3 int not null, primary key(o1)) engine = innodb;
|
||||
insert into t1 values(1,1,2),(2,2,1);
|
||||
alter table t1 drop primary key, add primary key(o1,o3,o2), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int, o3 int, primary key(o1,o2,o3)) engine = innodb;
|
||||
insert into t1 values(1,1,2),(2,2,1);
|
||||
alter table t1 drop primary key, add primary key(o1,o2), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int, o3 int, o4 int not null, primary key(o1,o2,o3)) engine = innodb;
|
||||
insert into t1 values(1,1,2,2),(2,2,1,1);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1,o2,o3,o4), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int, o3 int, primary key(o1,o2,o3)) engine = innodb;
|
||||
insert into t1 values(1,1,2),(2,2,1);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1,o2,n1), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int, o3 int, primary key(o1,o2,o3)) engine = innodb;
|
||||
insert into t1 values(1,1,2),(2,2,1);
|
||||
alter table t1 add n1 int not null, drop primary key, add primary key(o1,n1,o2), lock=none;
|
||||
drop table t1;
|
||||
create table t1(o1 int, o2 int, o3 int, primary key(o1,o2,o3)) engine = innodb;
|
||||
insert into t1 values(1,1,2),(2,2,1);
|
||||
alter table t1 drop primary key, add primary key(o1), lock=none;
|
||||
drop table t1;
|
||||
SET DEBUG_DBUG = @saved_debug_dbug;
|
||||
|
Reference in New Issue
Block a user