MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:June 1 2007 8:50am
Subject:bk commit into 4.1 tree (svoj:1.2660) BUG#28574
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of svoj. When svoj 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

ChangeSet@stripped, 2007-06-01 13:50:13+05:00, svoj@stripped +1 -0
  BUG#28574 - repair table causes queries to fail with various
              corruption errors: 126,134,145
  When one thread attempts to lock two (or more) tables and another
  thread executes statement that aborts these locks (e.g. REPAIR
  TABLE) we may get a table object with wrong lock type in a table
  For example if SELECT FROM t1,t2 was aborted, subsequent INSERT
  INTO t1 may be executed under read lock.
  As a result we may get various table corruptions and even a server
  This is fixed by resetting lock type in case lock was aborted by
  another thread.
  I failed to create reasonable test case for this bug.

  sql/, 2007-06-01 13:50:12+05:00, svoj@stripped +7 -0
    If thr_multi_lock was aborted by another thread, it unlocks tables
    that were locked before one that was aborted. Lock type for tables
    that were after a table that was aborted preserved. Thus we need
    to reset lock data in case thr_multi_lock was aborted.

# 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:	svoj
# Host:
# Root:	/home/svoj/devel/mysql/BUG28574/mysql-4.1-engines

--- 1.68/sql/	2006-12-20 19:05:34 +04:00
+++ 1.69/sql/	2007-06-01 13:50:12 +05:00
@@ -155,6 +155,13 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, 
     if (thr_multi_lock(sql_lock->locks + sql_lock->lock_count,
+      /*
+        reset_lock_data is required here. If thr_multi_lock fails it
+        resets lock type for tables, which were locked before (and
+        including) one that caused error. Lock type for other tables
+        preserved.
+      */
+      reset_lock_data(sql_lock);
       thd->some_tables_deleted=1;		// Try again
       sql_lock->lock_count=0;			// Locks are alread freed
bk commit into 4.1 tree (svoj:1.2660) BUG#28574Sergey Vojtovich1 Jun