用于EagleEye3.0 规则集漏报和误报测试的示例项目,项目收集于github和gitee
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

939 lines
31 KiB

set @start_read_only= @@global.read_only;
set @start_autocommit= @@global.autocommit;
set @@global.autocommit= 0;
CREATE USER test@localhost;
grant CREATE, SELECT, UPDATE on *.* to test@localhost;
CREATE USER test2@localhost;
grant CREATE, SELECT, UPDATE on *.* to test2@localhost;
connection default;
CREATE TABLE t1 (
a char(2) NOT NULL,
b char(2) NOT NULL,
c int(10) unsigned NOT NULL,
d varchar(255) DEFAULT NULL,
e varchar(1000) DEFAULT NULL,
PRIMARY KEY (a, b, c),
KEY (a),
KEY (a, b)
) charset latin1 PARTITION BY KEY (a) PARTITIONS 20;
Warnings:
Warning 1681 Integer display width is deprecated and will be removed in a future release.
INSERT INTO t1 (a, b, c, d, e) VALUES
('07', '03', 343, '1', '07_03_343'),
('01', '04', 343, '2', '01_04_343'),
('01', '06', 343, '3', '01_06_343'),
('01', '07', 343, '4', '01_07_343'),
('01', '08', 343, '5', '01_08_343'),
('01', '09', 343, '6', '01_09_343'),
('03', '03', 343, '7', '03_03_343'),
('03', '06', 343, '8', '03_06_343'),
('03', '07', 343, '9', '03_07_343'),
('04', '03', 343, '10', '04_03_343'),
('04', '06', 343, '11', '04_06_343'),
('05', '03', 343, '12', '05_03_343'),
('11', '03', 343, '13', '11_03_343'),
('11', '04', 343, '14', '11_04_343')
;
CREATE TABLE t2 (a int, name VARCHAR(50), purchased DATE)
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (3),
PARTITION p1 VALUES LESS THAN (7),
PARTITION p2 VALUES LESS THAN (9),
PARTITION p3 VALUES LESS THAN (11));
INSERT INTO t2 VALUES
(1, 'desk organiser', '2003-10-15'),
(2, 'CD player', '1993-11-05'),
(3, 'TV set', '1996-03-10'),
(4, 'bookcase', '1982-01-10'),
(5, 'exercise bike', '2004-05-09'),
(6, 'sofa', '1987-06-05'),
(7, 'popcorn maker', '2001-11-22'),
(8, 'acquarium', '1992-08-04'),
(9, 'study desk', '1984-09-16'),
(10, 'lava lamp', '1998-12-25');
CREATE TABLE t3 SELECT * FROM t1;
ALTER TABLE t3 ADD PRIMARY KEY (d);
ALTER TABLE t3 ADD KEY (a);
ALTER TABLE t3 ADD KEY (a, b);
########################################################################
connect con1,localhost,test,,test;
BEGIN;
SELECT d,a,b,c FROM t1 partition (p0);
d a b c
SELECT d,a,b,c FROM t1 partition (p1);
d a b c
7 03 03 343
8 03 06 343
9 03 07 343
SELECT d,a,b,c FROM t1 partition (p2);
d a b c
SELECT d,a,b,c FROM t1 partition (p3);
d a b c
SELECT d,a,b,c FROM t1 partition (p4);
d a b c
SELECT d,a,b,c FROM t1 partition (p5);
d a b c
SELECT d,a,b,c FROM t1 partition (p6);
d a b c
SELECT d,a,b,c FROM t1 partition (p7);
d a b c
SELECT d,a,b,c FROM t1 partition (p8);
d a b c
SELECT d,a,b,c FROM t1 partition (p9);
d a b c
2 01 04 343
3 01 06 343
4 01 07 343
5 01 08 343
6 01 09 343
10 04 03 343
11 04 06 343
12 05 03 343
SELECT d,a,b,c FROM t1 partition (p10);
d a b c
SELECT d,a,b,c FROM t1 partition (p11);
d a b c
13 11 03 343
14 11 04 343
SELECT d,a,b,c FROM t1 partition (p12);
d a b c
SELECT d,a,b,c FROM t1 partition (p13);
d a b c
SELECT d,a,b,c FROM t1 partition (p14);
d a b c
SELECT d,a,b,c FROM t1 partition (p15);
d a b c
SELECT d,a,b,c FROM t1 partition (p16);
d a b c
SELECT d,a,b,c FROM t1 partition (p17);
d a b c
1 07 03 343
SELECT d,a,b,c FROM t1 partition (p18);
d a b c
SELECT d,a,b,c FROM t1 partition (p19);
d a b c
SELECT * FROM t1 WHERE a='01' FOR UPDATE ;
a b c d e
01 04 343 2 01_04_343
01 06 343 3 01_06_343
01 07 343 4 01_07_343
01 08 343 5 01_08_343
01 09 343 6 01_09_343
SELECT * FROM t3 WHERE a='01' FOR UPDATE ;
a b c d e
01 04 343 2 01_04_343
01 06 343 3 01_06_343
01 07 343 4 01_07_343
01 08 343 5 01_08_343
01 09 343 6 01_09_343
connect con2,localhost,test,,test;
BEGIN;
SET SESSION innodb_lock_wait_timeout=1;
#
# SHARE ...
SELECT * FROM t1 FOR SHARE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT * FROM t1 FOR SHARE NOWAIT;
ERROR HY000: Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set.
SELECT * FROM t1 ORDER BY d FOR SHARE SKIP LOCKED;
a b c d e
07 03 343 1 07_03_343
04 03 343 10 04_03_343
04 06 343 11 04_06_343
05 03 343 12 05_03_343
11 03 343 13 11_03_343
11 04 343 14 11_04_343
03 03 343 7 03_03_343
03 06 343 8 03_06_343
03 07 343 9 03_07_343
SELECT a,count(b) FROM t1 GROUP BY a ORDER BY a FOR SHARE SKIP LOCKED;
a count(b)
01 5
03 3
04 2
05 1
07 1
11 2
SELECT d,a,b,c FROM t1 partition (p1,p9,p11,p17) ORDER BY d
FOR SHARE SKIP LOCKED;
d a b c
1 07 03 343
10 04 03 343
11 04 06 343
12 05 03 343
13 11 03 343
14 11 04 343
7 03 03 343
8 03 06 343
9 03 07 343
SELECT d,a,b,c FROM t1 ORDER BY d FOR SHARE SKIP LOCKED;
d a b c
1 07 03 343
10 04 03 343
11 04 06 343
12 05 03 343
13 11 03 343
14 11 04 343
7 03 03 343
8 03 06 343
9 03 07 343
SELECT d,a,b,c FROM t3 ORDER BY d FOR SHARE SKIP LOCKED;
d a b c
1 07 03 343
10 04 03 343
11 04 06 343
12 05 03 343
13 11 03 343
14 11 04 343
7 03 03 343
8 03 06 343
9 03 07 343
explain SELECT d,a,b,c FROM t3 ORDER BY d
FOR SHARE SKIP LOCKED;
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t3 NULL index NULL PRIMARY 257 NULL 14 100.00 NULL
Warnings:
Note 1003 /* select#1 */ select `test`.`t3`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c` from `test`.`t3` order by `test`.`t3`.`d`
#
# UPDATE ...
SELECT * FROM t1 FOR UPDATE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT * FROM t1 FOR UPDATE NOWAIT;
ERROR HY000: Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set.
SELECT * FROM t1 ORDER BY a FOR UPDATE SKIP LOCKED;
a b c d e
03 03 343 7 03_03_343
03 06 343 8 03_06_343
03 07 343 9 03_07_343
04 03 343 10 04_03_343
04 06 343 11 04_06_343
05 03 343 12 05_03_343
07 03 343 1 07_03_343
11 03 343 13 11_03_343
11 04 343 14 11_04_343
SELECT a,count(b) FROM t1 GROUP BY a ORDER BY a FOR UPDATE SKIP LOCKED;
a count(b)
03 3
04 2
05 1
07 1
11 2
SELECT d,a,b,c FROM t1 partition (p1,p9,p11,p17) ORDER BY d
FOR UPDATE SKIP LOCKED;
d a b c
1 07 03 343
10 04 03 343
11 04 06 343
12 05 03 343
13 11 03 343
14 11 04 343
7 03 03 343
8 03 06 343
9 03 07 343
SELECT d,a,b,c FROM t1 ORDER BY d FOR UPDATE SKIP LOCKED;
d a b c
1 07 03 343
10 04 03 343
11 04 06 343
12 05 03 343
13 11 03 343
14 11 04 343
7 03 03 343
8 03 06 343
9 03 07 343
SELECT d,a,b,c FROM t3 ORDER BY d FOR UPDATE SKIP LOCKED;
d a b c
1 07 03 343
10 04 03 343
11 04 06 343
12 05 03 343
13 11 03 343
14 11 04 343
7 03 03 343
8 03 06 343
9 03 07 343
#
# Dual locking clauses
SELECT * FROM t1, t2 FOR SHARE OF t1 FOR UPDATE OF t2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT * FROM t1, t2 FOR SHARE OF t1 FOR SHARE OF t2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT * FROM t1 FOR SHARE OF t1 NOWAIT;
ERROR HY000: Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set.
SELECT * FROM t1 FOR SHARE OF t1 SKIP LOCKED;
a b c d e
03 03 343 7 03_03_343
03 06 343 8 03_06_343
03 07 343 9 03_07_343
04 03 343 10 04_03_343
04 06 343 11 04_06_343
05 03 343 12 05_03_343
11 03 343 13 11_03_343
11 04 343 14 11_04_343
07 03 343 1 07_03_343
SELECT * FROM t1, t2 FOR SHARE OF t1 NOWAIT FOR SHARE OF t2 NOWAIT;
ERROR HY000: Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set.
COMMIT;
connection con1;
COMMIT;
connection con1;
BEGIN;
SELECT * FROM t1 WHERE a='01' FOR SHARE ;
a b c d e
01 04 343 2 01_04_343
01 06 343 3 01_06_343
01 07 343 4 01_07_343
01 08 343 5 01_08_343
01 09 343 6 01_09_343
SELECT * FROM t3 WHERE a='01' FOR SHARE ;
a b c d e
01 04 343 2 01_04_343
01 06 343 3 01_06_343
01 07 343 4 01_07_343
01 08 343 5 01_08_343
01 09 343 6 01_09_343
connection con2;
BEGIN;
SET SESSION innodb_lock_wait_timeout=1;
#
# SHARE ...
SELECT * FROM t1 FOR SHARE;
a b c d e
03 03 343 7 03_03_343
03 06 343 8 03_06_343
03 07 343 9 03_07_343
01 04 343 2 01_04_343
01 06 343 3 01_06_343
01 07 343 4 01_07_343
01 08 343 5 01_08_343
01 09 343 6 01_09_343
04 03 343 10 04_03_343
04 06 343 11 04_06_343
05 03 343 12 05_03_343
11 03 343 13 11_03_343
11 04 343 14 11_04_343
07 03 343 1 07_03_343
SELECT * FROM t1 FOR SHARE NOWAIT;
a b c d e
03 03 343 7 03_03_343
03 06 343 8 03_06_343
03 07 343 9 03_07_343
01 04 343 2 01_04_343
01 06 343 3 01_06_343
01 07 343 4 01_07_343
01 08 343 5 01_08_343
01 09 343 6 01_09_343
04 03 343 10 04_03_343
04 06 343 11 04_06_343
05 03 343 12 05_03_343
11 03 343 13 11_03_343
11 04 343 14 11_04_343
07 03 343 1 07_03_343
SELECT * FROM t1 ORDER BY d FOR SHARE SKIP LOCKED;
a b c d e
07 03 343 1 07_03_343
04 03 343 10 04_03_343
04 06 343 11 04_06_343
05 03 343 12 05_03_343
11 03 343 13 11_03_343
11 04 343 14 11_04_343
01 04 343 2 01_04_343
01 06 343 3 01_06_343
01 07 343 4 01_07_343
01 08 343 5 01_08_343
01 09 343 6 01_09_343
03 03 343 7 03_03_343
03 06 343 8 03_06_343
03 07 343 9 03_07_343
SELECT a,count(b) FROM t1 GROUP BY a ORDER BY a FOR SHARE SKIP LOCKED;
a count(b)
01 5
03 3
04 2
05 1
07 1
11 2
SELECT d,a,b,c FROM t1 partition (p1,p9,p11,p17) ORDER BY d
FOR SHARE SKIP LOCKED;
d a b c
1 07 03 343
10 04 03 343
11 04 06 343
12 05 03 343
13 11 03 343
14 11 04 343
2 01 04 343
3 01 06 343
4 01 07 343
5 01 08 343
6 01 09 343
7 03 03 343
8 03 06 343
9 03 07 343
SELECT d,a,b,c FROM t1 ORDER BY d FOR SHARE SKIP LOCKED;
d a b c
1 07 03 343
10 04 03 343
11 04 06 343
12 05 03 343
13 11 03 343
14 11 04 343
2 01 04 343
3 01 06 343
4 01 07 343
5 01 08 343
6 01 09 343
7 03 03 343
8 03 06 343
9 03 07 343
SELECT d,a,b,c FROM t3 ORDER BY d FOR SHARE SKIP LOCKED;
d a b c
1 07 03 343
10 04 03 343
11 04 06 343
12 05 03 343
13 11 03 343
14 11 04 343
2 01 04 343
3 01 06 343
4 01 07 343
5 01 08 343
6 01 09 343
7 03 03 343
8 03 06 343
9 03 07 343
explain SELECT d,a,b,c FROM t3 ORDER BY d
FOR SHARE SKIP LOCKED;
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t3 NULL index NULL PRIMARY 257 NULL 14 100.00 NULL
Warnings:
Note 1003 /* select#1 */ select `test`.`t3`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c` from `test`.`t3` order by `test`.`t3`.`d`
#
# UPDATE ...
SELECT * FROM t1 FOR UPDATE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT * FROM t1 FOR UPDATE NOWAIT;
ERROR HY000: Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set.
SELECT * FROM t1 ORDER BY a FOR UPDATE SKIP LOCKED;
a b c d e
03 03 343 7 03_03_343
03 06 343 8 03_06_343
03 07 343 9 03_07_343
04 03 343 10 04_03_343
04 06 343 11 04_06_343
05 03 343 12 05_03_343
07 03 343 1 07_03_343
11 03 343 13 11_03_343
11 04 343 14 11_04_343
SELECT a,count(b) FROM t1 GROUP BY a ORDER BY a FOR UPDATE SKIP LOCKED;
a count(b)
03 3
04 2
05 1
07 1
11 2
SELECT d,a,b,c FROM t1 partition (p1,p9,p11,p17) ORDER BY d
FOR UPDATE SKIP LOCKED;
d a b c
1 07 03 343
10 04 03 343
11 04 06 343
12 05 03 343
13 11 03 343
14 11 04 343
7 03 03 343
8 03 06 343
9 03 07 343
SELECT d,a,b,c FROM t1 ORDER BY d FOR UPDATE SKIP LOCKED;
d a b c
1 07 03 343
10 04 03 343
11 04 06 343
12 05 03 343
13 11 03 343
14 11 04 343
7 03 03 343
8 03 06 343
9 03 07 343
SELECT d,a,b,c FROM t3 ORDER BY d FOR UPDATE SKIP LOCKED;
d a b c
1 07 03 343
10 04 03 343
11 04 06 343
12 05 03 343
13 11 03 343
14 11 04 343
7 03 03 343
8 03 06 343
9 03 07 343
#
# Dual locking clauses
SELECT * FROM t1, t2 FOR SHARE OF t1 FOR UPDATE OF t2;
a b c d e a name purchased
01 04 343 2 01_04_343 1 desk organiser 2003-10-15
01 04 343 2 01_04_343 10 lava lamp 1998-12-25
01 04 343 2 01_04_343 2 CD player 1993-11-05
01 04 343 2 01_04_343 3 TV set 1996-03-10
01 04 343 2 01_04_343 4 bookcase 1982-01-10
01 04 343 2 01_04_343 5 exercise bike 2004-05-09
01 04 343 2 01_04_343 6 sofa 1987-06-05
01 04 343 2 01_04_343 7 popcorn maker 2001-11-22
01 04 343 2 01_04_343 8 acquarium 1992-08-04
01 04 343 2 01_04_343 9 study desk 1984-09-16
01 06 343 3 01_06_343 1 desk organiser 2003-10-15
01 06 343 3 01_06_343 10 lava lamp 1998-12-25
01 06 343 3 01_06_343 2 CD player 1993-11-05
01 06 343 3 01_06_343 3 TV set 1996-03-10
01 06 343 3 01_06_343 4 bookcase 1982-01-10
01 06 343 3 01_06_343 5 exercise bike 2004-05-09
01 06 343 3 01_06_343 6 sofa 1987-06-05
01 06 343 3 01_06_343 7 popcorn maker 2001-11-22
01 06 343 3 01_06_343 8 acquarium 1992-08-04
01 06 343 3 01_06_343 9 study desk 1984-09-16
01 07 343 4 01_07_343 1 desk organiser 2003-10-15
01 07 343 4 01_07_343 10 lava lamp 1998-12-25
01 07 343 4 01_07_343 2 CD player 1993-11-05
01 07 343 4 01_07_343 3 TV set 1996-03-10
01 07 343 4 01_07_343 4 bookcase 1982-01-10
01 07 343 4 01_07_343 5 exercise bike 2004-05-09
01 07 343 4 01_07_343 6 sofa 1987-06-05
01 07 343 4 01_07_343 7 popcorn maker 2001-11-22
01 07 343 4 01_07_343 8 acquarium 1992-08-04
01 07 343 4 01_07_343 9 study desk 1984-09-16
01 08 343 5 01_08_343 1 desk organiser 2003-10-15
01 08 343 5 01_08_343 10 lava lamp 1998-12-25
01 08 343 5 01_08_343 2 CD player 1993-11-05
01 08 343 5 01_08_343 3 TV set 1996-03-10
01 08 343 5 01_08_343 4 bookcase 1982-01-10
01 08 343 5 01_08_343 5 exercise bike 2004-05-09
01 08 343 5 01_08_343 6 sofa 1987-06-05
01 08 343 5 01_08_343 7 popcorn maker 2001-11-22
01 08 343 5 01_08_343 8 acquarium 1992-08-04
01 08 343 5 01_08_343 9 study desk 1984-09-16
01 09 343 6 01_09_343 1 desk organiser 2003-10-15
01 09 343 6 01_09_343 10 lava lamp 1998-12-25
01 09 343 6 01_09_343 2 CD player 1993-11-05
01 09 343 6 01_09_343 3 TV set 1996-03-10
01 09 343 6 01_09_343 4 bookcase 1982-01-10
01 09 343 6 01_09_343 5 exercise bike 2004-05-09
01 09 343 6 01_09_343 6 sofa 1987-06-05
01 09 343 6 01_09_343 7 popcorn maker 2001-11-22
01 09 343 6 01_09_343 8 acquarium 1992-08-04
01 09 343 6 01_09_343 9 study desk 1984-09-16
03 03 343 7 03_03_343 1 desk organiser 2003-10-15
03 03 343 7 03_03_343 10 lava lamp 1998-12-25
03 03 343 7 03_03_343 2 CD player 1993-11-05
03 03 343 7 03_03_343 3 TV set 1996-03-10
03 03 343 7 03_03_343 4 bookcase 1982-01-10
03 03 343 7 03_03_343 5 exercise bike 2004-05-09
03 03 343 7 03_03_343 6 sofa 1987-06-05
03 03 343 7 03_03_343 7 popcorn maker 2001-11-22
03 03 343 7 03_03_343 8 acquarium 1992-08-04
03 03 343 7 03_03_343 9 study desk 1984-09-16
03 06 343 8 03_06_343 1 desk organiser 2003-10-15
03 06 343 8 03_06_343 10 lava lamp 1998-12-25
03 06 343 8 03_06_343 2 CD player 1993-11-05
03 06 343 8 03_06_343 3 TV set 1996-03-10
03 06 343 8 03_06_343 4 bookcase 1982-01-10
03 06 343 8 03_06_343 5 exercise bike 2004-05-09
03 06 343 8 03_06_343 6 sofa 1987-06-05
03 06 343 8 03_06_343 7 popcorn maker 2001-11-22
03 06 343 8 03_06_343 8 acquarium 1992-08-04
03 06 343 8 03_06_343 9 study desk 1984-09-16
03 07 343 9 03_07_343 1 desk organiser 2003-10-15
03 07 343 9 03_07_343 10 lava lamp 1998-12-25
03 07 343 9 03_07_343 2 CD player 1993-11-05
03 07 343 9 03_07_343 3 TV set 1996-03-10
03 07 343 9 03_07_343 4 bookcase 1982-01-10
03 07 343 9 03_07_343 5 exercise bike 2004-05-09
03 07 343 9 03_07_343 6 sofa 1987-06-05
03 07 343 9 03_07_343 7 popcorn maker 2001-11-22
03 07 343 9 03_07_343 8 acquarium 1992-08-04
03 07 343 9 03_07_343 9 study desk 1984-09-16
04 03 343 10 04_03_343 1 desk organiser 2003-10-15
04 03 343 10 04_03_343 10 lava lamp 1998-12-25
04 03 343 10 04_03_343 2 CD player 1993-11-05
04 03 343 10 04_03_343 3 TV set 1996-03-10
04 03 343 10 04_03_343 4 bookcase 1982-01-10
04 03 343 10 04_03_343 5 exercise bike 2004-05-09
04 03 343 10 04_03_343 6 sofa 1987-06-05
04 03 343 10 04_03_343 7 popcorn maker 2001-11-22
04 03 343 10 04_03_343 8 acquarium 1992-08-04
04 03 343 10 04_03_343 9 study desk 1984-09-16
04 06 343 11 04_06_343 1 desk organiser 2003-10-15
04 06 343 11 04_06_343 10 lava lamp 1998-12-25
04 06 343 11 04_06_343 2 CD player 1993-11-05
04 06 343 11 04_06_343 3 TV set 1996-03-10
04 06 343 11 04_06_343 4 bookcase 1982-01-10
04 06 343 11 04_06_343 5 exercise bike 2004-05-09
04 06 343 11 04_06_343 6 sofa 1987-06-05
04 06 343 11 04_06_343 7 popcorn maker 2001-11-22
04 06 343 11 04_06_343 8 acquarium 1992-08-04
04 06 343 11 04_06_343 9 study desk 1984-09-16
05 03 343 12 05_03_343 1 desk organiser 2003-10-15
05 03 343 12 05_03_343 10 lava lamp 1998-12-25
05 03 343 12 05_03_343 2 CD player 1993-11-05
05 03 343 12 05_03_343 3 TV set 1996-03-10
05 03 343 12 05_03_343 4 bookcase 1982-01-10
05 03 343 12 05_03_343 5 exercise bike 2004-05-09
05 03 343 12 05_03_343 6 sofa 1987-06-05
05 03 343 12 05_03_343 7 popcorn maker 2001-11-22
05 03 343 12 05_03_343 8 acquarium 1992-08-04
05 03 343 12 05_03_343 9 study desk 1984-09-16
07 03 343 1 07_03_343 1 desk organiser 2003-10-15
07 03 343 1 07_03_343 10 lava lamp 1998-12-25
07 03 343 1 07_03_343 2 CD player 1993-11-05
07 03 343 1 07_03_343 3 TV set 1996-03-10
07 03 343 1 07_03_343 4 bookcase 1982-01-10
07 03 343 1 07_03_343 5 exercise bike 2004-05-09
07 03 343 1 07_03_343 6 sofa 1987-06-05
07 03 343 1 07_03_343 7 popcorn maker 2001-11-22
07 03 343 1 07_03_343 8 acquarium 1992-08-04
07 03 343 1 07_03_343 9 study desk 1984-09-16
11 03 343 13 11_03_343 1 desk organiser 2003-10-15
11 03 343 13 11_03_343 10 lava lamp 1998-12-25
11 03 343 13 11_03_343 2 CD player 1993-11-05
11 03 343 13 11_03_343 3 TV set 1996-03-10
11 03 343 13 11_03_343 4 bookcase 1982-01-10
11 03 343 13 11_03_343 5 exercise bike 2004-05-09
11 03 343 13 11_03_343 6 sofa 1987-06-05
11 03 343 13 11_03_343 7 popcorn maker 2001-11-22
11 03 343 13 11_03_343 8 acquarium 1992-08-04
11 03 343 13 11_03_343 9 study desk 1984-09-16
11 04 343 14 11_04_343 1 desk organiser 2003-10-15
11 04 343 14 11_04_343 10 lava lamp 1998-12-25
11 04 343 14 11_04_343 2 CD player 1993-11-05
11 04 343 14 11_04_343 3 TV set 1996-03-10
11 04 343 14 11_04_343 4 bookcase 1982-01-10
11 04 343 14 11_04_343 5 exercise bike 2004-05-09
11 04 343 14 11_04_343 6 sofa 1987-06-05
11 04 343 14 11_04_343 7 popcorn maker 2001-11-22
11 04 343 14 11_04_343 8 acquarium 1992-08-04
11 04 343 14 11_04_343 9 study desk 1984-09-16
SELECT * FROM t1, t2 FOR SHARE OF t1 FOR SHARE OF t2;
a b c d e a name purchased
01 04 343 2 01_04_343 1 desk organiser 2003-10-15
01 04 343 2 01_04_343 10 lava lamp 1998-12-25
01 04 343 2 01_04_343 2 CD player 1993-11-05
01 04 343 2 01_04_343 3 TV set 1996-03-10
01 04 343 2 01_04_343 4 bookcase 1982-01-10
01 04 343 2 01_04_343 5 exercise bike 2004-05-09
01 04 343 2 01_04_343 6 sofa 1987-06-05
01 04 343 2 01_04_343 7 popcorn maker 2001-11-22
01 04 343 2 01_04_343 8 acquarium 1992-08-04
01 04 343 2 01_04_343 9 study desk 1984-09-16
01 06 343 3 01_06_343 1 desk organiser 2003-10-15
01 06 343 3 01_06_343 10 lava lamp 1998-12-25
01 06 343 3 01_06_343 2 CD player 1993-11-05
01 06 343 3 01_06_343 3 TV set 1996-03-10
01 06 343 3 01_06_343 4 bookcase 1982-01-10
01 06 343 3 01_06_343 5 exercise bike 2004-05-09
01 06 343 3 01_06_343 6 sofa 1987-06-05
01 06 343 3 01_06_343 7 popcorn maker 2001-11-22
01 06 343 3 01_06_343 8 acquarium 1992-08-04
01 06 343 3 01_06_343 9 study desk 1984-09-16
01 07 343 4 01_07_343 1 desk organiser 2003-10-15
01 07 343 4 01_07_343 10 lava lamp 1998-12-25
01 07 343 4 01_07_343 2 CD player 1993-11-05
01 07 343 4 01_07_343 3 TV set 1996-03-10
01 07 343 4 01_07_343 4 bookcase 1982-01-10
01 07 343 4 01_07_343 5 exercise bike 2004-05-09
01 07 343 4 01_07_343 6 sofa 1987-06-05
01 07 343 4 01_07_343 7 popcorn maker 2001-11-22
01 07 343 4 01_07_343 8 acquarium 1992-08-04
01 07 343 4 01_07_343 9 study desk 1984-09-16
01 08 343 5 01_08_343 1 desk organiser 2003-10-15
01 08 343 5 01_08_343 10 lava lamp 1998-12-25
01 08 343 5 01_08_343 2 CD player 1993-11-05
01 08 343 5 01_08_343 3 TV set 1996-03-10
01 08 343 5 01_08_343 4 bookcase 1982-01-10
01 08 343 5 01_08_343 5 exercise bike 2004-05-09
01 08 343 5 01_08_343 6 sofa 1987-06-05
01 08 343 5 01_08_343 7 popcorn maker 2001-11-22
01 08 343 5 01_08_343 8 acquarium 1992-08-04
01 08 343 5 01_08_343 9 study desk 1984-09-16
01 09 343 6 01_09_343 1 desk organiser 2003-10-15
01 09 343 6 01_09_343 10 lava lamp 1998-12-25
01 09 343 6 01_09_343 2 CD player 1993-11-05
01 09 343 6 01_09_343 3 TV set 1996-03-10
01 09 343 6 01_09_343 4 bookcase 1982-01-10
01 09 343 6 01_09_343 5 exercise bike 2004-05-09
01 09 343 6 01_09_343 6 sofa 1987-06-05
01 09 343 6 01_09_343 7 popcorn maker 2001-11-22
01 09 343 6 01_09_343 8 acquarium 1992-08-04
01 09 343 6 01_09_343 9 study desk 1984-09-16
03 03 343 7 03_03_343 1 desk organiser 2003-10-15
03 03 343 7 03_03_343 10 lava lamp 1998-12-25
03 03 343 7 03_03_343 2 CD player 1993-11-05
03 03 343 7 03_03_343 3 TV set 1996-03-10
03 03 343 7 03_03_343 4 bookcase 1982-01-10
03 03 343 7 03_03_343 5 exercise bike 2004-05-09
03 03 343 7 03_03_343 6 sofa 1987-06-05
03 03 343 7 03_03_343 7 popcorn maker 2001-11-22
03 03 343 7 03_03_343 8 acquarium 1992-08-04
03 03 343 7 03_03_343 9 study desk 1984-09-16
03 06 343 8 03_06_343 1 desk organiser 2003-10-15
03 06 343 8 03_06_343 10 lava lamp 1998-12-25
03 06 343 8 03_06_343 2 CD player 1993-11-05
03 06 343 8 03_06_343 3 TV set 1996-03-10
03 06 343 8 03_06_343 4 bookcase 1982-01-10
03 06 343 8 03_06_343 5 exercise bike 2004-05-09
03 06 343 8 03_06_343 6 sofa 1987-06-05
03 06 343 8 03_06_343 7 popcorn maker 2001-11-22
03 06 343 8 03_06_343 8 acquarium 1992-08-04
03 06 343 8 03_06_343 9 study desk 1984-09-16
03 07 343 9 03_07_343 1 desk organiser 2003-10-15
03 07 343 9 03_07_343 10 lava lamp 1998-12-25
03 07 343 9 03_07_343 2 CD player 1993-11-05
03 07 343 9 03_07_343 3 TV set 1996-03-10
03 07 343 9 03_07_343 4 bookcase 1982-01-10
03 07 343 9 03_07_343 5 exercise bike 2004-05-09
03 07 343 9 03_07_343 6 sofa 1987-06-05
03 07 343 9 03_07_343 7 popcorn maker 2001-11-22
03 07 343 9 03_07_343 8 acquarium 1992-08-04
03 07 343 9 03_07_343 9 study desk 1984-09-16
04 03 343 10 04_03_343 1 desk organiser 2003-10-15
04 03 343 10 04_03_343 10 lava lamp 1998-12-25
04 03 343 10 04_03_343 2 CD player 1993-11-05
04 03 343 10 04_03_343 3 TV set 1996-03-10
04 03 343 10 04_03_343 4 bookcase 1982-01-10
04 03 343 10 04_03_343 5 exercise bike 2004-05-09
04 03 343 10 04_03_343 6 sofa 1987-06-05
04 03 343 10 04_03_343 7 popcorn maker 2001-11-22
04 03 343 10 04_03_343 8 acquarium 1992-08-04
04 03 343 10 04_03_343 9 study desk 1984-09-16
04 06 343 11 04_06_343 1 desk organiser 2003-10-15
04 06 343 11 04_06_343 10 lava lamp 1998-12-25
04 06 343 11 04_06_343 2 CD player 1993-11-05
04 06 343 11 04_06_343 3 TV set 1996-03-10
04 06 343 11 04_06_343 4 bookcase 1982-01-10
04 06 343 11 04_06_343 5 exercise bike 2004-05-09
04 06 343 11 04_06_343 6 sofa 1987-06-05
04 06 343 11 04_06_343 7 popcorn maker 2001-11-22
04 06 343 11 04_06_343 8 acquarium 1992-08-04
04 06 343 11 04_06_343 9 study desk 1984-09-16
05 03 343 12 05_03_343 1 desk organiser 2003-10-15
05 03 343 12 05_03_343 10 lava lamp 1998-12-25
05 03 343 12 05_03_343 2 CD player 1993-11-05
05 03 343 12 05_03_343 3 TV set 1996-03-10
05 03 343 12 05_03_343 4 bookcase 1982-01-10
05 03 343 12 05_03_343 5 exercise bike 2004-05-09
05 03 343 12 05_03_343 6 sofa 1987-06-05
05 03 343 12 05_03_343 7 popcorn maker 2001-11-22
05 03 343 12 05_03_343 8 acquarium 1992-08-04
05 03 343 12 05_03_343 9 study desk 1984-09-16
07 03 343 1 07_03_343 1 desk organiser 2003-10-15
07 03 343 1 07_03_343 10 lava lamp 1998-12-25
07 03 343 1 07_03_343 2 CD player 1993-11-05
07 03 343 1 07_03_343 3 TV set 1996-03-10
07 03 343 1 07_03_343 4 bookcase 1982-01-10
07 03 343 1 07_03_343 5 exercise bike 2004-05-09
07 03 343 1 07_03_343 6 sofa 1987-06-05
07 03 343 1 07_03_343 7 popcorn maker 2001-11-22
07 03 343 1 07_03_343 8 acquarium 1992-08-04
07 03 343 1 07_03_343 9 study desk 1984-09-16
11 03 343 13 11_03_343 1 desk organiser 2003-10-15
11 03 343 13 11_03_343 10 lava lamp 1998-12-25
11 03 343 13 11_03_343 2 CD player 1993-11-05
11 03 343 13 11_03_343 3 TV set 1996-03-10
11 03 343 13 11_03_343 4 bookcase 1982-01-10
11 03 343 13 11_03_343 5 exercise bike 2004-05-09
11 03 343 13 11_03_343 6 sofa 1987-06-05
11 03 343 13 11_03_343 7 popcorn maker 2001-11-22
11 03 343 13 11_03_343 8 acquarium 1992-08-04
11 03 343 13 11_03_343 9 study desk 1984-09-16
11 04 343 14 11_04_343 1 desk organiser 2003-10-15
11 04 343 14 11_04_343 10 lava lamp 1998-12-25
11 04 343 14 11_04_343 2 CD player 1993-11-05
11 04 343 14 11_04_343 3 TV set 1996-03-10
11 04 343 14 11_04_343 4 bookcase 1982-01-10
11 04 343 14 11_04_343 5 exercise bike 2004-05-09
11 04 343 14 11_04_343 6 sofa 1987-06-05
11 04 343 14 11_04_343 7 popcorn maker 2001-11-22
11 04 343 14 11_04_343 8 acquarium 1992-08-04
11 04 343 14 11_04_343 9 study desk 1984-09-16
SELECT * FROM t1 FOR SHARE OF t1 NOWAIT;
a b c d e
03 03 343 7 03_03_343
03 06 343 8 03_06_343
03 07 343 9 03_07_343
01 04 343 2 01_04_343
01 06 343 3 01_06_343
01 07 343 4 01_07_343
01 08 343 5 01_08_343
01 09 343 6 01_09_343
04 03 343 10 04_03_343
04 06 343 11 04_06_343
05 03 343 12 05_03_343
11 03 343 13 11_03_343
11 04 343 14 11_04_343
07 03 343 1 07_03_343
SELECT * FROM t1 FOR SHARE OF t1 SKIP LOCKED;
a b c d e
03 03 343 7 03_03_343
03 06 343 8 03_06_343
03 07 343 9 03_07_343
01 04 343 2 01_04_343
01 06 343 3 01_06_343
01 07 343 4 01_07_343
01 08 343 5 01_08_343
01 09 343 6 01_09_343
04 03 343 10 04_03_343
04 06 343 11 04_06_343
05 03 343 12 05_03_343
11 03 343 13 11_03_343
11 04 343 14 11_04_343
07 03 343 1 07_03_343
SELECT * FROM t1, t2 FOR SHARE OF t1 NOWAIT FOR SHARE OF t2 NOWAIT;
a b c d e a name purchased
01 04 343 2 01_04_343 1 desk organiser 2003-10-15
01 04 343 2 01_04_343 10 lava lamp 1998-12-25
01 04 343 2 01_04_343 2 CD player 1993-11-05
01 04 343 2 01_04_343 3 TV set 1996-03-10
01 04 343 2 01_04_343 4 bookcase 1982-01-10
01 04 343 2 01_04_343 5 exercise bike 2004-05-09
01 04 343 2 01_04_343 6 sofa 1987-06-05
01 04 343 2 01_04_343 7 popcorn maker 2001-11-22
01 04 343 2 01_04_343 8 acquarium 1992-08-04
01 04 343 2 01_04_343 9 study desk 1984-09-16
01 06 343 3 01_06_343 1 desk organiser 2003-10-15
01 06 343 3 01_06_343 10 lava lamp 1998-12-25
01 06 343 3 01_06_343 2 CD player 1993-11-05
01 06 343 3 01_06_343 3 TV set 1996-03-10
01 06 343 3 01_06_343 4 bookcase 1982-01-10
01 06 343 3 01_06_343 5 exercise bike 2004-05-09
01 06 343 3 01_06_343 6 sofa 1987-06-05
01 06 343 3 01_06_343 7 popcorn maker 2001-11-22
01 06 343 3 01_06_343 8 acquarium 1992-08-04
01 06 343 3 01_06_343 9 study desk 1984-09-16
01 07 343 4 01_07_343 1 desk organiser 2003-10-15
01 07 343 4 01_07_343 10 lava lamp 1998-12-25
01 07 343 4 01_07_343 2 CD player 1993-11-05
01 07 343 4 01_07_343 3 TV set 1996-03-10
01 07 343 4 01_07_343 4 bookcase 1982-01-10
01 07 343 4 01_07_343 5 exercise bike 2004-05-09
01 07 343 4 01_07_343 6 sofa 1987-06-05
01 07 343 4 01_07_343 7 popcorn maker 2001-11-22
01 07 343 4 01_07_343 8 acquarium 1992-08-04
01 07 343 4 01_07_343 9 study desk 1984-09-16
01 08 343 5 01_08_343 1 desk organiser 2003-10-15
01 08 343 5 01_08_343 10 lava lamp 1998-12-25
01 08 343 5 01_08_343 2 CD player 1993-11-05
01 08 343 5 01_08_343 3 TV set 1996-03-10
01 08 343 5 01_08_343 4 bookcase 1982-01-10
01 08 343 5 01_08_343 5 exercise bike 2004-05-09
01 08 343 5 01_08_343 6 sofa 1987-06-05
01 08 343 5 01_08_343 7 popcorn maker 2001-11-22
01 08 343 5 01_08_343 8 acquarium 1992-08-04
01 08 343 5 01_08_343 9 study desk 1984-09-16
01 09 343 6 01_09_343 1 desk organiser 2003-10-15
01 09 343 6 01_09_343 10 lava lamp 1998-12-25
01 09 343 6 01_09_343 2 CD player 1993-11-05
01 09 343 6 01_09_343 3 TV set 1996-03-10
01 09 343 6 01_09_343 4 bookcase 1982-01-10
01 09 343 6 01_09_343 5 exercise bike 2004-05-09
01 09 343 6 01_09_343 6 sofa 1987-06-05
01 09 343 6 01_09_343 7 popcorn maker 2001-11-22
01 09 343 6 01_09_343 8 acquarium 1992-08-04
01 09 343 6 01_09_343 9 study desk 1984-09-16
03 03 343 7 03_03_343 1 desk organiser 2003-10-15
03 03 343 7 03_03_343 10 lava lamp 1998-12-25
03 03 343 7 03_03_343 2 CD player 1993-11-05
03 03 343 7 03_03_343 3 TV set 1996-03-10
03 03 343 7 03_03_343 4 bookcase 1982-01-10
03 03 343 7 03_03_343 5 exercise bike 2004-05-09
03 03 343 7 03_03_343 6 sofa 1987-06-05
03 03 343 7 03_03_343 7 popcorn maker 2001-11-22
03 03 343 7 03_03_343 8 acquarium 1992-08-04
03 03 343 7 03_03_343 9 study desk 1984-09-16
03 06 343 8 03_06_343 1 desk organiser 2003-10-15
03 06 343 8 03_06_343 10 lava lamp 1998-12-25
03 06 343 8 03_06_343 2 CD player 1993-11-05
03 06 343 8 03_06_343 3 TV set 1996-03-10
03 06 343 8 03_06_343 4 bookcase 1982-01-10
03 06 343 8 03_06_343 5 exercise bike 2004-05-09
03 06 343 8 03_06_343 6 sofa 1987-06-05
03 06 343 8 03_06_343 7 popcorn maker 2001-11-22
03 06 343 8 03_06_343 8 acquarium 1992-08-04
03 06 343 8 03_06_343 9 study desk 1984-09-16
03 07 343 9 03_07_343 1 desk organiser 2003-10-15
03 07 343 9 03_07_343 10 lava lamp 1998-12-25
03 07 343 9 03_07_343 2 CD player 1993-11-05
03 07 343 9 03_07_343 3 TV set 1996-03-10
03 07 343 9 03_07_343 4 bookcase 1982-01-10
03 07 343 9 03_07_343 5 exercise bike 2004-05-09
03 07 343 9 03_07_343 6 sofa 1987-06-05
03 07 343 9 03_07_343 7 popcorn maker 2001-11-22
03 07 343 9 03_07_343 8 acquarium 1992-08-04
03 07 343 9 03_07_343 9 study desk 1984-09-16
04 03 343 10 04_03_343 1 desk organiser 2003-10-15
04 03 343 10 04_03_343 10 lava lamp 1998-12-25
04 03 343 10 04_03_343 2 CD player 1993-11-05
04 03 343 10 04_03_343 3 TV set 1996-03-10
04 03 343 10 04_03_343 4 bookcase 1982-01-10
04 03 343 10 04_03_343 5 exercise bike 2004-05-09
04 03 343 10 04_03_343 6 sofa 1987-06-05
04 03 343 10 04_03_343 7 popcorn maker 2001-11-22
04 03 343 10 04_03_343 8 acquarium 1992-08-04
04 03 343 10 04_03_343 9 study desk 1984-09-16
04 06 343 11 04_06_343 1 desk organiser 2003-10-15
04 06 343 11 04_06_343 10 lava lamp 1998-12-25
04 06 343 11 04_06_343 2 CD player 1993-11-05
04 06 343 11 04_06_343 3 TV set 1996-03-10
04 06 343 11 04_06_343 4 bookcase 1982-01-10
04 06 343 11 04_06_343 5 exercise bike 2004-05-09
04 06 343 11 04_06_343 6 sofa 1987-06-05
04 06 343 11 04_06_343 7 popcorn maker 2001-11-22
04 06 343 11 04_06_343 8 acquarium 1992-08-04
04 06 343 11 04_06_343 9 study desk 1984-09-16
05 03 343 12 05_03_343 1 desk organiser 2003-10-15
05 03 343 12 05_03_343 10 lava lamp 1998-12-25
05 03 343 12 05_03_343 2 CD player 1993-11-05
05 03 343 12 05_03_343 3 TV set 1996-03-10
05 03 343 12 05_03_343 4 bookcase 1982-01-10
05 03 343 12 05_03_343 5 exercise bike 2004-05-09
05 03 343 12 05_03_343 6 sofa 1987-06-05
05 03 343 12 05_03_343 7 popcorn maker 2001-11-22
05 03 343 12 05_03_343 8 acquarium 1992-08-04
05 03 343 12 05_03_343 9 study desk 1984-09-16
07 03 343 1 07_03_343 1 desk organiser 2003-10-15
07 03 343 1 07_03_343 10 lava lamp 1998-12-25
07 03 343 1 07_03_343 2 CD player 1993-11-05
07 03 343 1 07_03_343 3 TV set 1996-03-10
07 03 343 1 07_03_343 4 bookcase 1982-01-10
07 03 343 1 07_03_343 5 exercise bike 2004-05-09
07 03 343 1 07_03_343 6 sofa 1987-06-05
07 03 343 1 07_03_343 7 popcorn maker 2001-11-22
07 03 343 1 07_03_343 8 acquarium 1992-08-04
07 03 343 1 07_03_343 9 study desk 1984-09-16
11 03 343 13 11_03_343 1 desk organiser 2003-10-15
11 03 343 13 11_03_343 10 lava lamp 1998-12-25
11 03 343 13 11_03_343 2 CD player 1993-11-05
11 03 343 13 11_03_343 3 TV set 1996-03-10
11 03 343 13 11_03_343 4 bookcase 1982-01-10
11 03 343 13 11_03_343 5 exercise bike 2004-05-09
11 03 343 13 11_03_343 6 sofa 1987-06-05
11 03 343 13 11_03_343 7 popcorn maker 2001-11-22
11 03 343 13 11_03_343 8 acquarium 1992-08-04
11 03 343 13 11_03_343 9 study desk 1984-09-16
11 04 343 14 11_04_343 1 desk organiser 2003-10-15
11 04 343 14 11_04_343 10 lava lamp 1998-12-25
11 04 343 14 11_04_343 2 CD player 1993-11-05
11 04 343 14 11_04_343 3 TV set 1996-03-10
11 04 343 14 11_04_343 4 bookcase 1982-01-10
11 04 343 14 11_04_343 5 exercise bike 2004-05-09
11 04 343 14 11_04_343 6 sofa 1987-06-05
11 04 343 14 11_04_343 7 popcorn maker 2001-11-22
11 04 343 14 11_04_343 8 acquarium 1992-08-04
11 04 343 14 11_04_343 9 study desk 1984-09-16
COMMIT;
connection con1;
COMMIT;
connection default;
disconnect con1;
disconnect con2;
DROP TABLE t1, t2, t3;
DROP USER test@localhost;
DROP USER test2@localhost;
set @@global.read_only= @start_read_only;
set @@global.autocommit= @start_autocommit;