List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:August 21 2007 4:11am
Subject:bk commit into 5.0 tree (davi:1.2498) BUG#25164
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of davi. When davi 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, 2007-08-20 23:11:08-03:00, davi@stripped +1 -0
  Bug#25164 create table `a` as select * from `A` hangs
  
  If the thr_multi_lock() detects a deadlock (or timeouts), the table handler (storage
engine) lock must be unlocked. As the function comment indicates: each call to
external_lock(F_[RD|WR]LOCK) is followed by a call to external_lock(F_UNLCK) and if it is
not, it is a bug in MySQL.

  sql/lock.cc@stripped, 2007-08-20 23:11:04-03:00, davi@stripped +2 -0
    Unlock the table handler if it fails to acquire the thread lock.

diff -Nrup a/sql/lock.cc b/sql/lock.cc
--- a/sql/lock.cc	2007-08-16 14:51:30 -03:00
+++ b/sql/lock.cc	2007-08-20 23:11:04 -03:00
@@ -172,6 +172,8 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, 
                                                      thd->lock_id)];
     if (rc > 1)                                 /* a timeout or a deadlock */
     {
+      if (sql_lock->table_count)
+        VOID(unlock_external(thd, sql_lock->table, sql_lock->table_count));
       my_error(rc, MYF(0));
       my_free((gptr) sql_lock,MYF(0));
       sql_lock= 0;
Thread
bk commit into 5.0 tree (davi:1.2498) BUG#25164Davi Arnaut21 Aug
  • Re: bk commit into 5.0 tree (davi:1.2498) BUG#25164Konstantin Osipov23 Aug