List:Commits« Previous MessageNext Message »
From:'Hartmut Holzgraefe' Date:November 10 2006 7:03pm
Subject:bk commit into 5.0 tree (hartmut:1.2297) BUG#24200
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of hartmut. When hartmut 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-11-10 20:03:38+01:00, hartmut@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-11-10 20:03:34+01:00, hartmut@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-11-10 20:03:34+01:00, hartmut@stripped +6 -2
    Added innodb_rollback_on_timeout option to restore the 4.1 
    InnoDB timeout behavior (Bug #24200)

  sql/ha_innodb.cc@stripped, 2006-11-10 20:03:34+01:00, hartmut@stripped +4 -0
    Added innodb_rollback_on_timeout option to restore the 4.1 
    InnoDB timeout behavior (Bug #24200)

  sql/ha_innodb.h@stripped, 2006-11-10 20:03:35+01:00, hartmut@stripped +2 -1
    Added innodb_rollback_on_timeout option to restore the 4.1 
    InnoDB timeout behavior (Bug #24200)

  sql/mysqld.cc@stripped, 2006-11-10 20:03:35+01:00, hartmut@stripped +7 -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:	hartmut
# Host:	linux.site
# Root:	/home/hartmut/projects/mysql/dev/5.0

--- 1.578/sql/mysqld.cc	2006-11-10 20:03:46 +01:00
+++ 1.579/sql/mysqld.cc	2006-11-10 20:03:46 +01:00
@@ -4675,7 +4675,8 @@
   OPT_LOG_SLOW_ADMIN_STATEMENTS,
   OPT_TABLE_LOCK_WAIT_TIMEOUT,
   OPT_PORT_OPEN_TIMEOUT,
-  OPT_MERGE
+  OPT_MERGE,
+  OPT_INNODB_ROLLBACK_ON_TIMEOUT
 };
 
 
@@ -4950,6 +4951,11 @@
    "Desired maximum length of the purge queue (0 = no limit)",
    (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,
+   "Whether to roll back complete transactions on timeouts (0 = no, 1 = yes, 4.x behavior)",
+   (gptr*) &row_rollback_on_timeout,
+   (gptr*) &row_rollback_on_timeout, 0, GET_LONG, REQUIRED_ARG, 0, 0, ~0L,
    0, 1L, 0},
   {"innodb_status_file", OPT_INNODB_STATUS_FILE,
    "Enable SHOW INNODB STATUS output in the innodb_status.<pid> file",

--- 1.46/innobase/include/row0mysql.h	2006-11-10 20:03:46 +01:00
+++ 1.47/innobase/include/row0mysql.h	2006-11-10 20:03:46 +01:00
@@ -19,6 +19,8 @@
 #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-11-10 20:03:46 +01:00
+++ 1.124/innobase/row/row0mysql.c	2006-11-10 20:03:46 +01:00
@@ -35,6 +35,9 @@
 /* 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,14 +517,15 @@
 		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 */
 
 		trx_general_rollback_for_mysql(trx, FALSE, NULL);
 				
 	} else if (err == DB_OUT_OF_FILE_SPACE
-		   || err == DB_LOCK_WAIT_TIMEOUT) {
+			   || (err == DB_LOCK_WAIT_TIMEOUT && !row_rollback_on_timeout)) {
            	if (savept) {
 			/* Roll back the latest, possibly incomplete
 			insertion or update */

--- 1.302/sql/ha_innodb.cc	2006-11-10 20:03:46 +01:00
+++ 1.303/sql/ha_innodb.cc	2006-11-10 20:03:46 +01:00
@@ -467,6 +467,10 @@
 		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) {

--- 1.113/sql/ha_innodb.h	2006-11-10 20:03:46 +01:00
+++ 1.114/sql/ha_innodb.h	2006-11-10 20:03:46 +01:00
@@ -216,7 +216,7 @@
                innobase_use_large_pages,
                innobase_use_native_aio,
 	       innobase_file_per_table, innobase_locks_unsafe_for_binlog,
-               innobase_create_status_file;
+  innobase_create_status_file;
 extern my_bool innobase_very_fast_shutdown; /* set this to 1 just before
 					    calling innobase_end() if you want
 					    InnoDB to shut down without
@@ -232,6 +232,7 @@
 extern ulong srv_thread_concurrency;
 extern ulong srv_commit_concurrency;
 extern ulong srv_flush_log_at_trx_commit;
+extern ulong row_rollback_on_timeout;
 }
 
 bool innobase_init(void);
Thread
bk commit into 5.0 tree (hartmut:1.2297) BUG#24200'Hartmut Holzgraefe'10 Nov