mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
tests: move around, add new
two new tests: * alter table times out because of a long concurrent trx * alter table adds a column in the middle
This commit is contained in:
@ -1,4 +1,3 @@
|
|||||||
[standalone]
|
[nobinlog]
|
||||||
[binlog]
|
[binlog]
|
||||||
--log-bin=master-bin
|
--log-bin=master-bin
|
||||||
|
|
3
mysql-test/include/binlog_combinations.inc
Normal file
3
mysql-test/include/binlog_combinations.inc
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#
|
||||||
|
# Adds standalone and binlog combinations
|
||||||
|
#
|
@ -1,2 +0,0 @@
|
|||||||
Variable_name Value
|
|
||||||
log_bin OFF
|
|
@ -1733,7 +1733,6 @@ affected rows: 0
|
|||||||
info: Records: 0 Duplicates: 0 Warnings: 1
|
info: Records: 0 Duplicates: 0 Warnings: 1
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1831 Duplicate index `i3`. This is deprecated and will be disallowed in a future release
|
Note 1831 Duplicate index `i3`. This is deprecated and will be disallowed in a future release
|
||||||
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= COPY, LOCK= NONE;
|
|
||||||
ALTER TABLE t1 ADD INDEX i5(b), ALGORITHM= COPY, LOCK= SHARED;
|
ALTER TABLE t1 ADD INDEX i5(b), ALGORITHM= COPY, LOCK= SHARED;
|
||||||
affected rows: 2
|
affected rows: 2
|
||||||
info: Records: 2 Duplicates: 0 Warnings: 1
|
info: Records: 2 Duplicates: 0 Warnings: 1
|
||||||
@ -1750,7 +1749,6 @@ ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= SHARED;
|
|||||||
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE
|
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE
|
||||||
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
|
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
|
||||||
affected rows: 0
|
affected rows: 0
|
||||||
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= NONE;
|
|
||||||
ALTER ONLINE TABLE m1 ADD COLUMN c int;
|
ALTER ONLINE TABLE m1 ADD COLUMN c int;
|
||||||
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
|
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
|
||||||
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= SHARED;
|
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= SHARED;
|
||||||
|
@ -1517,12 +1517,6 @@ ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
|
|||||||
ALTER TABLE t1 ADD INDEX i1(b), ALGORITHM= INPLACE, LOCK= NONE;
|
ALTER TABLE t1 ADD INDEX i1(b), ALGORITHM= INPLACE, LOCK= NONE;
|
||||||
ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= INPLACE, LOCK= SHARED;
|
ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= INPLACE, LOCK= SHARED;
|
||||||
ALTER TABLE t1 ADD INDEX i3(b), ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
|
ALTER TABLE t1 ADD INDEX i3(b), ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
|
||||||
--disable_info
|
|
||||||
--disable_warnings
|
|
||||||
--error 0,ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
|
||||||
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= COPY, LOCK= NONE;
|
|
||||||
--enable_warnings
|
|
||||||
--enable_info
|
|
||||||
ALTER TABLE t1 ADD INDEX i5(b), ALGORITHM= COPY, LOCK= SHARED;
|
ALTER TABLE t1 ADD INDEX i5(b), ALGORITHM= COPY, LOCK= SHARED;
|
||||||
ALTER TABLE t1 ADD INDEX i6(b), ALGORITHM= COPY, LOCK= EXCLUSIVE;
|
ALTER TABLE t1 ADD INDEX i6(b), ALGORITHM= COPY, LOCK= EXCLUSIVE;
|
||||||
|
|
||||||
@ -1531,10 +1525,6 @@ ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= NONE;
|
|||||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
||||||
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= SHARED;
|
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= SHARED;
|
||||||
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
|
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
|
||||||
--disable_info
|
|
||||||
--error 0,ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
|
||||||
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= NONE;
|
|
||||||
--enable_info
|
|
||||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
||||||
ALTER ONLINE TABLE m1 ADD COLUMN c int;
|
ALTER ONLINE TABLE m1 ADD COLUMN c int;
|
||||||
# This works because the lock will be SNW for the copy phase.
|
# This works because the lock will be SNW for the copy phase.
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
[innodb]
|
|
||||||
[rocksdb]
|
|
@ -1,10 +1,11 @@
|
|||||||
|
set default_storage_engine= innodb;
|
||||||
connect con2, localhost, root,,;
|
connect con2, localhost, root,,;
|
||||||
connection default;
|
connection default;
|
||||||
#
|
#
|
||||||
# Test insert
|
# Test insert
|
||||||
#
|
#
|
||||||
# Insert and add column
|
# Insert and add column
|
||||||
create or replace table t1 (a int) engine=innodb;
|
create or replace table t1 (a int);
|
||||||
insert t1 values (5);
|
insert t1 values (5);
|
||||||
connection con2;
|
connection con2;
|
||||||
set debug_sync= 'now WAIT_FOR ended';
|
set debug_sync= 'now WAIT_FOR ended';
|
||||||
@ -21,8 +22,30 @@ a b
|
|||||||
123 NULL
|
123 NULL
|
||||||
456 NULL
|
456 NULL
|
||||||
789 NULL
|
789 NULL
|
||||||
|
# long transaction and add column
|
||||||
|
create or replace table t1 (a int);
|
||||||
|
insert t1 values (5);
|
||||||
|
connection con2;
|
||||||
|
set debug_sync= 'now WAIT_FOR ended';
|
||||||
|
connection default;
|
||||||
|
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
|
||||||
|
set session lock_wait_timeout=1;
|
||||||
|
alter table t1 add b int NULL, algorithm= copy, lock= none;
|
||||||
|
connection con2;
|
||||||
|
start transaction;
|
||||||
|
insert into t1 values (123), (456), (789);
|
||||||
|
set debug_sync= 'now SIGNAL end';
|
||||||
|
connection default;
|
||||||
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
5
|
||||||
|
set session lock_wait_timeout=default;
|
||||||
|
connection con2;
|
||||||
|
rollback;
|
||||||
|
connection default;
|
||||||
# Insert and add NOT NULL column without default value
|
# Insert and add NOT NULL column without default value
|
||||||
create or replace table t1 (a int) engine=innodb;
|
create or replace table t1 (a int);
|
||||||
insert t1 values (5);
|
insert t1 values (5);
|
||||||
connection con2;
|
connection con2;
|
||||||
set debug_sync= 'now WAIT_FOR ended';
|
set debug_sync= 'now WAIT_FOR ended';
|
||||||
@ -44,7 +67,7 @@ a b
|
|||||||
456 0
|
456 0
|
||||||
789 0
|
789 0
|
||||||
# Insert and add a column with a default value
|
# Insert and add a column with a default value
|
||||||
create or replace table t1 (a int) engine=innodb;
|
create or replace table t1 (a int);
|
||||||
insert t1 values (5);
|
insert t1 values (5);
|
||||||
connection con2;
|
connection con2;
|
||||||
set debug_sync= 'now WAIT_FOR ended';
|
set debug_sync= 'now WAIT_FOR ended';
|
||||||
@ -65,7 +88,7 @@ a b
|
|||||||
# Test update
|
# Test update
|
||||||
#
|
#
|
||||||
# Update and add a column
|
# Update and add a column
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 22);
|
insert t1 values (1, 22);
|
||||||
insert t1 values (3, 44);
|
insert t1 values (3, 44);
|
||||||
connection con2;
|
connection con2;
|
||||||
@ -82,11 +105,29 @@ select * from t1;
|
|||||||
a b c
|
a b c
|
||||||
1 55 1
|
1 55 1
|
||||||
3 44 1
|
3 44 1
|
||||||
|
# Update and add a column in the middle
|
||||||
|
create or replace table t1 (a int primary key, b int);
|
||||||
|
insert t1 values (1, 22);
|
||||||
|
insert t1 values (3, 44);
|
||||||
|
connection con2;
|
||||||
|
set debug_sync= 'now WAIT_FOR ended';
|
||||||
|
connection default;
|
||||||
|
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
|
||||||
|
alter table t1 add c int default(1) after a,
|
||||||
|
algorithm= copy, lock= none;
|
||||||
|
connection con2;
|
||||||
|
update t1 set b= 55 where a = 1;
|
||||||
|
set debug_sync= 'now SIGNAL end';
|
||||||
|
connection default;
|
||||||
|
select * from t1;
|
||||||
|
a c b
|
||||||
|
1 1 55
|
||||||
|
3 1 44
|
||||||
#
|
#
|
||||||
# Test primary key change
|
# Test primary key change
|
||||||
#
|
#
|
||||||
# Drop key, add key
|
# Drop key, add key
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 22);
|
insert t1 values (1, 22);
|
||||||
insert t1 values (3, 44);
|
insert t1 values (3, 44);
|
||||||
connection con2;
|
connection con2;
|
||||||
@ -104,7 +145,7 @@ a b
|
|||||||
3 44
|
3 44
|
||||||
1 55
|
1 55
|
||||||
# Drop key, add key. Two updates
|
# Drop key, add key. Two updates
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 11);
|
insert t1 values (1, 11);
|
||||||
insert t1 values (2, 22);
|
insert t1 values (2, 22);
|
||||||
connection con2;
|
connection con2;
|
||||||
@ -125,7 +166,7 @@ a b
|
|||||||
#
|
#
|
||||||
# Various tests, see below
|
# Various tests, see below
|
||||||
#
|
#
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 11);
|
insert t1 values (1, 11);
|
||||||
insert t1 values (2, 22);
|
insert t1 values (2, 22);
|
||||||
insert t1 values (3, 33);
|
insert t1 values (3, 33);
|
||||||
@ -193,6 +234,7 @@ a b
|
|||||||
9 99
|
9 99
|
||||||
#
|
#
|
||||||
# MYISAM. Only Inserts can be tested.
|
# MYISAM. Only Inserts can be tested.
|
||||||
|
# (everything else is a table lock disallowing concurrent reads)
|
||||||
#
|
#
|
||||||
create or replace table t1 (a int) engine=myisam;
|
create or replace table t1 (a int) engine=myisam;
|
||||||
insert t1 values (5);
|
insert t1 values (5);
|
||||||
@ -212,7 +254,7 @@ a b
|
|||||||
456 NULL
|
456 NULL
|
||||||
789 NULL
|
789 NULL
|
||||||
# Test incompatible changes
|
# Test incompatible changes
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 22);
|
insert t1 values (1, 22);
|
||||||
insert t1 values (3, 44);
|
insert t1 values (3, 44);
|
||||||
connection con2;
|
connection con2;
|
||||||
@ -233,7 +275,7 @@ a b
|
|||||||
# Test log read after EXCLUSIVE lock
|
# Test log read after EXCLUSIVE lock
|
||||||
# Transaction is started before ALTER, and UPDATE is made.
|
# Transaction is started before ALTER, and UPDATE is made.
|
||||||
# Then more UPDATEs.
|
# Then more UPDATEs.
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 11);
|
insert t1 values (1, 11);
|
||||||
insert t1 values (2, 22);
|
insert t1 values (2, 22);
|
||||||
insert t1 values (3, 33);
|
insert t1 values (3, 33);
|
||||||
@ -265,7 +307,7 @@ a b
|
|||||||
#
|
#
|
||||||
# Test progress report.
|
# Test progress report.
|
||||||
#
|
#
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 11);
|
insert t1 values (1, 11);
|
||||||
insert t1 values (2, 22);
|
insert t1 values (2, 22);
|
||||||
insert t1 values (3, 33);
|
insert t1 values (3, 33);
|
||||||
@ -364,7 +406,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
`a` int(11) NOT NULL,
|
`a` int(11) NOT NULL,
|
||||||
`b` int(11) DEFAULT NULL,
|
`b` int(11) DEFAULT NULL,
|
||||||
PRIMARY KEY (`a`)
|
PRIMARY KEY (`a`)
|
||||||
) ENGINE=*SUBSTITUTED* DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||||
select *, UNIX_TIMESTAMP(row_start), UNIX_TIMESTAMP(row_end) from t1 for system_time all;
|
select *, UNIX_TIMESTAMP(row_start), UNIX_TIMESTAMP(row_end) from t1 for system_time all;
|
||||||
a b UNIX_TIMESTAMP(row_start) UNIX_TIMESTAMP(row_end)
|
a b UNIX_TIMESTAMP(row_start) UNIX_TIMESTAMP(row_end)
|
||||||
1 55 1.000000 2147483647.999999
|
1 55 1.000000 2147483647.999999
|
||||||
@ -388,7 +430,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
`a` int(11) NOT NULL,
|
`a` int(11) NOT NULL,
|
||||||
`b` int(11) DEFAULT NULL,
|
`b` int(11) DEFAULT NULL,
|
||||||
PRIMARY KEY (`a`)
|
PRIMARY KEY (`a`)
|
||||||
) ENGINE=*SUBSTITUTED* DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||||
select *, UNIX_TIMESTAMP(row_start), UNIX_TIMESTAMP(row_end) from t1 for system_time all;
|
select *, UNIX_TIMESTAMP(row_start), UNIX_TIMESTAMP(row_end) from t1 for system_time all;
|
||||||
a b UNIX_TIMESTAMP(row_start) UNIX_TIMESTAMP(row_end)
|
a b UNIX_TIMESTAMP(row_start) UNIX_TIMESTAMP(row_end)
|
||||||
1 55 1.000000 3.000000
|
1 55 1.000000 3.000000
|
||||||
@ -412,7 +454,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
`a` int(11) NOT NULL,
|
`a` int(11) NOT NULL,
|
||||||
`b` int(11) DEFAULT NULL,
|
`b` int(11) DEFAULT NULL,
|
||||||
PRIMARY KEY (`a`)
|
PRIMARY KEY (`a`)
|
||||||
) ENGINE=*SUBSTITUTED* DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a b
|
a b
|
||||||
1 88
|
1 88
|
||||||
@ -422,9 +464,9 @@ a b
|
|||||||
#
|
#
|
||||||
# Test ROLLBACK TO SAVEPOINT
|
# Test ROLLBACK TO SAVEPOINT
|
||||||
#
|
#
|
||||||
create or replace table t1 (a int) engine=innodb;
|
create or replace table t1 (a int);
|
||||||
insert t1 values (1), (2);
|
insert t1 values (1), (2);
|
||||||
create or replace table t2 (a int) engine=innodb;
|
create or replace table t2 (a int);
|
||||||
insert t2 values (1), (2);
|
insert t2 values (1), (2);
|
||||||
connection con2;
|
connection con2;
|
||||||
begin;
|
begin;
|
||||||
|
@ -1,30 +1,18 @@
|
|||||||
-- source include/have_debug_sync.inc
|
--source include/have_debug_sync.inc
|
||||||
-- source include/not_embedded.inc
|
--source include/not_embedded.inc
|
||||||
-- source alter_table_online_binlog.inc
|
--source include/binlog_combinations.inc
|
||||||
|
--source include/have_innodb.inc
|
||||||
-- disable_query_log
|
|
||||||
-- if ($MTR_COMBINATION_INNODB) {
|
|
||||||
-- source include/have_innodb.inc
|
|
||||||
set default_storage_engine= innodb;
|
set default_storage_engine= innodb;
|
||||||
-- }
|
|
||||||
-- if ($MTR_COMBINATION_ROCKSDB) {
|
|
||||||
-- source include/have_rocksdb.inc
|
|
||||||
set default_storage_engine= rocksdb;
|
|
||||||
-- }
|
|
||||||
-- enable_query_log
|
|
||||||
|
|
||||||
-- let $default_engine= `select @@default_storage_engine`
|
|
||||||
|
|
||||||
--connect (con2, localhost, root,,)
|
--connect (con2, localhost, root,,)
|
||||||
--connection default
|
--connection default
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Test insert
|
--echo # Test insert
|
||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
--echo # Insert and add column
|
--echo # Insert and add column
|
||||||
create or replace table t1 (a int) engine=innodb;
|
create or replace table t1 (a int);
|
||||||
insert t1 values (5);
|
insert t1 values (5);
|
||||||
|
|
||||||
--connection con2
|
--connection con2
|
||||||
@ -46,8 +34,37 @@ set debug_sync= 'now SIGNAL end';
|
|||||||
--reap
|
--reap
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
|
--echo # long transaction and add column
|
||||||
|
create or replace table t1 (a int);
|
||||||
|
insert t1 values (5);
|
||||||
|
|
||||||
|
--connection con2
|
||||||
|
--send
|
||||||
|
set debug_sync= 'now WAIT_FOR ended';
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
|
||||||
|
set session lock_wait_timeout=1;
|
||||||
|
--send
|
||||||
|
alter table t1 add b int NULL, algorithm= copy, lock= none;
|
||||||
|
|
||||||
|
--connection con2
|
||||||
|
--reap
|
||||||
|
start transaction;
|
||||||
|
insert into t1 values (123), (456), (789);
|
||||||
|
set debug_sync= 'now SIGNAL end';
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
--error ER_LOCK_WAIT_TIMEOUT
|
||||||
|
--reap
|
||||||
|
select * from t1;
|
||||||
|
set session lock_wait_timeout=default;
|
||||||
|
--connection con2
|
||||||
|
rollback;
|
||||||
|
--connection default
|
||||||
|
|
||||||
--echo # Insert and add NOT NULL column without default value
|
--echo # Insert and add NOT NULL column without default value
|
||||||
create or replace table t1 (a int) engine=innodb;
|
create or replace table t1 (a int);
|
||||||
insert t1 values (5);
|
insert t1 values (5);
|
||||||
|
|
||||||
--connection con2
|
--connection con2
|
||||||
@ -70,7 +87,7 @@ set debug_sync= 'now SIGNAL end';
|
|||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo # Insert and add a column with a default value
|
--echo # Insert and add a column with a default value
|
||||||
create or replace table t1 (a int) engine=innodb;
|
create or replace table t1 (a int);
|
||||||
insert t1 values (5);
|
insert t1 values (5);
|
||||||
|
|
||||||
--connection con2
|
--connection con2
|
||||||
@ -97,7 +114,7 @@ select * from t1;
|
|||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
--echo # Update and add a column
|
--echo # Update and add a column
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 22);
|
insert t1 values (1, 22);
|
||||||
insert t1 values (3, 44);
|
insert t1 values (3, 44);
|
||||||
|
|
||||||
@ -121,12 +138,37 @@ set debug_sync= 'now SIGNAL end';
|
|||||||
--reap
|
--reap
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
|
--echo # Update and add a column in the middle
|
||||||
|
create or replace table t1 (a int primary key, b int);
|
||||||
|
insert t1 values (1, 22);
|
||||||
|
insert t1 values (3, 44);
|
||||||
|
|
||||||
|
--connection con2
|
||||||
|
--send
|
||||||
|
set debug_sync= 'now WAIT_FOR ended';
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
|
||||||
|
|
||||||
|
--send
|
||||||
|
alter table t1 add c int default(1) after a,
|
||||||
|
algorithm= copy, lock= none;
|
||||||
|
|
||||||
|
--connection con2
|
||||||
|
--reap
|
||||||
|
update t1 set b= 55 where a = 1;
|
||||||
|
set debug_sync= 'now SIGNAL end';
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
--reap
|
||||||
|
select * from t1;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Test primary key change
|
--echo # Test primary key change
|
||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
--echo # Drop key, add key
|
--echo # Drop key, add key
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 22);
|
insert t1 values (1, 22);
|
||||||
insert t1 values (3, 44);
|
insert t1 values (3, 44);
|
||||||
|
|
||||||
@ -151,7 +193,7 @@ set debug_sync= 'now SIGNAL end';
|
|||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo # Drop key, add key. Two updates
|
--echo # Drop key, add key. Two updates
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 11);
|
insert t1 values (1, 11);
|
||||||
insert t1 values (2, 22);
|
insert t1 values (2, 22);
|
||||||
|
|
||||||
@ -181,7 +223,7 @@ select * from t1;
|
|||||||
--echo # Various tests, see below
|
--echo # Various tests, see below
|
||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 11);
|
insert t1 values (1, 11);
|
||||||
insert t1 values (2, 22);
|
insert t1 values (2, 22);
|
||||||
insert t1 values (3, 33);
|
insert t1 values (3, 33);
|
||||||
@ -248,6 +290,7 @@ select * from t1;
|
|||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # MYISAM. Only Inserts can be tested.
|
--echo # MYISAM. Only Inserts can be tested.
|
||||||
|
--echo # (everything else is a table lock disallowing concurrent reads)
|
||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
create or replace table t1 (a int) engine=myisam;
|
create or replace table t1 (a int) engine=myisam;
|
||||||
@ -273,7 +316,7 @@ set debug_sync= 'now SIGNAL end';
|
|||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
--echo # Test incompatible changes
|
--echo # Test incompatible changes
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 22);
|
insert t1 values (1, 22);
|
||||||
insert t1 values (3, 44);
|
insert t1 values (3, 44);
|
||||||
|
|
||||||
@ -298,12 +341,11 @@ set debug_sync= 'now SIGNAL end';
|
|||||||
--reap
|
--reap
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
|
|
||||||
--echo # Test log read after EXCLUSIVE lock
|
--echo # Test log read after EXCLUSIVE lock
|
||||||
--echo # Transaction is started before ALTER, and UPDATE is made.
|
--echo # Transaction is started before ALTER, and UPDATE is made.
|
||||||
--echo # Then more UPDATEs.
|
--echo # Then more UPDATEs.
|
||||||
|
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 11);
|
insert t1 values (1, 11);
|
||||||
insert t1 values (2, 22);
|
insert t1 values (2, 22);
|
||||||
insert t1 values (3, 33);
|
insert t1 values (3, 33);
|
||||||
@ -342,7 +384,7 @@ select * from t1;
|
|||||||
--echo # Test progress report.
|
--echo # Test progress report.
|
||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
create or replace table t1 (a int primary key, b int) engine=innodb;
|
create or replace table t1 (a int primary key, b int);
|
||||||
insert t1 values (1, 11);
|
insert t1 values (1, 11);
|
||||||
insert t1 values (2, 22);
|
insert t1 values (2, 22);
|
||||||
insert t1 values (3, 33);
|
insert t1 values (3, 33);
|
||||||
@ -416,7 +458,6 @@ set debug_sync= 'now SIGNAL proceed';
|
|||||||
--reap
|
--reap
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Test system versioning
|
--echo # Test system versioning
|
||||||
--echo #
|
--echo #
|
||||||
@ -448,7 +489,6 @@ set debug_sync= 'now SIGNAL end';
|
|||||||
|
|
||||||
--connection default
|
--connection default
|
||||||
--reap
|
--reap
|
||||||
-- replace_result $default_engine *SUBSTITUTED*
|
|
||||||
show create table t1;
|
show create table t1;
|
||||||
select *, UNIX_TIMESTAMP(row_start), UNIX_TIMESTAMP(row_end) from t1 for system_time all;
|
select *, UNIX_TIMESTAMP(row_start), UNIX_TIMESTAMP(row_end) from t1 for system_time all;
|
||||||
|
|
||||||
@ -473,7 +513,6 @@ set debug_sync= 'now SIGNAL end';
|
|||||||
--echo # Can't UPDATE versioned -> plain (and can't DELETE)
|
--echo # Can't UPDATE versioned -> plain (and can't DELETE)
|
||||||
--error ER_DUP_ENTRY
|
--error ER_DUP_ENTRY
|
||||||
--reap
|
--reap
|
||||||
-- replace_result $default_engine *SUBSTITUTED*
|
|
||||||
show create table t1;
|
show create table t1;
|
||||||
select *, UNIX_TIMESTAMP(row_start), UNIX_TIMESTAMP(row_end) from t1 for system_time all;
|
select *, UNIX_TIMESTAMP(row_start), UNIX_TIMESTAMP(row_end) from t1 for system_time all;
|
||||||
|
|
||||||
@ -497,7 +536,6 @@ set debug_sync= 'now SIGNAL end';
|
|||||||
--connection default
|
--connection default
|
||||||
--echo # INSERT versioned -> plain works fine since it is a single versioned op.
|
--echo # INSERT versioned -> plain works fine since it is a single versioned op.
|
||||||
--reap
|
--reap
|
||||||
-- replace_result $default_engine *SUBSTITUTED*
|
|
||||||
show create table t1;
|
show create table t1;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
@ -505,10 +543,10 @@ select * from t1;
|
|||||||
--echo # Test ROLLBACK TO SAVEPOINT
|
--echo # Test ROLLBACK TO SAVEPOINT
|
||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
create or replace table t1 (a int) engine=innodb;
|
create or replace table t1 (a int);
|
||||||
insert t1 values (1), (2);
|
insert t1 values (1), (2);
|
||||||
|
|
||||||
create or replace table t2 (a int) engine=innodb;
|
create or replace table t2 (a int);
|
||||||
insert t2 values (1), (2);
|
insert t2 values (1), (2);
|
||||||
|
|
||||||
--connection con2
|
--connection con2
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
#
|
|
||||||
# Adds standalone and binlog combinations
|
|
||||||
#
|
|
||||||
-- if ($MTR_COMBINATION_BINLOG) {
|
|
||||||
-- require include/have_log_bin.require
|
|
||||||
-- }
|
|
||||||
|
|
||||||
-- if ($MTR_COMBINATION_STANDALONE) {
|
|
||||||
-- require include/have_log_bin_off.require
|
|
||||||
-- }
|
|
||||||
|
|
||||||
disable_query_log;
|
|
||||||
show variables like 'log_bin';
|
|
||||||
enable_query_log;
|
|
Reference in New Issue
Block a user