mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
row0mysql.c, ha_innodb.cc:
Fix bug #12308 : do not roll back the whhole transaction in a lock wait timeout error, just roll back the latest SQL statement; note that the locks set in the latest SQL statements remain, as InnoDB does not know what locks were set in which SQL statement
This commit is contained in:
parent
ffcc4ae4b1
commit
4c68ccd949
2 changed files with 6 additions and 9 deletions
|
@ -513,14 +513,15 @@ handle_new_error:
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
|
|
||||||
} else if (err == DB_DEADLOCK || err == DB_LOCK_WAIT_TIMEOUT
|
} else if (err == DB_DEADLOCK
|
||||||
|| err == DB_LOCK_TABLE_FULL) {
|
|| err == DB_LOCK_TABLE_FULL) {
|
||||||
/* Roll back the whole transaction; this resolution was added
|
/* Roll back the whole transaction; this resolution was added
|
||||||
to version 3.23.43 */
|
to version 3.23.43 */
|
||||||
|
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
||||||
|
|
||||||
} else if (err == DB_OUT_OF_FILE_SPACE) {
|
} else if (err == DB_OUT_OF_FILE_SPACE
|
||||||
|
|| err == DB_LOCK_WAIT_TIMEOUT) {
|
||||||
if (savept) {
|
if (savept) {
|
||||||
/* Roll back the latest, possibly incomplete
|
/* Roll back the latest, possibly incomplete
|
||||||
insertion or update */
|
insertion or update */
|
||||||
|
|
|
@ -463,13 +463,9 @@ convert_error_code_to_mysql(
|
||||||
|
|
||||||
} else if (error == (int) DB_LOCK_WAIT_TIMEOUT) {
|
} else if (error == (int) DB_LOCK_WAIT_TIMEOUT) {
|
||||||
|
|
||||||
/* Since we rolled back the whole transaction, we must
|
/* Starting from 5.0.13, we let MySQL just roll back the
|
||||||
tell it also to MySQL so that MySQL knows to empty the
|
latest SQL statement in a lock wait timeout. Previously, we
|
||||||
cached binlog for this transaction */
|
rolled back the whole transaction. */
|
||||||
|
|
||||||
if (thd) {
|
|
||||||
ha_rollback(thd);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(HA_ERR_LOCK_WAIT_TIMEOUT);
|
return(HA_ERR_LOCK_WAIT_TIMEOUT);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue