diff options
author | unknown <patg@radha.patg.net> | 2006-12-22 08:57:32 -0500 |
---|---|---|
committer | unknown <patg@radha.patg.net> | 2006-12-22 08:57:32 -0500 |
commit | 8a1ff42fe0fa5514ba6d28408215a54bc4ed5e9d (patch) | |
tree | 9ae09ecf78b4d6982791b9fd82361130b93404ec /storage/innobase | |
parent | 8f3e39bd4985cd6cde244c6a2eb27950ade33585 (diff) | |
parent | b95a067685ed8f902e0f92f89c16a374c9214980 (diff) | |
download | mariadb-git-8a1ff42fe0fa5514ba6d28408215a54bc4ed5e9d.tar.gz |
Merge pgalbraith@bk-internal.mysql.com:/home/bk/mysql-5.1
into radha.patg.net:/Users/patg/mysql-build/mysql-5.1-arch-merge
mysql-test/t/disabled.def:
Auto merged
sql/mysqld.cc:
Auto merged
storage/innobase/handler/ha_innodb.cc:
Auto merged
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 7 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.h | 1 | ||||
-rw-r--r-- | storage/innobase/include/row0mysql.h | 2 | ||||
-rw-r--r-- | storage/innobase/row/row0mysql.c | 11 |
4 files changed, 20 insertions, 1 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 488f811d3bf..400b25001b5 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -181,6 +181,7 @@ my_bool innobase_use_large_pages = FALSE; my_bool innobase_use_native_aio = FALSE; my_bool innobase_file_per_table = FALSE; my_bool innobase_locks_unsafe_for_binlog = FALSE; +my_bool innobase_rollback_on_timeout = FALSE; my_bool innobase_create_status_file = FALSE; static char *internal_innobase_data_file_path = NULL; @@ -473,6 +474,10 @@ convert_error_code_to_mysql( latest SQL statement in a lock wait timeout. Previously, we rolled back the whole transaction. */ + if (thd && row_rollback_on_timeout) { + ha_rollback(thd); + } + return(HA_ERR_LOCK_WAIT_TIMEOUT); } else if (error == (int) DB_NO_REFERENCED_ROW) { @@ -1566,6 +1571,8 @@ innobase_init(void *p) os_use_large_pages = (ibool) innobase_use_large_pages; os_large_page_size = (ulint) innobase_large_page_size; + row_rollback_on_timeout = (ibool) innobase_rollback_on_timeout; + srv_file_per_table = (ibool) innobase_file_per_table; srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog; diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index ea1cf7a32af..500fa8f2310 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -224,6 +224,7 @@ extern my_bool innobase_log_archive, innobase_use_large_pages, innobase_use_native_aio, innobase_file_per_table, innobase_locks_unsafe_for_binlog, + innobase_rollback_on_timeout, innobase_create_status_file; extern "C" { extern ulong srv_max_buf_pool_modified_pct; diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index be285037767..1448efe94fe 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/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/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index 41a468e5026..6779f536daa 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/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. */ @@ -496,7 +499,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 */ @@ -504,6 +509,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 */ |