1
# This test covers behavior for InnoDB tables.
2
--source include/have_innodb.inc
3
# This test requires statement/mixed mode binary logging.
4
# Row-based mode puts weaker serializability requirements
5
# so weaker locks are acquired for it.
6
--source include/have_binlog_format_mixed_or_statement.inc
7
# Save the initial number of concurrent sessions.
8
--source include/count_sessions.inc
11
--echo # Test how do we handle locking in various cases when
12
--echo # we read data from InnoDB tables.
14
--echo # In fact by performing this test we check two things:
15
--echo # 1) That SQL-layer correctly determine type of thr_lock.c
16
--echo # lock to be acquired/passed to InnoDB engine.
17
--echo # 2) That InnoDB engine correctly interprets this lock
18
--echo # type and takes necessary row locks or does not
19
--echo # take them if they are not necessary.
22
--echo # This test makes sense only in REPEATABLE-READ mode as
23
--echo # in SERIALIZABLE mode all statements that read data take
24
--echo # shared lock on them to enforce its semantics.
25
select @@session.tx_isolation;
27
--echo # Prepare playground by creating tables, views,
28
--echo # routines and triggers used in tests.
29
connect (con1, localhost, root,,);
32
drop table if exists t0, t1, t2, t3, t4, t5, te;
33
drop view if exists v1, v2;
34
drop procedure if exists p1;
35
drop procedure if exists p2;
36
drop function if exists f1;
37
drop function if exists f2;
38
drop function if exists f3;
39
drop function if exists f4;
40
drop function if exists f5;
41
drop function if exists f6;
42
drop function if exists f7;
43
drop function if exists f8;
44
drop function if exists f9;
45
drop function if exists f10;
46
drop function if exists f11;
47
drop function if exists f12;
48
drop function if exists f13;
49
drop function if exists f14;
50
drop function if exists f15;
52
create table t1 (i int primary key) engine=innodb;
53
insert into t1 values (1), (2), (3), (4), (5);
54
create table t2 (j int primary key) engine=innodb;
55
insert into t2 values (1), (2), (3), (4), (5);
56
create table t3 (k int primary key) engine=innodb;
57
insert into t3 values (1), (2), (3);
58
create table t4 (l int primary key) engine=innodb;
59
insert into t4 values (1);
60
create table t5 (l int primary key) engine=innodb;
61
insert into t5 values (1);
62
create table te(e int primary key);
63
insert into te values (1);
64
create view v1 as select i from t1;
65
create view v2 as select j from t2 where j in (select i from t1);
66
create procedure p1(k int) insert into t2 values (k);
68
create function f1() returns int
71
select i from t1 where i = 1 into j;
74
create function f2() returns int
77
select i from t1 where i = 1 into k;
78
insert into t2 values (k + 5);
81
create function f3() returns int
83
return (select i from t1 where i = 3);
85
create function f4() returns int
87
if (select i from t1 where i = 3) then
93
create function f5() returns int
95
insert into t2 values ((select i from t1 where i = 1) + 5);
98
create function f6() returns int
101
select i from v1 where i = 1 into k;
104
create function f7() returns int
107
select j from v2 where j = 1 into k;
110
create function f8() returns int
113
select i from v1 where i = 1 into k;
114
insert into t2 values (k+5);
117
create function f9() returns int
119
update v2 set j=j+10 where j=1;
122
create function f10() returns int
126
create function f11() returns int
130
insert into t2 values (k+5);
133
create function f12(p int) returns int
135
insert into t2 values (p);
138
create function f13(p int) returns int
142
create procedure p2(inout p int)
144
select i from t1 where i = 1 into p;
146
create function f14() returns int
150
insert into t2 values (k+5);
153
create function f15() returns int
159
create trigger t4_bi before insert on t4 for each row
162
select i from t1 where i=1 into k;
165
create trigger t4_bu before update on t4 for each row
167
if (select i from t1 where i=1) then
171
--echo # Trigger below uses insertion of duplicate key in 'te'
172
--echo # table as a way to abort delete operation.
173
create trigger t4_bd before delete on t4 for each row
175
if !(select i from v1 where i=1) then
176
insert into te values (1);
179
create trigger t5_bi before insert on t5 for each row
183
create trigger t5_bu before update on t5 for each row
192
--echo # Set common variables to be used by scripts called below.
199
--echo # 1. Statements that read tables and do not use subqueries.
203
--echo # 1.1 Simple SELECT statement.
205
--echo # No locks are necessary as this statement won't be written
206
--echo # to the binary log and InnoDB supports snapshots.
207
let $statement= select * from t1;
208
--source include/check_no_row_lock.inc
211
--echo # 1.2 Multi-UPDATE statement.
213
--echo # Has to take shared locks on rows in the table being read as this
214
--echo # statement will be written to the binary log and therefore should
215
--echo # be serialized with concurrent statements.
216
let $statement= update t2, t1 set j= j - 1 where i = j;
217
let $wait_statement= $statement;
218
--source include/check_shared_row_lock.inc
221
--echo # 1.3 Multi-DELETE statement.
223
--echo # The above is true for this statement as well.
224
let $statement= delete t2 from t1, t2 where i = j;
225
let $wait_statement= $statement;
226
--source include/check_shared_row_lock.inc
229
--echo # 1.4 DESCRIBE statement.
231
--echo # This statement does not really read data from the
232
--echo # target table and thus does not take any lock on it.
233
--echo # We check this for completeness of coverage.
234
let $statement= describe t1;
235
--source include/check_no_row_lock.inc
238
--echo # 1.5 SHOW statements.
240
--echo # The above is true for SHOW statements as well.
241
let $statement= show create table t1;
242
--source include/check_no_row_lock.inc
243
let $statement= show keys from t1;
244
--source include/check_no_row_lock.inc
248
--echo # 2. Statements which read tables through subqueries.
252
--echo # 2.1 CALL with a subquery.
254
--echo # A strong lock is not necessary as this statement is not
255
--echo # written to the binary log as a whole (it is written
256
--echo # statement-by-statement) and thanks to MVCC we can always get
257
--echo # versions of rows prior to the update that has locked them.
258
--echo # But in practice InnoDB does locking reads for all statements
259
--echo # other than SELECT (unless it is a READ-COMITTED mode or
260
--echo # innodb_locks_unsafe_for_binlog is ON).
261
let $statement= call p1((select i + 5 from t1 where i = 1));
262
let $wait_statement= $statement;
263
--source include/check_shared_row_lock.inc
266
--echo # 2.2 CREATE TABLE with a subquery.
268
--echo # Has to take shared locks on rows in the table being read as
269
--echo # this statement is written to the binary log and therefore
270
--echo # should be serialized with concurrent statements.
271
let $statement= create table t0 engine=innodb select * from t1;
272
let $wait_statement= $statement;
273
--source include/check_shared_row_lock.inc
275
let $statement= create table t0 engine=innodb select j from t2 where j in (select i from t1);
276
let $wait_statement= $statement;
277
--source include/check_shared_row_lock.inc
281
--echo # 2.3 DELETE with a subquery.
283
--echo # The above is true for this statement as well.
284
let $statement= delete from t2 where j in (select i from t1);
285
let $wait_statement= $statement;
286
--source include/check_shared_row_lock.inc
289
--echo # 2.4 MULTI-DELETE with a subquery.
291
--echo # Same is true for this statement as well.
292
let $statement= delete t2 from t3, t2 where k = j and j in (select i from t1);
293
let $wait_statement= $statement;
294
--source include/check_shared_row_lock.inc
297
--echo # 2.5 DO with a subquery.
299
--echo # In theory should not take row locks as it is not logged.
300
--echo # In practice InnoDB takes shared row locks.
301
let $statement= do (select i from t1 where i = 1);
302
let $wait_statement= $statement;
303
--source include/check_shared_row_lock.inc
306
--echo # 2.6 INSERT with a subquery.
308
--echo # Has to take shared locks on rows in the table being read as
309
--echo # this statement is written to the binary log and therefore
310
--echo # should be serialized with concurrent statements.
311
let $statement= insert into t2 select i+5 from t1;
312
let $wait_statement= $statement;
313
--source include/check_shared_row_lock.inc
314
let $statement= insert into t2 values ((select i+5 from t1 where i = 4));
315
let $wait_statement= $statement;
316
--source include/check_shared_row_lock.inc
319
--echo # 2.7 LOAD DATA with a subquery.
321
--echo # The above is true for this statement as well.
322
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);
323
let $wait_statement= $statement;
324
--source include/check_shared_row_lock.inc
327
--echo # 2.8 REPLACE with a subquery.
329
--echo # Same is true for this statement as well.
330
let $statement= replace into t2 select i+5 from t1;
331
let $wait_statement= $statement;
332
--source include/check_shared_row_lock.inc
333
let $statement= replace into t2 values ((select i+5 from t1 where i = 4));
334
let $wait_statement= $statement;
335
--source include/check_shared_row_lock.inc
338
--echo # 2.9 SELECT with a subquery.
340
--echo # Locks are not necessary as this statement is not written
341
--echo # to the binary log and thanks to MVCC we can always get
342
--echo # versions of rows prior to the update that has locked them.
344
--echo # Also serves as a test case for bug #46947 "Embedded SELECT
345
--echo # without FOR UPDATE is causing a lock".
346
let $statement= select * from t2 where j in (select i from t1);
347
--source include/check_no_row_lock.inc
350
--echo # 2.10 SET with a subquery.
352
--echo # In theory should not require locking as it is not written
353
--echo # to the binary log. In practice InnoDB acquires shared row
355
let $statement= set @a:= (select i from t1 where i = 1);
356
let $wait_statement= $statement;
357
--source include/check_shared_row_lock.inc
360
--echo # 2.11 SHOW with a subquery.
362
--echo # Similarly to the previous case, in theory should not require locking
363
--echo # as it is not written to the binary log. In practice InnoDB
364
--echo # acquires shared row locks.
365
let $statement= show tables from test where Tables_in_test = 't2' and (select i from t1 where i = 1);
366
let $wait_statement= $statement;
367
--source include/check_shared_row_lock.inc
368
let $statement= show columns from t2 where (select i from t1 where i = 1);
369
let $wait_statement= $statement;
370
--source include/check_shared_row_lock.inc
373
--echo # 2.12 UPDATE with a subquery.
375
--echo # Has to take shared locks on rows in the table being read as
376
--echo # this statement is written to the binary log and therefore
377
--echo # should be serialized with concurrent statements.
378
let $statement= update t2 set j= j-10 where j in (select i from t1);
379
let $wait_statement= $statement;
380
--source include/check_shared_row_lock.inc
383
--echo # 2.13 MULTI-UPDATE with a subquery.
385
--echo # Same is true for this statement as well.
386
let $statement= update t2, t3 set j= j -10 where j=k and j in (select i from t1);
387
let $wait_statement= $statement;
388
--source include/check_shared_row_lock.inc
392
--echo # 3. Statements which read tables through a view.
396
--echo # 3.1 SELECT statement which uses some table through a view.
398
--echo # Since this statement is not written to the binary log
399
--echo # and old version of rows are accessible thanks to MVCC,
400
--echo # no locking is necessary.
401
let $statement= select * from v1;
402
--source include/check_no_row_lock.inc
403
let $statement= select * from v2;
404
--source include/check_no_row_lock.inc
405
let $statement= select * from t2 where j in (select i from v1);
406
--source include/check_no_row_lock.inc
407
let $statement= select * from t3 where k in (select j from v2);
408
--source include/check_no_row_lock.inc
411
--echo # 3.2 Statements which modify a table and use views.
413
--echo # Since such statements are going to be written to the binary
414
--echo # log they need to be serialized against concurrent statements
415
--echo # and therefore should take shared row locks on data read.
416
let $statement= update t2 set j= j-10 where j in (select i from v1);
417
let $wait_statement= $statement;
418
--source include/check_shared_row_lock.inc
419
let $statement= update t3 set k= k-10 where k in (select j from v2);
420
let $wait_statement= $statement;
421
--source include/check_shared_row_lock.inc
422
let $statement= update t2, v1 set j= j-10 where j = i;
423
let $wait_statement= $statement;
424
--source include/check_shared_row_lock.inc
425
let $statement= update v2 set j= j-10 where j = 3;
426
let $wait_statement= $statement;
427
--source include/check_shared_row_lock.inc
431
--echo # 4. Statements which read tables through stored functions.
435
--echo # 4.1 SELECT/SET with a stored function which does not
436
--echo # modify data and uses SELECT in its turn.
438
--echo # Calls to such functions won't get into the binary log and
439
--echo # thus don't need to acquire strong locks.
440
--echo # In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs
441
--echo # used stored functions may lead to broken SBR" strong locks
442
--echo # are taken (we accepted it as a trade-off for this fix).
443
let $statement= select f1();
444
let $wait_statement= select i from t1 where i = 1 into j;
445
--source include/check_no_row_lock.inc
446
let $statement= set @a:= f1();
447
let $wait_statement= select i from t1 where i = 1 into j;
448
--source include/check_no_row_lock.inc
451
--echo # 4.2 INSERT (or other statement which modifies data) with
452
--echo # a stored function which does not modify data and uses
455
--echo # Since such statement is written to the binary log it should
456
--echo # be serialized with concurrent statements affecting the data
457
--echo # it uses. Therefore it should take row locks on the data
459
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
460
--echo # functions may lead to broken SBR" no lock is taken.
461
let $statement= insert into t2 values (f1() + 5);
462
let $wait_statement= select i from t1 where i = 1 into j;
463
--source include/check_no_row_lock.inc
466
--echo # 4.3 SELECT/SET with a stored function which
467
--echo # reads and modifies data.
469
--echo # Since a call to such function is written to the binary log,
470
--echo # it should be serialized with concurrent statements affecting
471
--echo # the data it uses. Hence, row locks on the data read
472
--echo # should be taken.
473
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
474
--echo # functions may lead to broken SBR" no lock is taken.
475
let $statement= select f2();
476
let $wait_statement= select i from t1 where i = 1 into k;
477
--source include/check_no_row_lock.inc
478
let $statement= set @a:= f2();
479
let $wait_statement= select i from t1 where i = 1 into k;
480
--source include/check_no_row_lock.inc
483
--echo # 4.4. SELECT/SET with a stored function which does not
484
--echo # modify data and reads a table through subselect
485
--echo # in a control construct.
487
--echo # Again, in theory a call to this function won't get to the
488
--echo # binary log and thus no locking is needed. But in practice
489
--echo # we don't detect this fact early enough (get_lock_type_for_table())
490
--echo # to avoid taking row locks.
491
let $statement= select f3();
492
let $wait_statement= $statement;
493
--source include/check_shared_row_lock.inc
494
let $statement= set @a:= f3();
495
let $wait_statement= $statement;
496
--source include/check_shared_row_lock.inc
497
let $statement= select f4();
498
let $wait_statement= $statement;
499
--source include/check_shared_row_lock.inc
500
let $statement= set @a:= f4();
501
let $wait_statement= $statement;
502
--source include/check_shared_row_lock.inc
505
--echo # 4.5. INSERT (or other statement which modifies data) with
506
--echo # a stored function which does not modify data and reads
507
--echo # the table through a subselect in one of its control
510
--echo # Since such statement is written to the binary log it should
511
--echo # be serialized with concurrent statements affecting data it
512
--echo # uses. Therefore it should take row locks on the data
514
let $statement= insert into t2 values (f3() + 5);
515
let $wait_statement= $statement;
516
--source include/check_shared_row_lock.inc
517
let $statement= insert into t2 values (f4() + 6);
518
let $wait_statement= $statement;
519
--source include/check_shared_row_lock.inc
522
--echo # 4.6 SELECT/SET which uses a stored function with
523
--echo # DML which reads a table via a subquery.
525
--echo # Since call to such function is written to the binary log
526
--echo # it should be serialized with concurrent statements.
527
--echo # Hence reads should take row locks.
528
let $statement= select f5();
529
let $wait_statement= insert into t2 values ((select i from t1 where i = 1) + 5);
530
--source include/check_shared_row_lock.inc
531
let $statement= set @a:= f5();
532
let $wait_statement= insert into t2 values ((select i from t1 where i = 1) + 5);
533
--source include/check_shared_row_lock.inc
536
--echo # 4.7 SELECT/SET which uses a stored function which
537
--echo # doesn't modify data and reads tables through
540
--echo # Once again, in theory, calls to such functions won't
541
--echo # get into the binary log and thus don't need row
542
--echo # locks. In practice this fact is discovered
543
--echo # too late to have any effect.
544
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
545
--echo # functions may lead to broken SBR" no lock is taken
546
--echo # in case of simple SELECT.
547
let $statement= select f6();
548
let $wait_statement= select i from v1 where i = 1 into k;
549
--source include/check_no_row_lock.inc
550
let $statement= set @a:= f6();
551
let $wait_statement= select i from v1 where i = 1 into k;
552
--source include/check_no_row_lock.inc
553
let $statement= select f7();
554
let $wait_statement= select j from v2 where j = 1 into k;
555
--source include/check_shared_row_lock.inc
556
let $statement= set @a:= f7();
557
let $wait_statement= select j from v2 where j = 1 into k;
558
--source include/check_shared_row_lock.inc
561
--echo # 4.8 INSERT which uses stored function which
562
--echo # doesn't modify data and reads a table
563
--echo # through a view.
565
--echo # Since such statement is written to the binary log and
566
--echo # should be serialized with concurrent statements affecting
567
--echo # the data it uses. Therefore it should take row locks on
568
--echo # the rows it reads.
569
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
570
--echo # functions may lead to broken SBR" no lock is taken
571
--echo # in case of simple SELECT.
572
let $statement= insert into t3 values (f6() + 5);
573
let $wait_statement= select i from v1 where i = 1 into k;
574
--source include/check_no_row_lock.inc
575
let $statement= insert into t3 values (f7() + 5);
576
let $wait_statement= select j from v2 where j = 1 into k;
577
--source include/check_shared_row_lock.inc
581
--echo # 4.9 SELECT which uses a stored function which
582
--echo # modifies data and reads tables through a view.
584
--echo # Since a call to such function is written to the binary log
585
--echo # it should be serialized with concurrent statements.
586
--echo # Hence, reads should take row locks.
587
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
588
--echo # functions may lead to broken SBR" no lock is taken
589
--echo # in case of simple SELECT.
590
let $statement= select f8();
591
let $wait_statement= select i from v1 where i = 1 into k;
592
--source include/check_no_row_lock.inc
593
let $statement= select f9();
594
let $wait_statement= update v2 set j=j+10 where j=1;
595
--source include/check_shared_row_lock.inc
598
--echo # 4.10 SELECT which uses stored function which doesn't modify
599
--echo # data and reads a table indirectly, by calling another
602
--echo # Calls to such functions won't get into the binary log and
603
--echo # thus don't need to acquire strong locks.
604
--echo # In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs
605
--echo # used stored functions may lead to broken SBR" strong locks
606
--echo # are taken (we accepted it as a trade-off for this fix).
607
let $statement= select f10();
608
let $wait_statement= select i from t1 where i = 1 into j;
609
--source include/check_no_row_lock.inc
612
--echo # 4.11 INSERT which uses a stored function which doesn't modify
613
--echo # data and reads a table indirectly, by calling another
616
--echo # Since such statement is written to the binary log, it should
617
--echo # be serialized with concurrent statements affecting the data it
618
--echo # uses. Therefore it should take row locks on data it reads.
619
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
620
--echo # functions may lead to broken SBR" no lock is taken.
621
let $statement= insert into t2 values (f10() + 5);
622
let $wait_statement= select i from t1 where i = 1 into j;
623
--source include/check_no_row_lock.inc
626
--echo # 4.12 SELECT which uses a stored function which modifies
627
--echo # data and reads a table indirectly, by calling another
630
--echo # Since a call to such function is written to the binary log
631
--echo # it should be serialized from concurrent statements.
632
--echo # Hence, reads should take row locks.
633
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
634
--echo # functions may lead to broken SBR" no lock is taken.
635
let $statement= select f11();
636
let $wait_statement= select i from t1 where i = 1 into j;
637
--source include/check_no_row_lock.inc
640
--echo # 4.13 SELECT that reads a table through a subquery passed
641
--echo # as a parameter to a stored function which modifies
644
--echo # Even though a call to this function is written to the
645
--echo # binary log, values of its parameters are written as literals.
646
--echo # So there is no need to acquire row locks on rows used in
647
--echo # the subquery.
648
--echo # But due to the fact that in 5.1 for prelocked statements
649
--echo # THD::in_lock_tables is set to TRUE we acquire strong locks
650
--echo # (see also bug#44613 "SELECT statement inside FUNCTION takes
651
--echo # a shared lock" [sic!!!]).
652
let $statement= select f12((select i+10 from t1 where i=1));
653
let $wait_statement= $statement;
654
--source include/check_shared_row_lock.inc
657
--echo # 4.14 INSERT that reads a table via a subquery passed
658
--echo # as a parameter to a stored function which doesn't
659
--echo # modify data.
661
--echo # Since this statement is written to the binary log it should
662
--echo # be serialized with concurrent statements affecting the data it
663
--echo # uses. Therefore it should take row locks on the data it reads.
664
let $statement= insert into t2 values (f13((select i+10 from t1 where i=1)));
665
let $wait_statement= $statement;
666
--source include/check_shared_row_lock.inc
670
--echo # 5. Statements that read tables through stored procedures.
674
--echo # 5.1 CALL statement which reads a table via SELECT.
676
--echo # Since neither this statement nor its components are
677
--echo # written to the binary log, there is no need to take
678
--echo # row locks on the data it reads.
679
let $statement= call p2(@a);
680
--source include/check_no_row_lock.inc
683
--echo # 5.2 Function that modifies data and uses CALL,
684
--echo # which reads a table through SELECT.
686
--echo # Since a call to such function is written to the binary
687
--echo # log, it should be serialized with concurrent statements.
688
--echo # Hence, in this case reads should take row locks on data.
689
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
690
--echo # functions may lead to broken SBR" no lock is taken.
691
let $statement= select f14();
692
let $wait_statement= select i from t1 where i = 1 into p;
693
--source include/check_no_row_lock.inc
696
--echo # 5.3 SELECT that calls a function that doesn't modify data and
697
--echo # uses a CALL statement that reads a table via SELECT.
699
--echo # Calls to such functions won't get into the binary log and
700
--echo # thus don't need to acquire strong locks.
701
--echo # In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs
702
--echo # used stored functions may lead to broken SBR" strong locks
703
--echo # are taken (we accepted it as a trade-off for this fix).
704
let $statement= select f15();
705
let $wait_statement= select i from t1 where i = 1 into p;
706
--source include/check_no_row_lock.inc
709
--echo # 5.4 INSERT which calls function which doesn't modify data and
710
--echo # uses CALL statement which reads table through SELECT.
712
--echo # Since such statement is written to the binary log it should
713
--echo # be serialized with concurrent statements affecting data it
714
--echo # uses. Therefore it should take row locks on data it reads.
715
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
716
--echo # functions may lead to broken SBR" no lock is taken.
717
let $statement= insert into t2 values (f15()+5);
718
let $wait_statement= select i from t1 where i = 1 into p;
719
--source include/check_no_row_lock.inc
723
--echo # 6. Statements that use triggers.
727
--echo # 6.1 Statement invoking a trigger that reads table via SELECT.
729
--echo # Since this statement is written to the binary log it should
730
--echo # be serialized with concurrent statements affecting the data
731
--echo # it uses. Therefore, it should take row locks on the data
733
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
734
--echo # functions may lead to broken SBR" no lock is taken.
735
let $statement= insert into t4 values (2);
736
let $wait_statement= select i from t1 where i=1 into k;
737
--source include/check_no_row_lock.inc
740
--echo # 6.2 Statement invoking a trigger that reads table through
741
--echo # a subquery in a control construct.
743
--echo # The above is true for this statement as well.
744
let $statement= update t4 set l= 2 where l = 1;
745
let $wait_statement= $statement;
746
--source include/check_shared_row_lock.inc
749
--echo # 6.3 Statement invoking a trigger that reads a table through
752
--echo # And for this statement.
753
let $statement= delete from t4 where l = 1;
754
let $wait_statement= $statement;
755
--source include/check_shared_row_lock.inc
758
--echo # 6.4 Statement invoking a trigger that reads a table through
759
--echo # a stored function.
761
--echo # And for this statement.
762
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
763
--echo # functions may lead to broken SBR" no lock is taken.
764
let $statement= insert into t5 values (2);
765
let $wait_statement= select i from t1 where i = 1 into j;
766
--source include/check_no_row_lock.inc
769
--echo # 6.5 Statement invoking a trigger that reads a table through
770
--echo # stored procedure.
772
--echo # And for this statement.
773
--echo # But due to bug #53921 "Wrong locks for SELECTs used stored
774
--echo # functions may lead to broken SBR" no lock is taken.
775
let $statement= update t5 set l= 2 where l = 1;
776
let $wait_statement= select i from t1 where i = 1 into p;
777
--source include/check_no_row_lock.inc
798
drop table t1, t2, t3, t4, t5, te;
801
# Check that all connections opened by test cases in this file are really
802
# gone so execution of other tests won't be affected by their presence.
803
--source include/wait_until_count_sessions.inc