1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-35235 innodb_snapshot_isolation=ON fails to signal transaction rollback

convert_error_code_to_mysql(): Treat DB_DEADLOCK and DB_RECORD_CHANGED
in the same way, that is, signal to the SQL layer that the transaction
had been rolled back.
This commit is contained in:
Marko Mäkelä
2024-10-23 07:55:22 +03:00
parent b3be3c2157
commit 1cad1dbde6
3 changed files with 10 additions and 4 deletions

View File

@ -134,8 +134,10 @@ BEGIN;
INSERT INTO t SET a=2;
connection consistent;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
SAVEPOINT sp1;
SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
ERROR HY000: Record has changed since last read in table 't'
SAVEPOINT sp1;
connection con_weird;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
@ -155,3 +157,4 @@ a b
disconnect consistent;
connection default;
DROP TABLE t;
# End of 10.6 tests

View File

@ -152,10 +152,12 @@ BEGIN; INSERT INTO t SET a=2;
--connection consistent
START TRANSACTION WITH CONSISTENT SNAPSHOT;
SAVEPOINT sp1;
--disable_ps2_protocol
--error ER_CHECKREAD
SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
--enable_ps2_protocol
SAVEPOINT sp1;
--connection con_weird
START TRANSACTION WITH CONSISTENT SNAPSHOT;
@ -181,3 +183,5 @@ SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
--connection default
DROP TABLE t;
--echo # End of 10.6 tests