diff options
author | unknown <marko@hundin.mysql.fi> | 2005-04-22 15:15:18 +0300 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2005-04-22 15:15:18 +0300 |
commit | 33d5b13bbebcfc3657a7b8cc10eec10f73d44d71 (patch) | |
tree | a65e358729e6f1e701274a34709b910b114ee25b | |
parent | 98dc4142b206ea3fcf1d7b4bd127baef1aeac2d4 (diff) | |
download | mariadb-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.
-rw-r--r-- | innobase/data/data0data.c | 2 | ||||
-rw-r--r-- | innobase/lock/lock0lock.c | 17 | ||||
-rw-r--r-- | innobase/row/row0upd.c | 2 | ||||
-rw-r--r-- | sql/ha_innodb.cc | 2 |
4 files changed, 16 insertions, 7 deletions
diff --git a/innobase/data/data0data.c b/innobase/data/data0data.c index 5f74dde8710..194213a04e1 100644 --- a/innobase/data/data0data.c +++ b/innobase/data/data0data.c @@ -502,7 +502,7 @@ dtuple_convert_big_rec( size = rec_get_converted_size(index, entry); - if (size > 1000000000) { + if (UNIV_UNLIKELY(size > 1000000000)) { fprintf(stderr, "InnoDB: Warning: tuple size very big: %lu\n", (ulong) size); fputs("InnoDB: Tuple contents: ", stderr); 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 */ diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c index a595ad00247..c0aa285d7e5 100644 --- a/innobase/row/row0upd.c +++ b/innobase/row/row0upd.c @@ -1270,7 +1270,7 @@ row_upd_sec_index_entry( rec = btr_cur_get_rec(btr_cur); - if (!found) { + if (UNIV_UNLIKELY(!found)) { fputs("InnoDB: error in sec index entry update in\n" "InnoDB: ", stderr); dict_index_name_print(stderr, trx, index); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 025fc184fc9..3dd82960958 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2834,7 +2834,7 @@ ha_innobase::write_row( being blocked by a MySQL table lock TL_WRITE_ALLOW_READ. */ dict_table_t* src_table; - ibool mode; + ulint mode; num_write_row = 0; |