summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb_gis/r/rtree_concurrent_srch.result
blob: 9c5db3e06aa48643a7d2ca21cc282b65971335b1 (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
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
insert into t1 values(1, Point(1,1));
insert into t1 values(2, Point(2,2));
insert into t1 values(3, Point(3,3));
insert into t1 values(4, Point(4,4));
insert into t1 values(5, Point(5,5));
insert into t1 values(6, Point(6,6));
insert into t1 values(7, Point(7,7));
insert into t1 values(8, Point(8,8));
insert into t1 values(9, Point(9,9));
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
connect  a,localhost,root,,;
SET debug_dbug='+d,rtr_pcur_move_to_next_return';
set session transaction isolation level serializable;
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
SET DEBUG_SYNC = 'RESET';
SET DEBUG_SYNC = 'row_search_for_mysql_before_return SIGNAL started WAIT_FOR go_ahead';
select count(*) from t1 where MBRWithin(t1.c2, @g1);;
connect  con1,localhost,root,,;
set session transaction isolation level serializable;
SET DEBUG_SYNC = 'now WAIT_FOR started';
insert into t1 select * from t1;
SET DEBUG_SYNC = 'now SIGNAL go_ahead';
connection a;
count(*)
576
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
1152
connection default;
insert into t1 select * from t1;
insert into t1 select * from t1;
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
4608
set @g1 = ST_GeomFromText('Polygon((10 10,10 800,800 800,800 10,10 10))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
0
set session transaction isolation level serializable;
truncate t1;
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(2 2, 150 150)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(3 3, 160 160)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(4 4, 170 170)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(5 5, 180 180)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(6 6, 190 190)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(7 7, 200 200)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(8 8, 210 210)'));
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
connection a;
set session transaction isolation level serializable;
select @@tx_isolation;
@@tx_isolation
SERIALIZABLE
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
0
connect  b,localhost,root,,;
set session transaction isolation level serializable;
set session innodb_lock_wait_timeout = 1;
select @@tx_isolation;
@@tx_isolation
SERIALIZABLE
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
connection a;
commit;
connection default;
select count(*) from t1;
count(*)
896
insert into t1 values (105, Point(105, 105));
connection a;
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
1
connection b;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
select @@tx_isolation;
@@tx_isolation
SERIALIZABLE
insert into t1 select * from t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select count(*) from t1;
count(*)
897
connection a;
select sleep(2);
sleep(2)
0
commit;
connection default;
truncate t1;
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(2 2, 150 150)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(3 3, 160 160)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(4 4, 170 170)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(5 5, 180 180)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(6 6, 190 190)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(7 7, 200 200)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(8 8, 210 210)'));
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
connection a;
set session transaction isolation level serializable;
select @@tx_isolation;
@@tx_isolation
SERIALIZABLE
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
0
connection b;
set session transaction isolation level serializable;
set session innodb_lock_wait_timeout = 1;
select @@tx_isolation;
@@tx_isolation
SERIALIZABLE
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
connection a;
commit;
connection default;
select count(*) from t1;
count(*)
1792
insert into t1 values (105, Point(105, 105));
connection a;
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
1
select count(*) from t1 where MBRIntersects(t1.c2, @g1);
count(*)
1793
connection b;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
select @@tx_isolation;
@@tx_isolation
SERIALIZABLE
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(8 105, 200 105)'));
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select count(*) from t1;
count(*)
1793
connection a;
select sleep(2);
sleep(2)
0
commit;
connection default;
truncate t1;
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(2 2, 150 150)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(3 3, 160 160)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(5 5, 180 180)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(6 6, 190 190)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(7 7, 200 200)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(8 8, 210 210)'));
set @g1 = ST_GeomFromText('Polygon((3 3, 3 5, 5 5, 5 3, 3 3))');
start transaction;
delete from t1 where MBRWithin(t1.c2, @g1);
connection a;
set session innodb_lock_wait_timeout = 1;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
insert into t1 values(4, Point(4,4));
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection default;
rollback;
connection default;
truncate t1;
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(2 2, 150 150)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(3 3, 160 160)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(5 5, 180 180)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(6 6, 190 190)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(7 7, 200 200)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(8 8, 210 210)'));
set @g1 = ST_GeomFromText('Polygon((3 3, 3 5, 5 5, 5 3, 3 3))');
start transaction;
select count(*) from t1 where MBRWithin(t1.c2, @g1) for update;
count(*)
0
connection a;
set session innodb_lock_wait_timeout = 1;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
insert into t1 values(4, Point(4,4));
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection default;
rollback;
connection default;
truncate t1;
create procedure insert_t1(IN start int, IN total int)
begin
declare i int default 1;
set i = start;
while (i <= total) DO
insert into t1 values (i, Point(i, i));
set i = i + 1;
end while;
end|
CALL insert_t1(0, 1000);
connection a;
set session transaction isolation level serializable;
select @@tx_isolation;
@@tx_isolation
SERIALIZABLE
start transaction;
set @g1 = ST_GeomFromText('Polygon((800 800, 800 1000, 1000 1000, 1000 800, 800 800))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
201
connection b;
CALL insert_t1(1001, 2000);
set session transaction isolation level serializable;
set session innodb_lock_wait_timeout = 1;
insert into t1 values (1200, Point(950, 950));
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection a;
select sleep(2);
sleep(2)
0
commit;
disconnect a;
disconnect b;
connection default;
drop table t1;
drop procedure insert_t1;
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(2 2, 150 150)'));
INSERT INTO t1  VALUES (2, ST_GeomFromText('LineString(3 3, 160 160)'));
INSERT INTO t1  VALUES (2, ST_GeomFromText('LineString(4 4, 170 170)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(5 5, 180 180)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(6 6, 190 190)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(7 7, 200 200)'));
INSERT INTO t1  VALUES (1, ST_GeomFromText('LineString(8 8, 210 210)'));
connect  a,localhost,root,,;
SET SESSION debug_dbug='+d,rtr_pcur_move_to_next_return';
set transaction isolation level serializable;
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
0
connect  b,localhost,root,,;
delete from t1 where  c1 = 1;
connection a;
commit;
set transaction isolation level serializable;
start transaction;
set @g1 = ST_GeomFromText('Polygon((0 0, 0 300, 300 300, 300 0, 0 0))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
2
connection b;
set session innodb_lock_wait_timeout = 1;
delete from t1 where  c1 = 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection a;
commit;
connection default;
drop table t1;
SET DEBUG_SYNC= 'RESET';
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
start transaction;
insert into t1 values(1, Point(1,1));
insert into t1 values(2, Point(2,2));
insert into t1 values(3, Point(3,3));
insert into t1 values(4, Point(4,4));
insert into t1 values(5, Point(5,5));
insert into t1 values(6, Point(6,6));
insert into t1 values(7, Point(7,7));
insert into t1 values(8, Point(8,8));
insert into t1 values(9, Point(9,9));
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
select count(*) from t1;
count(*)
4608
connection b;
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
set transaction isolation level read uncommitted;
SET DEBUG_SYNC= 'row_search_for_mysql_before_return SIGNAL siga WAIT_FOR sigb';
select count(*) from t1 where MBRWithin(t1.c2, @g1);
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR siga';
rollback;
SET DEBUG_SYNC= 'now SIGNAL sigb';
connection b;
count(*)
1
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
0
connection default;
DROP TABLE t1;
SET DEBUG_SYNC = 'RESET';
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
create procedure insert_t1(IN total int)
begin
declare i int default 1;
while (i <= total) DO
insert into t1 values (i, Point(i, i));
set i = i + 1;
end while;
end|
start transaction;
CALL insert_t1(100);
connection a;
set @g1 = ST_GeomFromText('Polygon((0 0,0 1000,1000 1000,1000 0,0 0))');
SET DEBUG_SYNC= 'rtr_pcur_move_to_next_return SIGNAL siga WAIT_FOR sigb';
select count(*) from t1 where MBRWithin(t1.c2, @g1);;
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR siga';
rollback;
SET DEBUG_SYNC= 'now SIGNAL sigb';
connection a;
count(*)
0
connection default;
drop procedure insert_t1;
DROP TABLE t1;
disconnect a;
disconnect b;
connection default;
SET DEBUG_SYNC = 'RESET';