List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:November 19 2010 12:35pm
Subject:bzr push into mysql-trunk-bugfixing branch (tor.didriksen:3364 to 3365)
View as plain text  
 3365 Tor Didriksen	2010-11-19
      Fix failing unit test after MDL interface change.

    modified:
      sql/mdl.cc
      unittest/gunit/mdl-t.cc
      unittest/gunit/mdl_mytap-t.cc
 3364 Bjorn Munch	2010-11-19 [merge]
      upmerge compilation warning fix

    modified:
      client/mysqltest.cc
=== modified file 'sql/mdl.cc'
--- a/sql/mdl.cc	2010-11-18 16:34:56 +0000
+++ b/sql/mdl.cc	2010-11-19 12:34:44 +0000
@@ -753,9 +753,9 @@ MDL_context::MDL_context()
 
 void MDL_context::destroy()
 {
-  DBUG_ASSERT(m_tickets[MDL_STATEMENT].is_empty() &&
-              m_tickets[MDL_TRANSACTION].is_empty() &&
-              m_tickets[MDL_EXPLICIT].is_empty());
+  DBUG_ASSERT(m_tickets[MDL_STATEMENT].is_empty());
+  DBUG_ASSERT(m_tickets[MDL_TRANSACTION].is_empty());
+  DBUG_ASSERT(m_tickets[MDL_EXPLICIT].is_empty());
 
   mysql_prlock_destroy(&m_LOCK_waiting_for);
 }

=== modified file 'unittest/gunit/mdl-t.cc'
--- a/unittest/gunit/mdl-t.cc	2010-11-18 16:34:56 +0000
+++ b/unittest/gunit/mdl-t.cc	2010-11-19 12:34:44 +0000
@@ -292,8 +292,9 @@ TEST_F(MDL_DeathTest, die_when_m_tickets
                  MDL_TRANSACTION);
 
   EXPECT_FALSE(m_mdl_context.try_acquire_lock(&m_request));
-  EXPECT_DEATH(m_mdl_context.destroy(), ".*Assertion .*m_tickets.is_empty.*");
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
+  EXPECT_DEATH(m_mdl_context.destroy(),
+               ".*Assertion.*MDL_TRANSACTION.*is_empty.*");
+  m_mdl_context.release_transactional_locks();
 }
 #endif  // GTEST_HAS_DEATH_TEST && !defined(DBUG_OFF)
 
@@ -326,7 +327,7 @@ void MDL_test::test_one_simple_shared_lo
   EXPECT_FALSE(m_mdl_context.try_acquire_lock(&request_2));
   EXPECT_EQ(m_request.ticket, request_2.ticket);
 
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
+  m_mdl_context.release_transactional_locks();
   EXPECT_FALSE(m_mdl_context.has_locks());
 }
 
@@ -391,8 +392,7 @@ TEST_F(MDL_test, one_exclusive)
               is_lock_owner(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE));
   EXPECT_TRUE(m_request.ticket->is_upgradable_or_exclusive());
 
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
-  m_mdl_context.release_lock(m_global_request.ticket);
+  m_mdl_context.release_transactional_locks();
   EXPECT_FALSE(m_mdl_context.has_locks());
 }
 
@@ -404,10 +404,8 @@ TEST_F(MDL_test, one_exclusive)
 TEST_F(MDL_test, two_shared)
 {
   MDL_request request_2;
-  m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED,
-                 MDL_TRANSACTION);
-  request_2.init(MDL_key::TABLE, db_name, table_name2, MDL_SHARED,
-                 MDL_TRANSACTION);
+  m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED, MDL_EXPLICIT);
+  request_2.init(MDL_key::TABLE, db_name, table_name2, MDL_SHARED, MDL_EXPLICIT);
 
   EXPECT_FALSE(m_mdl_context.try_acquire_lock(&m_request));
   EXPECT_FALSE(m_mdl_context.try_acquire_lock(&request_2));
@@ -457,8 +455,8 @@ TEST_F(MDL_test, shared_locks_between_co
   EXPECT_TRUE(mdl_context2.
               is_lock_owner(MDL_key::TABLE, db_name, table_name1, MDL_SHARED));
 
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
-  mdl_context2.release_all_locks_for_name(request_2.ticket);
+  m_mdl_context.release_transactional_locks();
+  mdl_context2.release_transactional_locks();
 }
 
 
@@ -483,8 +481,7 @@ TEST_F(MDL_test, upgrade_shared_upgradab
                upgrade_shared_lock_to_exclusive(m_request.ticket, long_timeout));
   EXPECT_EQ(MDL_EXCLUSIVE, m_request.ticket->get_type());
 
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
-  m_mdl_context.release_lock(m_global_request.ticket);
+  m_mdl_context.release_transactional_locks();
 }
 
 
@@ -589,7 +586,7 @@ TEST_F(MDL_test, concurrent_shared)
   release_locks.notify();
   mdl_thread.join();
 
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
+  m_mdl_context.release_transactional_locks();
 }
 
 
@@ -627,8 +624,7 @@ TEST_F(MDL_test, concurrent_shared_exclu
   EXPECT_FALSE(m_mdl_context.acquire_locks(&m_request_list, zero_timeout));
   EXPECT_NE(m_null_ticket, m_request.ticket);
 
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
-  m_mdl_context.release_lock(m_global_request.ticket);
+  m_mdl_context.release_transactional_locks();
 }
 
 
@@ -659,7 +655,7 @@ TEST_F(MDL_test, concurrent_exclusive_sh
   EXPECT_NE(m_null_ticket, m_request.ticket);
 
   mdl_thread.join();
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
+  m_mdl_context.release_transactional_locks();
 }
 
 

=== modified file 'unittest/gunit/mdl_mytap-t.cc'
--- a/unittest/gunit/mdl_mytap-t.cc	2010-11-18 16:34:56 +0000
+++ b/unittest/gunit/mdl_mytap-t.cc	2010-11-19 12:34:44 +0000
@@ -248,7 +248,6 @@ protected:
   void die_when_m_tickets_nonempty();
   void die_when_holding_global_shared_lock();
   void construct_and_destruct();
-  void factory_function();
   void one_shared();
   void one_shared_high_prio();
   void one_shared_read();
@@ -394,7 +393,7 @@ void MDL_test::test_one_simple_shared_lo
   EXPECT_FALSE(m_mdl_context.try_acquire_lock(&request_2));
   EXPECT_EQ(m_request.ticket, request_2.ticket);
 
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
+  m_mdl_context.release_transactional_locks();
   EXPECT_FALSE(m_mdl_context.has_locks());
 }
 
@@ -459,8 +458,7 @@ TEST_F(MDL_test, one_exclusive)
               is_lock_owner(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE));
   EXPECT_TRUE(m_request.ticket->is_upgradable_or_exclusive());
 
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
-  m_mdl_context.release_lock(m_global_request.ticket);
+  m_mdl_context.release_transactional_locks();
   EXPECT_FALSE(m_mdl_context.has_locks());
 }
 
@@ -472,10 +470,8 @@ TEST_F(MDL_test, one_exclusive)
 TEST_F(MDL_test, two_shared)
 {
   MDL_request request_2;
-  m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED,
-                 MDL_TRANSACTION);
-  request_2.init(MDL_key::TABLE, db_name, table_name2, MDL_SHARED,
-                 MDL_TRANSACTION);
+  m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED, MDL_EXPLICIT);
+  request_2.init(MDL_key::TABLE, db_name, table_name2, MDL_SHARED, MDL_EXPLICIT);
 
   EXPECT_FALSE(m_mdl_context.try_acquire_lock(&m_request));
   EXPECT_FALSE(m_mdl_context.try_acquire_lock(&request_2));
@@ -525,8 +521,8 @@ TEST_F(MDL_test, shared_locks_between_co
   EXPECT_TRUE(mdl_context2.
               is_lock_owner(MDL_key::TABLE, db_name, table_name1, MDL_SHARED));
 
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
-  mdl_context2.release_all_locks_for_name(request_2.ticket);
+  m_mdl_context.release_transactional_locks();
+  mdl_context2.release_transactional_locks();
 }
 
 
@@ -551,8 +547,7 @@ TEST_F(MDL_test, upgrade_shared_upgradab
                upgrade_shared_lock_to_exclusive(m_request.ticket, long_timeout));
   EXPECT_EQ(MDL_EXCLUSIVE, m_request.ticket->get_type());
 
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
-  m_mdl_context.release_lock(m_global_request.ticket);
+  m_mdl_context.release_transactional_locks();
 }
 
 
@@ -657,7 +652,7 @@ TEST_F(MDL_test, concurrent_shared)
   release_locks.notify();
   mdl_thread.join();
 
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
+  m_mdl_context.release_transactional_locks();
 }
 
 
@@ -695,8 +690,7 @@ TEST_F(MDL_test, concurrent_shared_exclu
   EXPECT_FALSE(m_mdl_context.acquire_locks(&m_request_list, zero_timeout));
   EXPECT_NE(m_null_ticket, m_request.ticket);
 
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
-  m_mdl_context.release_lock(m_global_request.ticket);
+  m_mdl_context.release_transactional_locks();
 }
 
 
@@ -727,7 +721,7 @@ TEST_F(MDL_test, concurrent_exclusive_sh
   EXPECT_NE(m_null_ticket, m_request.ticket);
 
   mdl_thread.join();
-  m_mdl_context.release_all_locks_for_name(m_request.ticket);
+  m_mdl_context.release_transactional_locks();
 }
 
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-bugfixing branch (tor.didriksen:3364 to 3365) Tor Didriksen19 Nov