mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
4e46d8e5bf
fix test cases
28 lines
751 B
Text
28 lines
751 B
Text
# Establish connection con1 (user=root)
|
|
# Establish connection con2 (user=root)
|
|
# Establish connection con3 (user=root)
|
|
# Drop test table
|
|
drop table if exists t;
|
|
# Create test table
|
|
create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
|
|
# Insert two rows to test table
|
|
insert into t values(2,1);
|
|
insert into t values(1,2);
|
|
# Switch to connection con1
|
|
BEGIN;
|
|
SELECT b FROM t WHERE a=1 FOR UPDATE;
|
|
# Switch to connection con2
|
|
BEGIN;
|
|
SELECT b FROM t WHERE a=2 FOR UPDATE;
|
|
# Switch to connection con1
|
|
SELECT b FROM t WHERE a=2 FOR UPDATE;
|
|
# Switch to connection con2
|
|
SELECT b FROM t WHERE a=1 FOR UPDATE;
|
|
# Switch to connection con1
|
|
ROLLBACK;
|
|
# Switch to connection con2
|
|
ROLLBACK;
|
|
# Switch to connection con3
|
|
Deadlocks: 1
|
|
# Drop test table
|
|
drop table t;
|