Commit 03b9c45e authored by osku's avatar osku

Apply patch from MySQL:

 ChangeSet@1.2353, 2006-12-19 16:57:51-07:00, tsmith@siva.hindu.god +13 -0
   Added innodb_rollback_on_timeout option to restore the 4.1 
   InnoDB timeout behavior (Bug #24200)
parent 79b0e5d2
...@@ -177,6 +177,7 @@ my_bool innobase_use_large_pages = FALSE; ...@@ -177,6 +177,7 @@ my_bool innobase_use_large_pages = FALSE;
my_bool innobase_use_native_aio = FALSE; my_bool innobase_use_native_aio = FALSE;
my_bool innobase_file_per_table = FALSE; my_bool innobase_file_per_table = FALSE;
my_bool innobase_locks_unsafe_for_binlog = FALSE; my_bool innobase_locks_unsafe_for_binlog = FALSE;
my_bool innobase_rollback_on_timeout = FALSE;
my_bool innobase_create_status_file = FALSE; my_bool innobase_create_status_file = FALSE;
static char *internal_innobase_data_file_path = NULL; static char *internal_innobase_data_file_path = NULL;
...@@ -469,6 +470,10 @@ convert_error_code_to_mysql( ...@@ -469,6 +470,10 @@ convert_error_code_to_mysql(
latest SQL statement in a lock wait timeout. Previously, we latest SQL statement in a lock wait timeout. Previously, we
rolled back the whole transaction. */ rolled back the whole transaction. */
if (thd && row_rollback_on_timeout) {
ha_rollback(thd);
}
return(HA_ERR_LOCK_WAIT_TIMEOUT); return(HA_ERR_LOCK_WAIT_TIMEOUT);
} else if (error == (int) DB_NO_REFERENCED_ROW) { } else if (error == (int) DB_NO_REFERENCED_ROW) {
...@@ -1550,6 +1555,8 @@ innobase_init(void *p) ...@@ -1550,6 +1555,8 @@ innobase_init(void *p)
os_use_large_pages = (ibool) innobase_use_large_pages; os_use_large_pages = (ibool) innobase_use_large_pages;
os_large_page_size = (ulint) innobase_large_page_size; 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_file_per_table = (ibool) innobase_file_per_table;
srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog; srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog;
......
...@@ -223,6 +223,7 @@ extern my_bool innobase_log_archive, ...@@ -223,6 +223,7 @@ extern my_bool innobase_log_archive,
innobase_use_large_pages, innobase_use_large_pages,
innobase_use_native_aio, innobase_use_native_aio,
innobase_file_per_table, innobase_locks_unsafe_for_binlog, innobase_file_per_table, innobase_locks_unsafe_for_binlog,
innobase_rollback_on_timeout,
innobase_create_status_file; innobase_create_status_file;
extern "C" { extern "C" {
extern ulong srv_max_buf_pool_modified_pct; extern ulong srv_max_buf_pool_modified_pct;
......
...@@ -19,6 +19,8 @@ Created 9/17/2000 Heikki Tuuri ...@@ -19,6 +19,8 @@ Created 9/17/2000 Heikki Tuuri
#include "btr0pcur.h" #include "btr0pcur.h"
#include "trx0types.h" #include "trx0types.h"
extern ibool row_rollback_on_timeout;
typedef struct row_prebuilt_struct row_prebuilt_t; typedef struct row_prebuilt_struct row_prebuilt_t;
/*********************************************************************** /***********************************************************************
......
...@@ -35,6 +35,9 @@ Created 9/17/2000 Heikki Tuuri ...@@ -35,6 +35,9 @@ Created 9/17/2000 Heikki Tuuri
/* A dummy variable used to fool the compiler */ /* A dummy variable used to fool the compiler */
ibool row_mysql_identically_false = FALSE; 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 /* 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 that the table handler can drop the table in background when there are no
queries to it any more. Protected by the kernel mutex. */ queries to it any more. Protected by the kernel mutex. */
...@@ -496,7 +499,9 @@ row_mysql_handle_errors( ...@@ -496,7 +499,9 @@ row_mysql_handle_errors(
return(TRUE); return(TRUE);
} else if (err == DB_DEADLOCK } 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 /* Roll back the whole transaction; this resolution was added
to version 3.23.43 */ to version 3.23.43 */
...@@ -504,6 +509,10 @@ row_mysql_handle_errors( ...@@ -504,6 +509,10 @@ row_mysql_handle_errors(
} else if (err == DB_OUT_OF_FILE_SPACE } else if (err == DB_OUT_OF_FILE_SPACE
|| err == DB_LOCK_WAIT_TIMEOUT) { || err == DB_LOCK_WAIT_TIMEOUT) {
ut_ad(!(err == DB_LOCK_WAIT_TIMEOUT
&& row_rollback_on_timeout));
if (savept) { if (savept) {
/* Roll back the latest, possibly incomplete /* Roll back the latest, possibly incomplete
insertion or update */ insertion or update */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment