summaryrefslogtreecommitdiff
path: root/innobase/include/lock0lock.h
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-11-30 17:34:37 +0200
committerunknown <marko@hundin.mysql.fi>2004-11-30 17:34:37 +0200
commitd6180d37be0fb11c5e1a5b9a090506e015934368 (patch)
tree0404a4610240b6bc7fb2939fc6f6ffe6494d7939 /innobase/include/lock0lock.h
parent346dce93c2a63757540ed15e660dd07d41f7f20d (diff)
downloadmariadb-git-d6180d37be0fb11c5e1a5b9a090506e015934368.tar.gz
InnoDB: Allow ALTER TABLE to do intermediate COMMIT also when the table
contains auto_increment columns. (Bug #6633) innobase/include/lock0lock.h: Replaced lock_get_table() with lock_get_src_table() and lock_is_table_exclusive() innobase/lock/lock0lock.c: Replaced lock_get_table() with lock_get_src_table() and lock_is_table_exclusive() sql/ha_innodb.cc: ha_innobase::write_row(): Improve the ALTER TABLE optimization (do intermediate COMMIT also if table contains auto_increment columns)
Diffstat (limited to 'innobase/include/lock0lock.h')
-rw-r--r--innobase/include/lock0lock.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h
index fb44acc14f7..ff5b6aae02e 100644
--- a/innobase/include/lock0lock.h
+++ b/innobase/include/lock0lock.h
@@ -463,17 +463,32 @@ lock_rec_hash(
ulint space, /* in: space */
ulint page_no);/* in: page number */
/*************************************************************************
-Gets the table covered by an IX or IS table lock, if there are no
-other locks on the table. */
+Gets the source table of an ALTER TABLE transaction. The table must be
+covered by an IX or IS table lock. */
dict_table_t*
-lock_get_table(
-/*===========*/
- /* out: the table covered by the lock,
- or NULL if it is not an IX or IS table lock,
- or there are other locks on the table */
- lock_t* lock, /* in: lock */
- ulint* mode); /* out: lock mode of table */
+lock_get_src_table(
+/*===============*/
+ /* out: the source table of transaction,
+ if it is covered by an IX or IS table lock;
+ dest if there is no source table, and
+ NULL if the transaction is locking more than
+ two tables or an inconsistency is found */
+ trx_t* trx, /* in: transaction */
+ dict_table_t* dest, /* in: destination of ALTER TABLE */
+ ulint* mode); /* out: lock mode of the source table */
+/*************************************************************************
+Determine if the given table is exclusively "owned" by the given
+transaction, i.e., transaction holds LOCK_IX and possibly LOCK_AUTO_INC
+on the table. */
+
+ibool
+lock_table_exclusive(
+/*=================*/
+ /* out: TRUE if table is only locked by trx,
+ with LOCK_IX, and possibly LOCK_AUTO_INC */
+ dict_table_t* table, /* in: table */
+ trx_t* trx); /* in: transaction */
/*************************************************************************
Checks that a transaction id is sensible, i.e., not in the future. */