mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-6720 - enable connection log in mysqltest by default
This commit is contained in:
@ -5,23 +5,25 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
# Create InnoDB table
|
||||
CREATE TABLE t1 (id INT) engine=innodb;
|
||||
# Connection 1
|
||||
connect con2, localhost, root;
|
||||
# Start optimizing table
|
||||
connection default;
|
||||
SET DEBUG_SYNC='ha_admin_try_alter SIGNAL optimize_started WAIT_FOR table_altered';
|
||||
OPTIMIZE TABLE t1;
|
||||
# Connection 2
|
||||
# Change table to engine=memory
|
||||
connection con2;
|
||||
SET DEBUG_SYNC='now WAIT_FOR optimize_started';
|
||||
ALTER TABLE t1 engine=memory;
|
||||
SET DEBUG_SYNC='now SIGNAL table_altered';
|
||||
# Connection 1
|
||||
# Complete optimization
|
||||
connection default;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t1 optimize error Got error -1 "Internal error < 0 (Not system error)" from storage engine MEMORY
|
||||
test.t1 optimize status Operation failed
|
||||
Warnings:
|
||||
Error 1030 Got error -1 "Internal error < 0 (Not system error)" from storage engine MEMORY
|
||||
disconnect con2;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC='RESET';
|
||||
#
|
||||
@ -29,16 +31,18 @@ SET DEBUG_SYNC='RESET';
|
||||
# OPTIMIZE TABLE
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
connect con1, localhost, root;
|
||||
connection default;
|
||||
CREATE TABLE t1(a INT) ENGINE= InnoDB;
|
||||
# Connection con1
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= "ha_admin_open_ltable SIGNAL opening WAIT_FOR dropped";
|
||||
# Sending:
|
||||
OPTIMIZE TABLE t1;
|
||||
# Connection default
|
||||
connection default;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR opening";
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC= "now SIGNAL dropped";
|
||||
# Connection con1
|
||||
connection con1;
|
||||
# Reaping: OPTIMIZE TABLE t1
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
@ -46,7 +50,8 @@ test.t1 optimize error Table 'test.t1' doesn't exist
|
||||
test.t1 optimize status Operation failed
|
||||
Warnings:
|
||||
Error 1146 Table 'test.t1' doesn't exist
|
||||
# Connection default
|
||||
connection default;
|
||||
disconnect con1;
|
||||
SET DEBUG_SYNC= "RESET";
|
||||
#
|
||||
# Bug#53757 assert in mysql_truncate_by_delete
|
||||
@ -55,10 +60,12 @@ DROP TABLE IF EXISTS t1, t2;
|
||||
CREATE TABLE t1(a INT) Engine=InnoDB;
|
||||
CREATE TABLE t2(id INT);
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
connect con1, localhost, root;
|
||||
INSERT INTO t2 VALUES(connection_id());
|
||||
SET DEBUG_SYNC= "open_and_process_table SIGNAL opening WAIT_FOR killed";
|
||||
# Sending: (not reaped since connection is killed later)
|
||||
TRUNCATE t1;
|
||||
connection default;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR opening";
|
||||
SELECT ((@id := id) - id) FROM t2;
|
||||
((@id := id) - id)
|
||||
@ -66,6 +73,7 @@ SELECT ((@id := id) - id) FROM t2;
|
||||
KILL @id;
|
||||
SET DEBUG_SYNC= "now SIGNAL killed";
|
||||
DROP TABLE t1, t2;
|
||||
disconnect con1;
|
||||
SET DEBUG_SYNC= "RESET";
|
||||
#
|
||||
# Bug#58933 Assertion `thd- >is_error()' fails on shutdown with ongoing
|
||||
@ -74,15 +82,15 @@ SET DEBUG_SYNC= "RESET";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
# Connection con1
|
||||
connect con1,localhost,root;
|
||||
SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL waiting WAIT_FOR killed';
|
||||
# Sending:
|
||||
OPTIMIZE TABLE t1;
|
||||
# Connection default
|
||||
connection default;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR waiting';
|
||||
KILL QUERY ID;
|
||||
SET DEBUG_SYNC= 'now SIGNAL killed';
|
||||
# Connection con1
|
||||
connection con1;
|
||||
# Reaping: OPTIMIZE TABLE t1
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
@ -90,24 +98,27 @@ test.t1 optimize error Query execution was interrupted
|
||||
test.t1 optimize status Operation failed
|
||||
Warnings:
|
||||
Error 1317 Query execution was interrupted
|
||||
# Connection default
|
||||
connection default;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
disconnect con1;
|
||||
#
|
||||
# Bug#42230 during add index, cannot do queries on storage engines
|
||||
# that implement add_index
|
||||
#
|
||||
DROP DATABASE IF EXISTS db1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
connect con1,localhost,root;
|
||||
connect con2,localhost,root;
|
||||
# Test 1: Secondary index, should not block reads (original test case).
|
||||
# Connection default
|
||||
connection default;
|
||||
CREATE DATABASE db1;
|
||||
CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb;
|
||||
INSERT INTO db1.t1(value) VALUES (1), (2);
|
||||
SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR query";
|
||||
# Sending:
|
||||
ALTER TABLE db1.t1 ADD INDEX(value);
|
||||
# Connection con1
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR manage";
|
||||
USE db1;
|
||||
SELECT * FROM t1;
|
||||
@ -115,7 +126,7 @@ id value
|
||||
1 1
|
||||
2 2
|
||||
SET DEBUG_SYNC= "now SIGNAL query";
|
||||
# Connection default
|
||||
connection default;
|
||||
# Reaping: ALTER TABLE db1.t1 ADD INDEX(value)
|
||||
DROP DATABASE db1;
|
||||
# Test 2: Primary index (implicit), should block writes.
|
||||
@ -123,51 +134,53 @@ CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
|
||||
SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR query";
|
||||
# Sending:
|
||||
ALTER TABLE t1 ADD UNIQUE INDEX(a), LOCK=SHARED;
|
||||
# Connection con1
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR manage";
|
||||
USE test;
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
# Sending:
|
||||
UPDATE t1 SET a=NULL;
|
||||
# Connection con2
|
||||
connection con2;
|
||||
# Waiting for SELECT to be blocked by the metadata lock on t1
|
||||
SET DEBUG_SYNC= "now SIGNAL query";
|
||||
# Connection default
|
||||
connection default;
|
||||
# Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a)
|
||||
# Connection con1
|
||||
connection con1;
|
||||
# Reaping: UPDATE t1 SET a=NULL
|
||||
# Test 3: Primary index (explicit), should block writes.
|
||||
# Connection default
|
||||
connection default;
|
||||
ALTER TABLE t1 DROP INDEX a;
|
||||
SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR query";
|
||||
# Sending:
|
||||
ALTER TABLE t1 ADD PRIMARY KEY (a), LOCK=SHARED;
|
||||
# Connection con1
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR manage";
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
# Sending:
|
||||
UPDATE t1 SET a=NULL;
|
||||
# Connection con2
|
||||
connection con2;
|
||||
# Waiting for SELECT to be blocked by the metadata lock on t1
|
||||
SET DEBUG_SYNC= "now SIGNAL query";
|
||||
# Connection default
|
||||
connection default;
|
||||
# Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a)
|
||||
# Connection con1
|
||||
connection con1;
|
||||
# Reaping: UPDATE t1 SET a=NULL
|
||||
# Test 4: Secondary unique index, should not block reads.
|
||||
# Connection default
|
||||
connection default;
|
||||
SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR query";
|
||||
# Sending:
|
||||
ALTER TABLE t1 ADD UNIQUE (b);
|
||||
# Connection con1
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR manage";
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
SET DEBUG_SYNC= "now SIGNAL query";
|
||||
# Connection default
|
||||
connection default;
|
||||
# Reaping: ALTER TABLE t1 ADD UNIQUE (b)
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
SET DEBUG_SYNC= "RESET";
|
||||
DROP TABLE t1;
|
||||
#
|
||||
@ -177,7 +190,7 @@ DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
|
||||
INSERT INTO t1 VALUES (1, 12345), (2, 23456);
|
||||
# Connection con1
|
||||
connect con1,localhost,root;
|
||||
SET SESSION debug_dbug= "+d,alter_table_rollback_new_index";
|
||||
ALTER TABLE t1 ADD PRIMARY KEY(a);
|
||||
ERROR HY000: Unknown error
|
||||
@ -185,12 +198,13 @@ SELECT * FROM t1;
|
||||
a b
|
||||
1 12345
|
||||
2 23456
|
||||
# Connection default
|
||||
connection default;
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1 12345
|
||||
2 23456
|
||||
DROP TABLE t1;
|
||||
disconnect con1;
|
||||
#
|
||||
# Bug#13417754 ASSERT IN ROW_DROP_DATABASE_FOR_MYSQL DURING DROP SCHEMA
|
||||
#
|
||||
@ -198,25 +212,29 @@ DROP TABLE IF EXISTS t1;
|
||||
DROP DATABASE IF EXISTS db1;
|
||||
CREATE TABLE t1(a int) engine=InnoDB;
|
||||
CREATE DATABASE db1;
|
||||
# Connection con1
|
||||
connect con1, localhost, root;
|
||||
connect con2, localhost, root;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= 'after_innobase_rename_table SIGNAL locked WAIT_FOR continue';
|
||||
# Sending:
|
||||
ALTER TABLE t1 RENAME db1.t1;
|
||||
# Connection con2
|
||||
connection con2;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR locked';
|
||||
# DROP DATABASE db1 should now be blocked by ALTER TABLE
|
||||
# Sending:
|
||||
DROP DATABASE db1;
|
||||
# Connection default
|
||||
connection default;
|
||||
# Check that DROP DATABASE is blocked by IX lock on db1
|
||||
# Resume ALTER TABLE
|
||||
SET DEBUG_SYNC= 'now SIGNAL continue';
|
||||
# Connection con1
|
||||
connection con1;
|
||||
# Reaping: ALTER TABLE t1 RENAME db1.t1;
|
||||
# Connection con2
|
||||
connection con2;
|
||||
# Reaping: DROP DATABASE db1
|
||||
# Connection default;
|
||||
connection default;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
#
|
||||
# WL#5534 Online ALTER, Phase 1
|
||||
#
|
||||
@ -226,18 +244,19 @@ DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a INT PRIMARY KEY, b INT) engine=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,1), (2,2);
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
connect con1, localhost, root;
|
||||
SET SESSION lock_wait_timeout= 1;
|
||||
#
|
||||
# 1: In-place + writes blocked.
|
||||
#
|
||||
# Connection default
|
||||
connection default;
|
||||
SET DEBUG_SYNC= 'alter_opened_table SIGNAL opened WAIT_FOR continue1';
|
||||
SET DEBUG_SYNC= 'alter_table_inplace_after_lock_upgrade SIGNAL upgraded WAIT_FOR continue2';
|
||||
SET DEBUG_SYNC= 'alter_table_inplace_before_commit SIGNAL beforecommit WAIT_FOR continue3';
|
||||
SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL binlog WAIT_FOR continue4';
|
||||
# Sending:
|
||||
ALTER TABLE t1 ADD INDEX i1(b), ALGORITHM= INPLACE, LOCK= SHARED;
|
||||
# Connection con1;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR opened';
|
||||
# At this point, neither reads nor writes should be blocked.
|
||||
SELECT * FROM t1;
|
||||
@ -267,7 +286,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
INSERT INTO t1 VALUES (6,6);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
SET DEBUG_SYNC= 'now SIGNAL continue4';
|
||||
# Connection default
|
||||
connection default;
|
||||
# Reaping ALTER TABLE ...
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
DELETE FROM t1 WHERE a= 3;
|
||||
@ -279,7 +298,7 @@ SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade SIGNAL upgraded WAIT_FOR co
|
||||
SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL binlog WAIT_FOR continue3';
|
||||
# Sending:
|
||||
ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= COPY, LOCK= SHARED;
|
||||
# Connection con1;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR opened';
|
||||
# At this point, neither reads nor writes should be blocked.
|
||||
SELECT * FROM t1;
|
||||
@ -305,7 +324,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
INSERT INTO t1 VALUES (5,5);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
SET DEBUG_SYNC= 'now SIGNAL continue3';
|
||||
# Connection default
|
||||
connection default;
|
||||
# Reaping ALTER TABLE ...
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
|
||||
@ -318,14 +337,14 @@ DELETE FROM t1 WHERE a= 3;
|
||||
#
|
||||
# 4: In-place + reads and writes blocked.
|
||||
#
|
||||
# Connection default
|
||||
connection default;
|
||||
SET DEBUG_SYNC= 'alter_opened_table SIGNAL opened WAIT_FOR continue1';
|
||||
SET DEBUG_SYNC= 'alter_table_inplace_after_lock_upgrade SIGNAL upgraded WAIT_FOR continue2';
|
||||
SET DEBUG_SYNC= 'alter_table_inplace_before_commit SIGNAL beforecommit WAIT_FOR continue3';
|
||||
SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL binlog WAIT_FOR continue4';
|
||||
# Sending:
|
||||
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
|
||||
# Connection con1;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR opened';
|
||||
# At this point, neither reads nor writes should be blocked.
|
||||
SELECT * FROM t1;
|
||||
@ -355,17 +374,20 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
INSERT INTO t1 VALUES (6,6);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
SET DEBUG_SYNC= 'now SIGNAL continue4';
|
||||
# Connection default
|
||||
connection default;
|
||||
# Reaping ALTER TABLE ...
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i4' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
connection default;
|
||||
disconnect con1;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
#
|
||||
#BUG#13975225:ONLINE OPTIMIZE TABLE FOR INNODB TABLES
|
||||
#
|
||||
SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue';
|
||||
connect con1,localhost,root,,;
|
||||
#Setting up INNODB table.
|
||||
CREATE TABLE t1(fld1 INT, fld2 INT, fld3 INT) ENGINE= INNODB;
|
||||
INSERT INTO t1 VALUES (155, 45, 55);
|
||||
@ -542,5 +564,6 @@ ALTER TABLE t1 FORCE;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR rebuild';
|
||||
connection default;
|
||||
disconnect con1;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user