mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
Merge adventure.(none):/home/thek/Development/cpp/bug29929/my50-bug29929
into adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
This commit is contained in:
commit
421fa784be
5 changed files with 193 additions and 133 deletions
|
|
@ -289,4 +289,34 @@ create table t1 select f_bug22427() as i;
|
|||
ERROR 42S01: Table 't1' already exists
|
||||
drop table t1;
|
||||
drop function f_bug22427;
|
||||
#
|
||||
# Bug #29929 LOCK TABLES does not pre-lock tables used in triggers of the locked tables
|
||||
#
|
||||
DROP table IF EXISTS t1,t2;
|
||||
CREATE TABLE t1 (c1 INT);
|
||||
CREATE TABLE t2 (c2 INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t2 VALUES (2);
|
||||
CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
UPDATE t2 SET c2= c2 + 1;
|
||||
END//
|
||||
# Take a table lock on t1.
|
||||
# This should pre-lock t2 through the trigger.
|
||||
LOCK TABLE t1 WRITE;
|
||||
INSERT INTO t1 VALUES (3);
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLE t1 READ;
|
||||
INSERT INTO t2 values(4);
|
||||
ERROR HY000: Table 't2' was not locked with LOCK TABLES
|
||||
UNLOCK TABLES;
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
3
|
||||
SELECT * FROM t2;
|
||||
c2
|
||||
3
|
||||
DROP TRIGGER t1_ai;
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
|
|
|
|||
|
|
@ -356,4 +356,35 @@ create table t1 select f_bug22427() as i;
|
|||
drop table t1;
|
||||
drop function f_bug22427;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #29929 LOCK TABLES does not pre-lock tables used in triggers of the locked tables
|
||||
--echo #
|
||||
--disable_warnings
|
||||
DROP table IF EXISTS t1,t2;
|
||||
--enable_warnings
|
||||
CREATE TABLE t1 (c1 INT);
|
||||
CREATE TABLE t2 (c2 INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t2 VALUES (2);
|
||||
DELIMITER //;
|
||||
CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
UPDATE t2 SET c2= c2 + 1;
|
||||
END//
|
||||
DELIMITER ;//
|
||||
--echo # Take a table lock on t1.
|
||||
--echo # This should pre-lock t2 through the trigger.
|
||||
LOCK TABLE t1 WRITE;
|
||||
INSERT INTO t1 VALUES (3);
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLE t1 READ;
|
||||
--error ER_TABLE_NOT_LOCKED
|
||||
INSERT INTO t2 values(4);
|
||||
UNLOCK TABLES;
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
DROP TRIGGER t1_ai;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue