List:Commits« Previous MessageNext Message »
From:Dmitry Lenev Date:November 11 2010 5:14am
Subject:bzr commit into mysql-5.5-runtime branch (Dmitry.Lenev:3193)
View as plain text  
#At file:///home/dlenev/src/bzr/mysql-5.5-rt-grl/ based on revid:dmitry.lenev@stripped

 3193 Dmitry Lenev	2010-11-11
      More changes to draft patch refactoring global read
      lock implementation. Makes GRL yet another type of
      metadata lock and thus exposes it to deadlock detector
      in MDL subsystem.
      
      Solves bugs #54673 "It takes too long to get readlock for
      'FLUSH TABLES WITH READ LOCK'" and #57006 "Deadlock between
      HANDLER and FLUSH TABLES WITH READ LOCK".
      
      Work-in-progress. Fixed issued discovered by RQG testing.

    modified:
      mysql-test/r/delayed.result
      mysql-test/t/delayed.test
      sql/sp_head.cc
      sql/sql_parse.cc
=== modified file 'mysql-test/r/delayed.result'
--- a/mysql-test/r/delayed.result	2010-09-16 14:06:46 +0000
+++ b/mysql-test/r/delayed.result	2010-11-11 05:14:33 +0000
@@ -418,6 +418,18 @@ COMMIT;
 UNLOCK TABLES;
 # Connection con1
 # Reaping: INSERT DELAYED INTO t1 VALUES (5)
+# Connection default
+# Test 5: LOCK TABLES + INSERT DELAYED in one connection.
+# This test has triggered some asserts in metadata locking
+# subsystem at some point in time..
+LOCK TABLE t1 WRITE;
+INSERT DELAYED INTO t2 VALUES (7);
+UNLOCK TABLES;
+SET AUTOCOMMIT= 0;
+LOCK TABLE t1 WRITE;
+INSERT DELAYED INTO t2 VALUES (8);
+UNLOCK TABLES;
+SET AUTOCOMMIT= 1;
 # Connection con2
 # Connection con1
 # Connection default

=== modified file 'mysql-test/t/delayed.test'
--- a/mysql-test/t/delayed.test	2010-09-16 14:06:46 +0000
+++ b/mysql-test/t/delayed.test	2010-11-11 05:14:33 +0000
@@ -539,6 +539,21 @@ connection con1;
 --echo # Reaping: INSERT DELAYED INTO t1 VALUES (5)
 --reap
 
+--echo # Connection default
+connection default;
+
+--echo # Test 5: LOCK TABLES + INSERT DELAYED in one connection.
+--echo # This test has triggered some asserts in metadata locking
+--echo # subsystem at some point in time..
+LOCK TABLE t1 WRITE;
+INSERT DELAYED INTO t2 VALUES (7);
+UNLOCK TABLES;
+SET AUTOCOMMIT= 0;
+LOCK TABLE t1 WRITE;
+INSERT DELAYED INTO t2 VALUES (8);
+UNLOCK TABLES;
+SET AUTOCOMMIT= 1;
+
 --echo # Connection con2
 connection con2;
 disconnect con2;

=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc	2010-11-03 18:09:02 +0000
+++ b/sql/sp_head.cc	2010-11-11 05:14:33 +0000
@@ -2140,11 +2140,8 @@ sp_head::execute_procedure(THD *thd, Lis
 
     if (! thd->in_sub_stmt && ! thd->in_multi_stmt_transaction_mode())
       thd->mdl_context.release_transactional_locks();
-    else if (! thd->locked_tables_mode)
-    {
-      DBUG_ASSERT(! thd->in_sub_stmt);
+    else if (! thd->in_sub_stmt)
       thd->mdl_context.release_statement_locks();
-    }
 
     thd->rollback_item_tree_changes();
 
@@ -2983,7 +2980,7 @@ sp_lex_keeper::reset_lex_and_exec_core(T
 
     if (! thd->in_sub_stmt && ! thd->in_multi_stmt_transaction_mode())
       thd->mdl_context.release_transactional_locks();
-    else if (! thd->in_sub_stmt && !thd->locked_tables_mode)
+    else if (! thd->in_sub_stmt)
       thd->mdl_context.release_statement_locks();
   }
 

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2010-11-08 14:10:47 +0000
+++ b/sql/sql_parse.cc	2010-11-11 05:14:33 +0000
@@ -4390,7 +4390,7 @@ finish:
     */
     thd->mdl_context.release_transactional_locks();
   }
-  else if (! thd->in_sub_stmt && !thd->locked_tables_mode)
+  else if (! thd->in_sub_stmt)
   {
     thd->mdl_context.release_statement_locks();
   }


Attachment: [text/bzr-bundle] bzr/dmitry.lenev@oracle.com-20101111051433-qfow30wn7bb9jdqx.bundle
Thread
bzr commit into mysql-5.5-runtime branch (Dmitry.Lenev:3193) Dmitry Lenev11 Nov