summaryrefslogtreecommitdiff
path: root/innobase/include/lock0lock.h
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-12-10 12:55:56 +0200
committerunknown <marko@hundin.mysql.fi>2004-12-10 12:55:56 +0200
commit0404a607a569bf9797b79dd9fb74832789de9479 (patch)
treeca1ad05c68ab42c158c86b1961ebd106baa43f8b /innobase/include/lock0lock.h
parenteed234377556647cea2810ed6802715c153a9fff (diff)
downloadmariadb-git-0404a607a569bf9797b79dd9fb74832789de9479.tar.gz
InnoDB: Reduce the stack space consumption of ON UPDATE CASCADE
operations. innobase/include/lock0lock.h: Added lock_clust_rec_read_check_and_lock_alt(), a variant of lock_clust_rec_read_check_and_lock() without the parameter "offsets". innobase/lock/lock0lock.c: Added lock_clust_rec_read_check_and_lock_alt(), a variant of lock_clust_rec_read_check_and_lock() without the parameter "offsets". innobase/row/row0ins.c: row_ins_foreign_check_on_constraint(): Do not allocate offsets from stack. This reduces the stack space consumption of ON UPDATE CASCADE operations by 400 bytes per cascaded UPDATE operation.
Diffstat (limited to 'innobase/include/lock0lock.h')
-rw-r--r--innobase/include/lock0lock.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h
index b99359fe998..e533ac08545 100644
--- a/innobase/include/lock0lock.h
+++ b/innobase/include/lock0lock.h
@@ -345,6 +345,33 @@ lock_clust_rec_read_check_and_lock(
LOCK_REC_NOT_GAP */
que_thr_t* thr); /* in: query thread */
/*************************************************************************
+Checks if locks of other transactions prevent an immediate read, or passing
+over by a read cursor, of a clustered index record. If they do, first tests
+if the query thread should anyway be suspended for some reason; if not, then
+puts the transaction and the query thread to the lock wait state and inserts a
+waiting request for a record lock to the lock queue. Sets the requested mode
+lock on the record. This is an alternative version of
+lock_clust_rec_read_check_and_lock() that does not require the parameter
+"offsets". */
+
+ulint
+lock_clust_rec_read_check_and_lock_alt(
+/*===================================*/
+ /* out: DB_SUCCESS, DB_LOCK_WAIT,
+ DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
+ ulint flags, /* in: if BTR_NO_LOCKING_FLAG bit is set,
+ does nothing */
+ rec_t* rec, /* in: user record or page supremum record
+ which should be read or passed over by a read
+ cursor */
+ dict_index_t* index, /* in: clustered index */
+ ulint mode, /* in: mode of the lock which the read cursor
+ should set on records: LOCK_S or LOCK_X; the
+ latter is possible in SELECT FOR UPDATE */
+ ulint gap_mode,/* in: LOCK_ORDINARY, LOCK_GAP, or
+ LOCK_REC_NOT_GAP */
+ que_thr_t* thr); /* in: query thread */
+/*************************************************************************
Checks that a record is seen in a consistent read. */
ibool