2
# Locking related tests which use DEBUG_SYNC facility.
4
--source include/have_debug_sync.inc
5
# This test requires statement/mixed mode binary logging.
6
# Row-based mode puts weaker serializability requirements
7
# so weaker locks are acquired for it.
8
--source include/have_binlog_format_mixed_or_statement.inc
10
# Save the initial number of concurrent sessions.
11
--source include/count_sessions.inc
15
--echo # Test how we handle locking in various cases when
16
--echo # we read data from MyISAM tables.
18
--echo # In this test we mostly check that the SQL-layer correctly
19
--echo # determines the type of thr_lock.c lock for a table being
21
--echo # I.e. that it disallows concurrent inserts when the statement
22
--echo # is going to be written to the binary log and therefore
23
--echo # should be serialized, and allows concurrent inserts when
24
--echo # such serialization is not necessary (e.g. when
25
--echo # the statement is not written to binary log).
28
--echo # Force concurrent inserts to be performed even if the table
29
--echo # has gaps. This allows to simplify clean up in scripts
30
--echo # used below (instead of backing up table being inserted
31
--echo # into and then restoring it from backup at the end of the
32
--echo # script we can simply delete rows which were inserted).
33
set @old_concurrent_insert= @@global.concurrent_insert;
34
set @@global.concurrent_insert= 2;
35
select @@global.concurrent_insert;
37
--echo # Prepare playground by creating tables, views,
38
--echo # routines and triggers used in tests.
39
connect (con1, localhost, root,,);
40
connect (con2, localhost, root,,);
43
drop table if exists t0, t1, t2, t3, t4, t5, te;
44
drop view if exists v1, v2;
45
drop procedure if exists p1;
46
drop procedure if exists p2;
47
drop function if exists f1;
48
drop function if exists f2;
49
drop function if exists f3;
50
drop function if exists f4;
51
drop function if exists f5;
52
drop function if exists f6;
53
drop function if exists f7;
54
drop function if exists f8;
55
drop function if exists f9;
56
drop function if exists f10;
57
drop function if exists f11;
58
drop function if exists f12;
59
drop function if exists f13;
60
drop function if exists f14;
61
drop function if exists f15;
63
create table t1 (i int primary key);
64
insert into t1 values (1), (2), (3), (4), (5);
65
create table t2 (j int primary key);
66
insert into t2 values (1), (2), (3), (4), (5);
67
create table t3 (k int primary key);
68
insert into t3 values (1), (2), (3);
69
create table t4 (l int primary key);
70
insert into t4 values (1);
71
create table t5 (l int primary key);
72
insert into t5 values (1);
73
create table te(e int primary key);
74
insert into te values (1);
75
create view v1 as select i from t1;
76
create view v2 as select j from t2 where j in (select i from t1);
77
create procedure p1(k int) insert into t2 values (k);
79
create function f1() returns int
82
select i from t1 where i = 1 into j;
85
create function f2() returns int
88
select i from t1 where i = 1 into k;
89
insert into t2 values (k + 5);
92
create function f3() returns int
94
return (select i from t1 where i = 3);
96
create function f4() returns int
98
if (select i from t1 where i = 3) then
104
create function f5() returns int
106
insert into t2 values ((select i from t1 where i = 1) + 5);
109
create function f6() returns int
112
select i from v1 where i = 1 into k;
115
create function f7() returns int
118
select j from v2 where j = 1 into k;
121
create function f8() returns int
124
select i from v1 where i = 1 into k;
125
insert into t2 values (k+5);
128
create function f9() returns int
130
update v2 set j=j+10 where j=1;
133
create function f10() returns int
137
create function f11() returns int
141
insert into t2 values (k+5);
144
create function f12(p int) returns int
146
insert into t2 values (p);
149
create function f13(p int) returns int
153
create procedure p2(inout p int)
155
select i from t1 where i = 1 into p;
157
create function f14() returns int
161
insert into t2 values (k+5);
164
create function f15() returns int
170
create trigger t4_bi before insert on t4 for each row
173
select i from t1 where i=1 into k;
176
create trigger t4_bu before update on t4 for each row
178
if (select i from t1 where i=1) then
182
--echo # Trigger below uses insertion of duplicate key in 'te'
183
--echo # table as a way to abort delete operation.
184
create trigger t4_bd before delete on t4 for each row
186
if !(select i from v1 where i=1) then
187
insert into te values (1);
190
create trigger t5_bi before insert on t5 for each row
194
create trigger t5_bu before update on t5 for each row
203
--echo # Set common variables to be used by the scripts
204
--echo # called below.
210
--echo # Switch to connection 'con1'.
212
--echo # Cache all functions used in the tests below so statements
213
--echo # calling them won't need to open and lock mysql.proc table
214
--echo # and we can assume that each statement locks its tables
215
--echo # once during its execution.
217
show create procedure p1;
218
show create procedure p2;
219
show create function f1;
220
show create function f2;
221
show create function f3;
222
show create function f4;
223
show create function f5;
224
show create function f6;
225
show create function f7;
226
show create function f8;
227
show create function f9;
228
show create function f10;
229
show create function f11;
230
show create function f12;
231
show create function f13;
232
show create function f14;
233
show create function f15;
235
--echo # Switch back to connection 'default'.
239
--echo # 1. Statements that read tables and do not use subqueries.
243
--echo # 1.1 Simple SELECT statement.
245
--echo # No locks are necessary as this statement won't be written
246
--echo # to the binary log and thanks to how MyISAM works SELECT
247
--echo # will see version of the table prior to concurrent insert.
248
let $statement= select * from t1;
249
let $restore_table= ;
250
--source include/check_concurrent_insert.inc
253
--echo # 1.2 Multi-UPDATE statement.
255
--echo # Has to take shared locks on rows in the table being read as this
256
--echo # statement will be written to the binary log and therefore should
257
--echo # be serialized with concurrent statements.
258
let $statement= update t2, t1 set j= j - 1 where i = j;
259
let $restore_table= t2;
260
--source include/check_no_concurrent_insert.inc
263
--echo # 1.3 Multi-DELETE statement.
265
--echo # The above is true for this statement as well.
266
let $statement= delete t2 from t1, t2 where i = j;
267
let $restore_table= t2;
268
--source include/check_no_concurrent_insert.inc
271
--echo # 1.4 DESCRIBE statement.
273
--echo # This statement does not really read data from the
274
--echo # target table and thus does not take any lock on it.
275
--echo # We check this for completeness of coverage.
277
--echo # Switching to connection 'con1'.
279
--echo # This statement should not be blocked.
283
--echo # Switching to connection 'default'.
288
--echo # 1.5 SHOW statements.
290
--echo # The above is true for SHOW statements as well.
292
--echo # Switching to connection 'con1'.
294
--echo # These statements should not be blocked.
295
# The below test for SHOW CREATE TABLE is disabled until bug 52593
296
# "SHOW CREATE TABLE is blocked if table is locked for write by another
297
# connection" is fixed.
299
show create table t1;
304
--echo # Switching to connection 'default'.
310
--echo # 2. Statements which read tables through subqueries.
314
--echo # 2.1 CALL with a subquery.
316
--echo # In theory strong lock is not necessary as this statement
317
--echo # is not written to the binary log as a whole (it is written
318
--echo # statement-by-statement). But in practice in 5.1 for
319
--echo # almost everything except SELECT we take strong lock.
320
let $statement= call p1((select i + 5 from t1 where i = 1));
321
let $restore_table= t2;
322
--source include/check_no_concurrent_insert.inc
325
--echo # 2.2 CREATE TABLE with a subquery.
327
--echo # Has to take a strong lock on the table being read as
328
--echo # this statement is written to the binary log and therefore
329
--echo # should be serialized with concurrent statements.
330
let $statement= create table t0 select * from t1;
331
let $restore_table= ;
332
--source include/check_no_concurrent_insert.inc
334
let $statement= create table t0 select j from t2 where j in (select i from t1);
335
let $restore_table= ;
336
--source include/check_no_concurrent_insert.inc
340
--echo # 2.3 DELETE with a subquery.
342
--echo # The above is true for this statement as well.
343
let $statement= delete from t2 where j in (select i from t1);
344
let $restore_table= t2;
345
--source include/check_no_concurrent_insert.inc
348
--echo # 2.4 MULTI-DELETE with a subquery.
350
--echo # Same is true for this statement as well.
351
let $statement= delete t2 from t3, t2 where k = j and j in (select i from t1);
352
let $restore_table= t2;
353
--source include/check_no_concurrent_insert.inc
357
--echo # 2.5 DO with a subquery.
359
--echo # In theory strong lock is not necessary as it is not logged.
360
--echo # But in practice in 5.1 for almost everything except SELECT
361
--echo # we take strong lock.
362
let $statement= do (select i from t1 where i = 1);
363
let $restore_table= ;
364
--source include/check_no_concurrent_insert.inc
367
--echo # 2.6 INSERT with a subquery.
369
--echo # Has to take a strong lock on the table being read as
370
--echo # this statement is written to the binary log and therefore
371
--echo # should be serialized with concurrent inserts.
372
let $statement= insert into t2 select i+5 from t1;
373
let $restore_table= t2;
374
--source include/check_no_concurrent_insert.inc
375
let $statement= insert into t2 values ((select i+5 from t1 where i = 4));
376
let $restore_table= t2;
377
--source include/check_no_concurrent_insert.inc
380
--echo # 2.7 LOAD DATA with a subquery.
382
--echo # The above is true for this statement as well.
383
let $statement= load data infile '../../std_data/rpl_loaddata.dat' into table t2 (@a, @b) set j= @b + (select i from t1 where i = 1);
384
let $restore_table= t2;
385
--source include/check_no_concurrent_insert.inc
388
--echo # 2.8 REPLACE with a subquery.
390
--echo # Same is true for this statement as well.
391
let $statement= replace into t2 select i+5 from t1;
392
let $restore_table= t2;
393
--source include/check_no_concurrent_insert.inc
394
let $statement= replace into t2 values ((select i+5 from t1 where i = 4));
395
let $restore_table= t2;
396
--source include/check_no_concurrent_insert.inc
399
--echo # 2.9 SELECT with a subquery.
401
--echo # Strong locks are not necessary as this statement is not written
402
--echo # to the binary log and thanks to how MyISAM works this statement
403
--echo # sees a version of the table prior to the concurrent insert.
404
let $statement= select * from t2 where j in (select i from t1);
405
let $restore_table= ;
406
--source include/check_concurrent_insert.inc
409
--echo # 2.10 SET with a subquery.
411
--echo # In theory the same is true for this statement as well.
412
--echo # But in practice in 5.1 we acquire strong lock in this
413
--echo # case as well.
414
let $statement= set @a:= (select i from t1 where i = 1);
415
let $restore_table= ;
416
--source include/check_no_concurrent_insert.inc
419
--echo # 2.11 SHOW with a subquery.
421
--echo # The same is true for this statement too.
422
let $statement= show tables from test where Tables_in_test = 't2' and (select i from t1 where i = 1);
423
let $restore_table= ;
424
--source include/check_no_concurrent_insert.inc
425
let $statement= show columns from t2 where (select i from t1 where i = 1);
426
let $restore_table= ;
427
--source include/check_no_concurrent_insert.inc
430
--echo # 2.12 UPDATE with a subquery.
432
--echo # Has to take a strong lock on the table being read as
433
--echo # this statement is written to the binary log and therefore
434
--echo # should be serialized with concurrent inserts.
435
let $statement= update t2 set j= j-10 where j in (select i from t1);
436
let $restore_table= t2;
437
--source include/check_no_concurrent_insert.inc
440
--echo # 2.13 MULTI-UPDATE with a subquery.
442
--echo # Same is true for this statement as well.
443
let $statement= update t2, t3 set j= j -10 where j=k and j in (select i from t1);
444
let $restore_table= t2;
445
--source include/check_no_concurrent_insert.inc
449
--echo # 3. Statements which read tables through a view.
453
--echo # 3.1 SELECT statement which uses some table through a view.
455
--echo # Since this statement is not written to the binary log and
456
--echo # an old version of the table is accessible thanks to how MyISAM
457
--echo # handles concurrent insert, no locking is necessary.
458
let $statement= select * from v1;
459
let $restore_table= ;
460
--source include/check_concurrent_insert.inc
461
let $statement= select * from v2;
462
let $restore_table= ;
463
--source include/check_concurrent_insert.inc
464
let $statement= select * from t2 where j in (select i from v1);
465
let $restore_table= ;
466
--source include/check_concurrent_insert.inc
467
let $statement= select * from t3 where k in (select j from v2);
468
let $restore_table= ;
469
--source include/check_concurrent_insert.inc
472
--echo # 3.2 Statements which modify a table and use views.
474
--echo # Since such statements are going to be written to the binary
475
--echo # log they need to be serialized against concurrent statements
476
--echo # and therefore should take strong locks on the data read.
477
let $statement= update t2 set j= j-10 where j in (select i from v1);
478
let $restore_table= t2;
479
--source include/check_no_concurrent_insert.inc
480
let $statement= update t3 set k= k-10 where k in (select j from v2);
481
let $restore_table= t2;
482
--source include/check_no_concurrent_insert.inc
483
let $statement= update t2, v1 set j= j-10 where j = i;
484
let $restore_table= t2;
485
--source include/check_no_concurrent_insert.inc
486
let $statement= update v2 set j= j-10 where j = 3;
487
let $restore_table= t2;
488
--source include/check_no_concurrent_insert.inc
492
--echo # 4. Statements which read tables through stored functions.
496
--echo # 4.1 SELECT/SET with a stored function which does not
497
--echo # modify data and uses SELECT in its turn.
499
--echo # Calls to such functions won't get into the binary log and
500
--echo # thus don't need to acquire strong locks.
501
--echo # In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs
502
--echo # used stored functions may lead to broken SBR" strong locks
503
--echo # are taken (we accepted it as a trade-off for this fix).
504
let $statement= select f1();
505
let $restore_table= ;
506
--source include/check_concurrent_insert.inc
507
let $statement= set @a:= f1();
508
let $restore_table= ;
509
--source include/check_concurrent_insert.inc
512
--echo # 4.2 INSERT (or other statement which modifies data) with
513
--echo # a stored function which does not modify data and uses
516
--echo # Since such statement is written to the binary log it should
517
--echo # be serialized with concurrent statements affecting the data
518
--echo # it uses. Therefore it should take strong lock on the data
520
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
521
--echo # functions may lead to broken SBR" weak locks are taken.
522
let $statement= insert into t2 values (f1() + 5);
523
let $restore_table= t2;
524
--source include/check_concurrent_insert.inc
527
--echo # 4.3 SELECT/SET with a stored function which
528
--echo # reads and modifies data.
530
--echo # Since a call to such function is written to the binary log,
531
--echo # it should be serialized with concurrent statements affecting
532
--echo # the data it uses. Hence, a strong lock on the data read
533
--echo # should be taken.
534
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
535
--echo # functions may lead to broken SBR" weak locks are taken.
536
let $statement= select f2();
537
let $restore_table= t2;
538
--source include/check_concurrent_insert.inc
539
let $statement= set @a:= f2();
540
let $restore_table= t2;
541
--source include/check_concurrent_insert.inc
544
--echo # 4.4. SELECT/SET with a stored function which does not
545
--echo # modify data and reads a table through subselect
546
--echo # in a control construct.
548
--echo # Again, in theory a call to this function won't get to the
549
--echo # binary log and thus no strong lock is needed. But in practice
550
--echo # we don't detect this fact early enough (get_lock_type_for_table())
551
--echo # to avoid taking a strong lock.
552
let $statement= select f3();
553
let $restore_table= ;
554
--source include/check_no_concurrent_insert.inc
555
let $statement= set @a:= f3();
556
let $restore_table= ;
557
--source include/check_no_concurrent_insert.inc
558
let $statement= select f4();
559
let $restore_table= ;
560
--source include/check_no_concurrent_insert.inc
561
let $statement= set @a:= f4();
562
let $restore_table= ;
563
--source include/check_no_concurrent_insert.inc
566
--echo # 4.5. INSERT (or other statement which modifies data) with
567
--echo # a stored function which does not modify data and reads
568
--echo # the table through a subselect in one of its control
571
--echo # Since such statement is written to the binary log it should
572
--echo # be serialized with concurrent statements affecting data it
573
--echo # uses. Therefore it should take a strong lock on the data
575
let $statement= insert into t2 values (f3() + 5);
576
let $restore_table= t2;
577
--source include/check_no_concurrent_insert.inc
578
let $statement= insert into t2 values (f4() + 6);
579
let $restore_table= t2;
580
--source include/check_no_concurrent_insert.inc
583
--echo # 4.6 SELECT/SET which uses a stored function with
584
--echo # DML which reads a table via a subquery.
586
--echo # Since call to such function is written to the binary log
587
--echo # it should be serialized with concurrent statements.
588
--echo # Hence reads should take a strong lock.
589
let $statement= select f5();
590
let $restore_table= t2;
591
--source include/check_no_concurrent_insert.inc
592
let $statement= set @a:= f5();
593
let $restore_table= t2;
594
--source include/check_no_concurrent_insert.inc
597
--echo # 4.7 SELECT/SET which uses a stored function which
598
--echo # doesn't modify data and reads tables through
601
--echo # Once again, in theory, calls to such functions won't
602
--echo # get into the binary log and thus don't need strong
603
--echo # locks. In practice this fact is discovered
604
--echo # too late to have any effect.
605
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
606
--echo # functions may lead to broken SBR" weak locks are taken
607
--echo # in case when simple SELECT is used.
608
let $statement= select f6();
609
let $restore_table= t2;
610
--source include/check_concurrent_insert.inc
611
let $statement= set @a:= f6();
612
let $restore_table= t2;
613
--source include/check_concurrent_insert.inc
614
let $statement= select f7();
615
let $restore_table= t2;
616
--source include/check_no_concurrent_insert.inc
617
let $statement= set @a:= f7();
618
let $restore_table= t2;
619
--source include/check_no_concurrent_insert.inc
622
--echo # 4.8 INSERT which uses stored function which
623
--echo # doesn't modify data and reads a table
624
--echo # through a view.
626
--echo # Since such statement is written to the binary log and
627
--echo # should be serialized with concurrent statements affecting
628
--echo # the data it uses. Therefore it should take a strong lock on
629
--echo # the table it reads.
630
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
631
--echo # functions may lead to broken SBR" weak locks are taken
632
--echo # in case when simple SELECT is used.
633
let $statement= insert into t3 values (f6() + 5);
634
let $restore_table= t3;
635
--source include/check_concurrent_insert.inc
636
let $statement= insert into t3 values (f7() + 5);
637
let $restore_table= t3;
638
--source include/check_no_concurrent_insert.inc
642
--echo # 4.9 SELECT which uses a stored function which
643
--echo # modifies data and reads tables through a view.
645
--echo # Since a call to such function is written to the binary log
646
--echo # it should be serialized with concurrent statements.
647
--echo # Hence, reads should take strong locks.
648
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
649
--echo # functions may lead to broken SBR" weak locks are taken
650
--echo # in case when simple SELECT is used.
651
let $statement= select f8();
652
let $restore_table= t2;
653
--source include/check_concurrent_insert.inc
654
let $statement= select f9();
655
let $restore_table= t2;
656
--source include/check_no_concurrent_insert.inc
659
--echo # 4.10 SELECT which uses a stored function which doesn't modify
660
--echo # data and reads a table indirectly, by calling another
663
--echo # Calls to such functions won't get into the binary log and
664
--echo # thus don't need to acquire strong locks.
665
--echo # In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs
666
--echo # used stored functions may lead to broken SBR" strong locks
667
--echo # are taken (we accepted it as a trade-off for this fix).
668
let $statement= select f10();
669
let $restore_table= ;
670
--source include/check_concurrent_insert.inc
673
--echo # 4.11 INSERT which uses a stored function which doesn't modify
674
--echo # data and reads a table indirectly, by calling another
677
--echo # Since such statement is written to the binary log, it should
678
--echo # be serialized with concurrent statements affecting the data it
679
--echo # uses. Therefore it should take strong locks on data it reads.
680
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
681
--echo # functions may lead to broken SBR" weak locks are taken.
682
let $statement= insert into t2 values (f10() + 5);
683
let $restore_table= t2;
684
--source include/check_concurrent_insert.inc
687
--echo # 4.12 SELECT which uses a stored function which modifies
688
--echo # data and reads a table indirectly, by calling another
691
--echo # Since a call to such function is written to the binary log
692
--echo # it should be serialized from concurrent statements.
693
--echo # Hence, read should take a strong lock.
694
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
695
--echo # functions may lead to broken SBR" weak locks are taken.
696
let $statement= select f11();
697
let $restore_table= t2;
698
--source include/check_concurrent_insert.inc
701
--echo # 4.13 SELECT that reads a table through a subquery passed
702
--echo # as a parameter to a stored function which modifies
705
--echo # Even though a call to this function is written to the
706
--echo # binary log, values of its parameters are written as literals.
707
--echo # So there is no need to acquire strong locks for tables used in
708
--echo # the subquery.
709
let $statement= select f12((select i+10 from t1 where i=1));
710
let $restore_table= t2;
711
--source include/check_concurrent_insert.inc
714
--echo # 4.14 INSERT that reads a table via a subquery passed
715
--echo # as a parameter to a stored function which doesn't
716
--echo # modify data.
718
--echo # Since this statement is written to the binary log it should
719
--echo # be serialized with concurrent statements affecting the data it
720
--echo # uses. Therefore it should take strong locks on the data it reads.
721
let $statement= insert into t2 values (f13((select i+10 from t1 where i=1)));
722
let $restore_table= t2;
723
--source include/check_no_concurrent_insert.inc
727
--echo # 5. Statements that read tables through stored procedures.
731
--echo # 5.1 CALL statement which reads a table via SELECT.
733
--echo # Since neither this statement nor its components are
734
--echo # written to the binary log, there is no need to take
735
--echo # strong locks on the data it reads.
736
let $statement= call p2(@a);
737
let $restore_table= ;
738
--source include/check_concurrent_insert.inc
741
--echo # 5.2 Function that modifies data and uses CALL,
742
--echo # which reads a table through SELECT.
744
--echo # Since a call to such function is written to the binary
745
--echo # log, it should be serialized with concurrent statements.
746
--echo # Hence, in this case reads should take strong locks on data.
747
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
748
--echo # functions may lead to broken SBR" weak locks are taken.
749
let $statement= select f14();
750
let $restore_table= t2;
751
--source include/check_concurrent_insert.inc
754
--echo # 5.3 SELECT that calls a function that doesn't modify data and
755
--echo # uses a CALL statement that reads a table via SELECT.
757
--echo # Calls to such functions won't get into the binary log and
758
--echo # thus don't need to acquire strong locks.
759
--echo # In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs
760
--echo # used stored functions may lead to broken SBR" strong locks
761
--echo # are taken (we accepted it as a trade-off for this fix).
762
let $statement= select f15();
763
let $restore_table= ;
764
--source include/check_concurrent_insert.inc
767
--echo # 5.4 INSERT which calls function which doesn't modify data and
768
--echo # uses CALL statement which reads table through SELECT.
770
--echo # Since such statement is written to the binary log it should
771
--echo # be serialized with concurrent statements affecting data it
772
--echo # uses. Therefore it should take strong locks on data it reads.
773
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
774
--echo # functions may lead to broken SBR" weak locks are taken.
775
let $statement= insert into t2 values (f15()+5);
776
let $restore_table= t2;
777
--source include/check_concurrent_insert.inc
781
--echo # 6. Statements that use triggers.
785
--echo # 6.1 Statement invoking a trigger that reads table via SELECT.
787
--echo # Since this statement is written to the binary log it should
788
--echo # be serialized with concurrent statements affecting the data
789
--echo # it uses. Therefore, it should take strong locks on the data
791
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
792
--echo # functions may lead to broken SBR" weak locks are taken.
793
let $statement= insert into t4 values (2);
794
let $restore_table= t4;
795
--source include/check_concurrent_insert.inc
798
--echo # 6.2 Statement invoking a trigger that reads table through
799
--echo # a subquery in a control construct.
801
--echo # The above is true for this statement as well.
802
let $statement= update t4 set l= 2 where l = 1;
803
let $restore_table= t4;
804
--source include/check_no_concurrent_insert.inc
807
--echo # 6.3 Statement invoking a trigger that reads a table through
810
--echo # And for this statement.
811
let $statement= delete from t4 where l = 1;
812
let $restore_table= t4;
813
--source include/check_no_concurrent_insert.inc
816
--echo # 6.4 Statement invoking a trigger that reads a table through
817
--echo # a stored function.
819
--echo # And for this statement.
820
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
821
--echo # functions may lead to broken SBR" weak locks are taken.
822
let $statement= insert into t5 values (2);
823
let $restore_table= t5;
824
--source include/check_concurrent_insert.inc
827
--echo # 6.5 Statement invoking a trigger that reads a table through
828
--echo # stored procedure.
830
--echo # And for this statement.
831
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
832
--echo # functions may lead to broken SBR" weak locks are taken.
833
let $statement= update t5 set l= 2 where l = 1;
834
let $restore_table= t5;
835
--source include/check_concurrent_insert.inc
857
drop table t1, t2, t3, t4, t5, te;
862
set @@global.concurrent_insert= @old_concurrent_insert;
865
# Check that all connections opened by test cases in this file are really
866
# gone so execution of other tests won't be affected by their presence.
867
--source include/wait_until_count_sessions.inc