List:Commits« Previous MessageNext Message »
From:Sunny Bains Date:June 11 2010 1:41am
Subject:bzr commit into mysql-5.6-sunny branch (Sunny.Bains:3143)
View as plain text  
#At file:///Users/sunny/innodb/bzr-new/5.6/ based on revid:sunny.bains@stripped

 3143 Sunny Bains	2010-06-11
      Rename row_unlock_table_autoinc_for_mysql to lock_unlock_table_autoinc_for_mysql.
      Move the function to lock0lock.c, we want to keep the lock mutex enter/exit 
      within lock0*.c files (unless it is very difficult). The I_S code probably
      qualifies as an exception.

    modified:
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/lock0lock.h
      storage/innobase/include/row0mysql.h
      storage/innobase/lock/lock0lock.c
      storage/innobase/row/row0mysql.c
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	revid:sunny.bains@stripped
+++ b/storage/innobase/handler/ha_innodb.cc	revid:sunny.bains@stripped
@@ -2740,7 +2740,7 @@ retry:
 		/* If we had reserved the auto-inc lock for some
 		table in this SQL statement we release it now */
 
-		row_unlock_table_autoinc_for_mysql(trx);
+		lock_unlock_table_autoinc_for_mysql(trx);
 
 		/* Store the current undo_no of the transaction so that we
 		know where to roll back if we have to roll back the next
@@ -2798,7 +2798,7 @@ innobase_rollback(
 	we come here to roll back the latest SQL statement) we
 	release it now before a possibly lengthy rollback */
 
-	row_unlock_table_autoinc_for_mysql(trx);
+	lock_unlock_table_autoinc_for_mysql(trx);
 
 	if (all
 		|| !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
@@ -2836,7 +2836,7 @@ innobase_rollback_trx(
 	we come here to roll back the latest SQL statement) we
 	release it now before a possibly lengthy rollback */
 
-	row_unlock_table_autoinc_for_mysql(trx);
+	lock_unlock_table_autoinc_for_mysql(trx);
 
 	error = trx_rollback_for_mysql(trx);
 
@@ -9987,7 +9987,7 @@ innobase_xa_prepare(
 		/* If we had reserved the auto-inc lock for some
 		table in this SQL statement we release it now */
 
-		row_unlock_table_autoinc_for_mysql(trx);
+		lock_unlock_table_autoinc_for_mysql(trx);
 
 		/* Store the current undo_no of the transaction so that we
 		know where to roll back if we have to roll back the next

=== modified file 'storage/innobase/include/lock0lock.h'
--- a/storage/innobase/include/lock0lock.h	revid:sunny.bains@stripped
+++ b/storage/innobase/include/lock0lock.h	revid:sunny.bains@stripped
@@ -783,6 +783,15 @@ lock_wait_suspend_thread(
 /*=====================*/
 	que_thr_t*	thr);	/*!< in: query thread associated with the
 				user OS thread */
+/*********************************************************************//**
+Unlocks AUTO_INC type locks that were possibly reserved by a trx. This
+function should be called at the the end of an SQL statement, by the
+connection thread that owns the transaction (trx->mysql_thd). */
+UNIV_INTERN
+void
+lock_unlock_table_autoinc_for_mysql(
+/*===============================*/
+	trx_t*	trx);			/*!< in/out: transaction */
 /** Lock modes and types */
 /* @{ */
 #define LOCK_MODE_MASK	0xFUL	/*!< mask used to extract mode from the

=== modified file 'storage/innobase/include/row0mysql.h'
--- a/storage/innobase/include/row0mysql.h	revid:sunny.bains@stripped
+++ b/storage/innobase/include/row0mysql.h	revid:sunny.bains@stripped
@@ -177,15 +177,6 @@ row_update_prebuilt_trx(
 					in MySQL handle */
 	trx_t*		trx);		/*!< in: transaction handle */
 /*********************************************************************//**
-Unlocks AUTO_INC type locks that were possibly reserved by a trx. This
-function should be called at the the end of an SQL statement, by the
-connection thread that owns the transaction (trx->mysql_thd). */
-UNIV_INTERN
-void
-row_unlock_table_autoinc_for_mysql(
-/*===============================*/
-	trx_t*	trx);			/*!< in/out: transaction */
-/*********************************************************************//**
 Sets an AUTO_INC type lock on the table mentioned in prebuilt. The
 AUTO_INC lock gives exclusive access to the auto-inc counter of the
 table. The lock is reserved only for the duration of an SQL statement.

=== modified file 'storage/innobase/lock/lock0lock.c'
--- a/storage/innobase/lock/lock0lock.c	revid:sunny.bains@stripped
+++ b/storage/innobase/lock/lock0lock.c	revid:sunny.bains@stripped
@@ -5878,3 +5878,24 @@ lock_cancel_waiting_and_release(
 		lock_wait_release_thread_if_suspended(thr);
 	}
 }
+
+
+/*********************************************************************//**
+Unlocks AUTO_INC type locks that were possibly reserved by a trx. This
+function should be called at the the end of an SQL statement, by the
+connection thread that owns the transaction (trx->mysql_thd). */
+UNIV_INTERN
+void
+lock_unlock_table_autoinc(
+/*======================*/
+	trx_t*	trx)	/*!< in/out: transaction */
+{
+	if (lock_trx_holds_autoinc_locks(trx)) {
+		lock_mutex_enter();
+
+		lock_release_autoinc_locks(trx);
+
+		lock_mutex_exit();
+	}
+}
+

=== modified file 'storage/innobase/row/row0mysql.c'
--- a/storage/innobase/row/row0mysql.c	revid:sunny.bains@stripped
+++ b/storage/innobase/row/row0mysql.c	revid:sunny.bains@stripped
@@ -878,25 +878,6 @@ row_update_statistics_if_needed(
 }
 
 /*********************************************************************//**
-Unlocks AUTO_INC type locks that were possibly reserved by a trx. This
-function should be called at the the end of an SQL statement, by the
-connection thread that owns the transaction (trx->mysql_thd). */
-UNIV_INTERN
-void
-row_unlock_table_autoinc_for_mysql(
-/*===============================*/
-	trx_t*	trx)	/*!< in/out: transaction */
-{
-	if (lock_trx_holds_autoinc_locks(trx)) {
-		lock_mutex_enter();
-
-		lock_release_autoinc_locks(trx);
-
-		lock_mutex_exit();
-	}
-}
-
-/*********************************************************************//**
 Sets an AUTO_INC type lock on the table mentioned in prebuilt. The
 AUTO_INC lock gives exclusive access to the auto-inc counter of the
 table. The lock is reserved only for the duration of an SQL statement.


Attachment: [text/bzr-bundle] bzr/sunny.bains@oracle.com-20100611013923-3ngdv6y88a81fyt0.bundle
Thread
bzr commit into mysql-5.6-sunny branch (Sunny.Bains:3143) Sunny Bains11 Jun