summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <tsmith/tim@siva.hindu.god>2006-12-19 16:57:51 -0700
committerunknown <tsmith/tim@siva.hindu.god>2006-12-19 16:57:51 -0700
commit47b0a0b08904e900e6b034e32ad124139c9dcb93 (patch)
tree9d22a6e3d1f813ebfd932d958ebe02a7a5519099 /innobase
parent9d8c9e9d96dc85cfac055b6014ac65d867152edf (diff)
downloadmariadb-git-47b0a0b08904e900e6b034e32ad124139c9dcb93.tar.gz
Added innodb_rollback_on_timeout option to restore the 4.1
InnoDB timeout behavior (Bug #24200) mysql-test/t/innodb_mysql-master.opt: Set --innodb-lock-wait-timeout=2, since test for bug #24200 times out. This *could* cause random test failures if some long-running transaction concurrency is being tested. However, such a test really should go in innodb-big or some other test file.
Diffstat (limited to 'innobase')
-rw-r--r--innobase/include/row0mysql.h2
-rw-r--r--innobase/row/row0mysql.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index 7d8740db044..9e28fabe491 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -19,6 +19,8 @@ Created 9/17/2000 Heikki Tuuri
#include "btr0pcur.h"
#include "trx0types.h"
+extern ibool row_rollback_on_timeout;
+
typedef struct row_prebuilt_struct row_prebuilt_t;
/***********************************************************************
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index efbb93ba9f5..4bc5f39359c 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -35,6 +35,9 @@ Created 9/17/2000 Heikki Tuuri
/* A dummy variable used to fool the compiler */
ibool row_mysql_identically_false = FALSE;
+/* Provide optional 4.x backwards compatibility for 5.0 and above */
+ibool row_rollback_on_timeout = FALSE;
+
/* List of tables we should drop in background. ALTER TABLE in MySQL requires
that the table handler can drop the table in background when there are no
queries to it any more. Protected by the kernel mutex. */
@@ -514,7 +517,9 @@ handle_new_error:
return(TRUE);
} else if (err == DB_DEADLOCK
- || err == DB_LOCK_TABLE_FULL) {
+ || err == DB_LOCK_TABLE_FULL
+ || (err == DB_LOCK_WAIT_TIMEOUT
+ && row_rollback_on_timeout)) {
/* Roll back the whole transaction; this resolution was added
to version 3.23.43 */
@@ -522,6 +527,10 @@ handle_new_error:
} else if (err == DB_OUT_OF_FILE_SPACE
|| err == DB_LOCK_WAIT_TIMEOUT) {
+
+ ut_ad(!(err == DB_LOCK_WAIT_TIMEOUT
+ && row_rollback_on_timeout));
+
if (savept) {
/* Roll back the latest, possibly incomplete
insertion or update */