mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
80dd3a593a
without error When using quick access methods for searching rows in UPDATE or DELETE there was no check if a fatal error was not already sent to the client while evaluating the quick condition. As a result a false OK (following the error) was sent to the client and the error was thus transformed into a warning. Fixed by checking for errors sent to the client during SQL_SELECT::check_quick() and treating them as real errors. Fixed a wrong test case in group_min_max.test Fixed a wrong return code in mysql_update() and mysql_delete()
29 lines
945 B
Text
29 lines
945 B
Text
#
|
|
# Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout
|
|
# without error
|
|
#
|
|
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b)) ENGINE=InnoDB;
|
|
INSERT INTO t1 (a,b) VALUES (1070109,99);
|
|
CREATE TABLE t2 (b int, a int, PRIMARY KEY (b)) ENGINE=InnoDB;
|
|
INSERT INTO t2 (b,a) VALUES (7,1070109);
|
|
SELECT * FROM t1;
|
|
a b
|
|
1070109 99
|
|
BEGIN;
|
|
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
|
|
b
|
|
7
|
|
BEGIN;
|
|
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
|
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
|
INSERT INTO t1 (a) VALUES ((SELECT a FROM t2 WHERE b=7));
|
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
|
UPDATE t1 SET a='7000000' WHERE a=(SELECT a FROM t2 WHERE b=7);
|
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
|
DELETE FROM t1 WHERE a=(SELECT a FROM t2 WHERE b=7);
|
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
|
SELECT * FROM t1;
|
|
a b
|
|
1070109 99
|
|
DROP TABLE t2, t1;
|
|
End of 5.0 tests
|