summaryrefslogtreecommitdiff
path: root/innobase/include
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-07-12 16:47:22 +0300
committerunknown <marko@hundin.mysql.fi>2004-07-12 16:47:22 +0300
commitfbc420ba0ee7bcd951a44aefff4c771578bc9ac2 (patch)
tree52a0ac716061edce542e60cd3d8171e9d7589c25 /innobase/include
parent7b6fc58ffff432df623d78511eab7e19ddb32f50 (diff)
downloadmariadb-git-fbc420ba0ee7bcd951a44aefff4c771578bc9ac2.tar.gz
InnoDB: LOCK TABLE clean-up
innobase/include/lock0lock.h: Improve comments regarding LOCK_TABLE_EXP innobase/include/row0mysql.h: Rename row_unlock_table_for_mysql() to row_unlock_tables_for_mysql() and improve its comment innobase/include/trx0trx.h: Rename n_tables_locked to n_lock_table_exp innobase/lock/lock0lock.c: Rename n_tables_locked to n_lock_table_exp Increment n_lock_table_exp already in lock_table_create() Replace some ut_ad() assertions with ut_a() innobase/row/row0mysql.c: Rename n_tables_locked to n_lock_table_exp Rename row_unlock_table_for_mysql() to row_unlock_tables_for_mysql() and improve its comment innobase/trx/trx0trx.c: Rename n_tables_locked to n_lock_table_exp sql/ha_innodb.cc: Rename n_tables_locked to n_lock_table_exp Rename row_unlock_table_for_mysql() to row_unlock_tables_for_mysql()
Diffstat (limited to 'innobase/include')
-rw-r--r--innobase/include/lock0lock.h5
-rw-r--r--innobase/include/row0mysql.h7
-rw-r--r--innobase/include/trx0trx.h5
3 files changed, 10 insertions, 7 deletions
diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h
index 9c5f35c6674..9f525042dcc 100644
--- a/innobase/include/lock0lock.h
+++ b/innobase/include/lock0lock.h
@@ -418,7 +418,8 @@ lock_release_off_kernel(
/*====================*/
trx_t* trx); /* in: transaction */
/*************************************************************************
-Releases table locks, and releases possible other transactions waiting
+Releases table locks explicitly requested with LOCK TABLES (indicated by
+lock type LOCK_TABLE_EXP), and releases possible other transactions waiting
because of these locks. */
void
@@ -548,7 +549,7 @@ extern lock_sys_t* lock_sys;
/* Lock types */
#define LOCK_TABLE 16 /* these type values should be so high that */
#define LOCK_REC 32 /* they can be ORed to the lock mode */
-#define LOCK_TABLE_EXP 80 /* explicit table lock */
+#define LOCK_TABLE_EXP 80 /* explicit table lock (80 = 16 + 64) */
#define LOCK_TYPE_MASK 0xF0UL /* mask used to extract lock type from the
type_mode field in a lock */
/* Waiting lock flag */
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index e088071a1c4..0ab70db2dea 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -153,11 +153,12 @@ row_lock_table_autoinc_for_mysql(
row_prebuilt_t* prebuilt); /* in: prebuilt struct in the MySQL
table handle */
/*************************************************************************
-Unlocks a table lock possibly reserved by trx. */
+Unlocks all table locks explicitly requested by trx (with LOCK TABLES,
+lock type LOCK_TABLE_EXP). */
void
-row_unlock_table_for_mysql(
-/*=======================*/
+row_unlock_tables_for_mysql(
+/*========================*/
trx_t* trx); /* in: transaction */
/*************************************************************************
Sets a table lock on the table mentioned in prebuilt. */
diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h
index 07d5e5a8215..3be16e8f46d 100644
--- a/innobase/include/trx0trx.h
+++ b/innobase/include/trx0trx.h
@@ -423,8 +423,9 @@ struct trx_struct{
lock_t* auto_inc_lock; /* possible auto-inc lock reserved by
the transaction; note that it is also
in the lock list trx_locks */
- ulint n_tables_locked;/* number of table locks reserved by
- the transaction, stored in trx_locks */
+ ulint n_lock_table_exp;/* number of explicit table locks
+ (LOCK TABLES) reserved by the
+ transaction, stored in trx_locks */
UT_LIST_NODE_T(trx_t)
trx_list; /* list of transactions */
UT_LIST_NODE_T(trx_t)