summaryrefslogtreecommitdiff
path: root/storage/rocksdb/mysql-test/rocksdb/r/unique_check.result
blob: db9b119043ac72bbb4ddd8fd9c7ac784fec06107 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
connect  con1, localhost, root,,;
connect  con2, localhost, root,,;
connect  con3, localhost, root,,;
connection default;
set debug_sync='RESET';
drop table if exists t1;
create table t1 (id int, value int, primary key (id)) engine=rocksdb;
create table t2 (id int, id2 int, value int, primary key (id), unique key (id2)) engine=rocksdb;
connection con1;
begin;
insert into t1 values (1,1);
connection con2;
set session rocksdb_lock_wait_timeout=50;
begin;
insert into t1 values (1,2);
connection con1;
commit;
connection con2;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
commit;
select * from t1;
id	value
1	1
truncate table t1;
connection con1;
begin;
insert into t2 values (1,1,1);
connection con2;
begin;
insert into t2 values (2,1,2);
connection con1;
commit;
connection con2;
ERROR 23000: Duplicate entry '1' for key 'id2'
commit;
select * from t2;
id	id2	value
1	1	1
truncate table t2;
connection con1;
begin;
insert into t1 values (1,1);
connection con2;
begin;
insert into t1 values (1,2);
connection con1;
rollback;
connection con2;
commit;
select * from t1;
id	value
1	2
truncate table t1;
connection con1;
begin;
insert into t2 values (1,1,1);
connection con2;
begin;
insert into t2 values (2,1,2);
connection con1;
rollback;
connection con2;
commit;
select * from t2;
id	id2	value
2	1	2
truncate table t2;
connection con1;
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked1 WAIT_FOR go';
insert into t1 values (1,1);
connection default;
set debug_sync='now WAIT_FOR parked1';
connection con2;
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked2 WAIT_FOR go';
insert into t2 values (1,1,1);
connection default;
set debug_sync='now WAIT_FOR parked2';
connection con3;
set session rocksdb_lock_wait_timeout=1;
insert into t1 values (1,2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into t2 values (2,1,2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection default;
set debug_sync='now SIGNAL go';
connection con1;
connection con2;
connection default;
insert into t1 values (1,2);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
insert into t2 values (2,1,2);
ERROR 23000: Duplicate entry '1' for key 'id2'
select * from t1;
id	value
1	1
select * from t2;
id	id2	value
1	1	1
connection default;
set debug_sync='RESET';
disconnect con1;
disconnect con2;
disconnect con3;
drop table t1, t2;
connection default;
drop table if exists t1,t2,t3;
create table t1 (id int, value int, primary key (id)) engine=rocksdb;
create table t2 (id int, id2 int, value int, primary key (id), unique key (id2)) engine=rocksdb;
create table t3 (id int, value int) engine=rocksdb;
SET @old_val = @@session.unique_checks;
set @@session.unique_checks = FALSE;
insert into t1 values (1, 1), (1, 2);
insert into t2 values (1, 1, 1), (1, 2, 1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
insert into t3 values (1, 1), (1, 1);
set @@session.unique_checks = @old_val;
drop table t1, t2, t3;