summaryrefslogtreecommitdiff
path: root/innobase/lock
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-04-22 15:15:18 +0300
committerunknown <marko@hundin.mysql.fi>2005-04-22 15:15:18 +0300
commit33d5b13bbebcfc3657a7b8cc10eec10f73d44d71 (patch)
treea65e358729e6f1e701274a34709b910b114ee25b /innobase/lock
parent98dc4142b206ea3fcf1d7b4bd127baef1aeac2d4 (diff)
downloadmariadb-git-33d5b13bbebcfc3657a7b8cc10eec10f73d44d71.tar.gz
row0upd.c:
Add UNIV_UNLIKELY hint. lock0lock.c: Correct the prototypes of lock_deadlock_recursive() and lock_deadlock_occurs(). data0data.c: dtuple_convert_big_rec(): Add UNIV_UNLIKELY hint. ha_innodb.cc: ha_innobase::write_row(): Correct the type of 'mode'. sql/ha_innodb.cc: ha_innobase::write_row(): Correct the type of 'mode'. innobase/data/data0data.c: dtuple_convert_big_rec(): Add UNIV_UNLIKELY hint. innobase/lock/lock0lock.c: Correct the prototypes of lock_deadlock_recursive() and lock_deadlock_occurs(). innobase/row/row0upd.c: Add UNIV_UNLIKELY hint.
Diffstat (limited to 'innobase/lock')
-rw-r--r--innobase/lock/lock0lock.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c
index 4a69c718abb..650552be366 100644
--- a/innobase/lock/lock0lock.c
+++ b/innobase/lock/lock0lock.c
@@ -348,17 +348,26 @@ static
ibool
lock_deadlock_occurs(
/*=================*/
- /* out: TRUE if a deadlock was detected */
+ /* out: TRUE if a deadlock was detected and we
+ chose trx as a victim; FALSE if no deadlock, or
+ there was a deadlock, but we chose other
+ transaction(s) as victim(s) */
lock_t* lock, /* in: lock the transaction is requesting */
trx_t* trx); /* in: transaction */
/************************************************************************
Looks recursively for a deadlock. */
static
-ibool
+ulint
lock_deadlock_recursive(
/*====================*/
- /* out: TRUE if a deadlock was detected
- or the calculation took too long */
+ /* out: 0 if no deadlock found,
+ LOCK_VICTIM_IS_START if there was a deadlock
+ and we chose 'start' as the victim,
+ LOCK_VICTIM_IS_OTHER if a deadlock
+ was found and we chose some other trx as a
+ victim: we must do the search again in this
+ last case because there may be another
+ deadlock! */
trx_t* start, /* in: recursion starting point */
trx_t* trx, /* in: a transaction waiting for a lock */
lock_t* wait_lock, /* in: the lock trx is waiting to be granted */