File: innodb_debug.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (221 lines) | stat: -rw-r--r-- 6,531 bytes parent folder | download
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
--source include/have_innodb.inc
--source include/have_debug_sync.inc

--echo #
--echo # MDEV-37199 UNIQUE KEY USING HASH accepting duplicate records
--echo #

--echo ## INSERT
create table t1 (
  id int, s date, e date,
  period for p(s,e),
  unique(id, p without overlaps)
) engine=innodb;

start transaction;
select * from t1;
--connect con1,localhost,root
insert t1 values(10, date'2010-10-10', date'2010-11-11');
delete from t1;
set innodb_snapshot_isolation=0;
set transaction isolation level read committed;
set debug_sync="innodb_row_ins_step_enter SIGNAL checked_duplicate WAIT_FOR do_insert";
--send insert t1 values(10, date'2010-09-09', date'2010-11-10')
--connect con2,localhost,root
set debug_sync="now WAIT_FOR checked_duplicate";
set innodb_snapshot_isolation=0;
set transaction isolation level read committed;
insert t1 values(10, date'2010-10-10', date'2010-11-12');
set debug_sync="now SIGNAL do_insert";
--connection con1
--error ER_DUP_ENTRY
--reap
--connection default
select * from t1;
commit;
select * from t1;
--disconnect con1
--disconnect con2
set debug_sync='RESET';
drop table t1;

--echo ## UPDATE
create table t1 (
  id int, s date, e date,
  period for p(s,e),
  unique(id, p without overlaps)
) engine=innodb;

start transaction;
select * from t1;
--connect con1,localhost,root
insert t1 values(10, date'2010-10-10', date'2010-11-11');
delete from t1;
insert t1 values(10, date'2010-09-09', date'2010-09-10');
insert t1 values(10, date'2010-12-10', date'2010-12-12');
set innodb_snapshot_isolation=0;
set transaction isolation level read committed;
set debug_sync="innodb_row_update_for_mysql_begin SIGNAL checked_duplicate WAIT_FOR do_insert";
--send update t1 set e=e + interval 2 month where s=date'2010-09-09'
--connect con2,localhost,root
set debug_sync="now WAIT_FOR checked_duplicate";
set innodb_snapshot_isolation=0;
set transaction isolation level read committed;
update t1 set s=date'2010-10-10' where e=date'2010-12-12';
set debug_sync="now SIGNAL do_insert";
--connection con1
--error ER_DUP_ENTRY
--reap
--connection default
select * from t1;
commit;
select * from t1;
--disconnect con1
--disconnect con2
set debug_sync='RESET';
drop table t1;

--echo ## INSERT IGNORE
create table t1 (
  id int, s date, e date,
  period for p(s,e),
  unique(id, p without overlaps)
) engine=innodb;

start transaction;
select * from t1;
--connect con1,localhost,root
insert t1 values(10, date'2010-10-10', date'2010-11-11');
delete from t1;
set innodb_snapshot_isolation=0;
set transaction isolation level read committed;
set debug_sync="innodb_row_ins_step_enter SIGNAL checked_duplicate WAIT_FOR do_insert";
--send insert ignore t1 values(10, date'2010-09-09', date'2010-11-10'),(11, date'2010-09-09', date'2010-11-10')
--connect con2,localhost,root
set debug_sync="now WAIT_FOR checked_duplicate";
set innodb_snapshot_isolation=0;
set transaction isolation level read committed;
insert t1 values(10, date'2010-10-10', date'2010-11-12');
set debug_sync="now SIGNAL do_insert";
--connection con1
--reap
--connection default
select * from t1;
commit;
select * from t1;
--disconnect con1
--disconnect con2
set debug_sync='RESET';
drop table t1;

--echo ## UPDATE IGNORE
create table t1 (
  id int, s date, e date,
  period for p(s,e),
  unique(id, p without overlaps)
) engine=innodb;

start transaction;
select * from t1;
--connect con1,localhost,root
insert t1 values(10, date'2010-10-10', date'2010-11-11');
delete from t1;
insert t1 values(10, date'2010-09-09', date'2010-09-10');
insert t1 values(10, date'2010-12-10', date'2010-12-12');
set innodb_snapshot_isolation=0;
set transaction isolation level read committed;
set debug_sync="innodb_row_update_for_mysql_begin SIGNAL checked_duplicate WAIT_FOR do_insert";
--send update ignore t1 set e=e + interval 2 month where s=date'2010-09-09'
--connect con2,localhost,root
set debug_sync="now WAIT_FOR checked_duplicate";
set innodb_snapshot_isolation=0;
set transaction isolation level read committed;
update t1 set s=date'2010-10-10' where e=date'2010-12-12';
set debug_sync="now SIGNAL do_insert";
--connection con1
--error ER_NOT_SUPPORTED_YET
--reap
--connection default
select * from t1;
commit;
select * from t1;
--disconnect con1
--disconnect con2
set debug_sync='RESET';
drop table t1;

--echo ## UPDATE modifying PK
create table t1 (
  id int, s date, e date,
  period for p(s,e),
  primary key (id, p without overlaps)
) engine=innodb;

start transaction;
select * from t1;
--connect con1,localhost,root
insert t1 values(10, date'2010-10-10', date'2010-11-11');
delete from t1;
insert t1 values(10, date'2010-09-09', date'2010-09-10');
insert t1 values(10, date'2010-12-10', date'2010-12-12');
set innodb_snapshot_isolation=0;
set transaction isolation level read committed;
set debug_sync="innodb_row_update_for_mysql_begin SIGNAL checked_duplicate WAIT_FOR do_insert";
--send update t1 set e=e + interval 2 month where s=date'2010-09-09'
--connect con2,localhost,root
set debug_sync="now WAIT_FOR checked_duplicate";
set innodb_snapshot_isolation=0;
set transaction isolation level read committed;
update t1 set s=date'2010-10-10' where e=date'2010-12-12';
set debug_sync="now SIGNAL do_insert";
--connection con1
--error ER_DUP_ENTRY
--reap
--connection default
select * from t1;
commit;
select * from t1;
--disconnect con1
--disconnect con2
set debug_sync='RESET';
drop table t1;

--echo ## UPDATE IGNORE modifying PK
create table t1 (
  id int, s date, e date,
  period for p(s,e),
  primary key (id, p without overlaps)
) engine=innodb;

start transaction;
select * from t1;
--connect con1,localhost,root
insert t1 values(10, date'2010-10-10', date'2010-11-11');
delete from t1;
insert t1 values(10, date'2010-09-09', date'2010-09-10');
insert t1 values(10, date'2010-12-10', date'2010-12-12');
set innodb_snapshot_isolation=0;
set transaction isolation level read committed;
set debug_sync="innodb_row_update_for_mysql_begin SIGNAL checked_duplicate WAIT_FOR do_insert";
--send update ignore t1 set e=e + interval 2 month where s=date'2010-09-09'
--connect con2,localhost,root
set debug_sync="now WAIT_FOR checked_duplicate";
set innodb_snapshot_isolation=0;
set transaction isolation level read committed;
update t1 set s=date'2010-10-10' where e=date'2010-12-12';
set debug_sync="now SIGNAL do_insert";
--connection con1
--error ER_NOT_SUPPORTED_YET
--reap
--connection default
select * from t1;
commit;
select * from t1;
--disconnect con1
--disconnect con2
set debug_sync='RESET';
drop table t1;


--echo # End of 10.6 tests