Below is the list of changes that have just been committed into a local
5.0 repository of tim. When tim does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-12-19 13:09:54-07:00, tsmith@stripped +5 -0
Added innodb_rollback_on_timeout option to restore the 4.1
InnoDB timeout behavior (Bug #24200)
innobase/include/row0mysql.h@stripped, 2006-12-19 13:09:50-07:00, tsmith@stripped +2
-0
Added innodb_rollback_on_timeout option to restore the 4.1
InnoDB timeout behavior (Bug #24200)
innobase/row/row0mysql.c@stripped, 2006-12-19 13:09:50-07:00, tsmith@stripped +10 -1
Added innodb_rollback_on_timeout option to restore the 4.1
InnoDB timeout behavior (Bug #24200)
sql/ha_innodb.cc@stripped, 2006-12-19 13:09:50-07:00, tsmith@stripped +8 -1
Added innodb_rollback_on_timeout option to restore the 4.1
InnoDB timeout behavior (Bug #24200)
sql/ha_innodb.h@stripped, 2006-12-19 13:09:51-07:00, tsmith@stripped +1 -0
Added innodb_rollback_on_timeout option to restore the 4.1
InnoDB timeout behavior (Bug #24200)
sql/mysqld.cc@stripped, 2006-12-19 13:09:51-07:00, tsmith@stripped +6 -1
Added innodb_rollback_on_timeout option to restore the 4.1
InnoDB timeout behavior (Bug #24200)
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: tsmith
# Host: siva.hindu.god
# Root: /usr/home/tim/m/bk/50-24200
--- 1.582/sql/mysqld.cc 2006-12-19 13:10:02 -07:00
+++ 1.583/sql/mysqld.cc 2006-12-19 13:10:02 -07:00
@@ -4692,7 +4692,8 @@ enum options_mysqld
OPT_LOG_SLOW_ADMIN_STATEMENTS,
OPT_TABLE_LOCK_WAIT_TIMEOUT,
OPT_PORT_OPEN_TIMEOUT,
- OPT_MERGE
+ OPT_MERGE,
+ OPT_INNODB_ROLLBACK_ON_TIMEOUT
};
@@ -4968,6 +4969,10 @@ Disable with --skip-innodb-doublewrite."
(gptr*) &srv_max_purge_lag,
(gptr*) &srv_max_purge_lag, 0, GET_LONG, REQUIRED_ARG, 0, 0, ~0L,
0, 1L, 0},
+ {"innodb_rollback_on_timeout", OPT_INNODB_ROLLBACK_ON_TIMEOUT,
+ "Roll back complete transactions on timeouts for 4.x compatibility (disabled by
default)",
+ (gptr*) &innobase_rollback_on_timeout, (gptr*) &innobase_rollback_on_timeout,
+ 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"innodb_status_file", OPT_INNODB_STATUS_FILE,
"Enable SHOW INNODB STATUS output in the innodb_status.<pid> file",
(gptr*) &innobase_create_status_file, (gptr*) &innobase_create_status_file,
--- 1.46/innobase/include/row0mysql.h 2006-12-19 13:10:02 -07:00
+++ 1.47/innobase/include/row0mysql.h 2006-12-19 13:10:02 -07:00
@@ -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;
/***********************************************************************
--- 1.123/innobase/row/row0mysql.c 2006-12-19 13:10:02 -07:00
+++ 1.124/innobase/row/row0mysql.c 2006-12-19 13:10:02 -07:00
@@ -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 */
--- 1.305/sql/ha_innodb.cc 2006-12-19 13:10:02 -07:00
+++ 1.306/sql/ha_innodb.cc 2006-12-19 13:10:02 -07:00
@@ -173,6 +173,7 @@ my_bool innobase_use_large_pages = FA
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;
@@ -467,6 +468,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) {
@@ -1380,10 +1385,12 @@ innobase_init(void)
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;
-
srv_max_n_open_files = (ulint) innobase_open_files;
+
srv_innodb_status = (ibool) innobase_create_status_file;
srv_print_verbose_log = mysqld_embedded ? 0 : 1;
--- 1.113/sql/ha_innodb.h 2006-12-19 13:10:02 -07:00
+++ 1.114/sql/ha_innodb.h 2006-12-19 13:10:02 -07:00
@@ -216,6 +216,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 my_bool innobase_very_fast_shutdown; /* set this to 1 just before
calling innobase_end() if you want
| Thread |
|---|
| • bk commit into 5.0 tree (tsmith:1.2353) BUG#24200 | tim | 19 Dec |