summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-06-06 17:36:25 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-06-06 18:18:40 +0300
commite14ffd85d09a62d098d3db9597fd34bf3d4c4fe3 (patch)
tree17e04b93361a61bd3288909f509322be9ccf3c97
parentb9b279ecc4d85a28644ff7e13a9641c671e6a544 (diff)
downloadmariadb-git-e14ffd85d09a62d098d3db9597fd34bf3d4c4fe3.tar.gz
MDEV-22721 fixup for 32-bit GCC
lock_check_trx_id_sanity(): Because the argument of UNIV_LIKELY or __builtin_expect() can be less than sizeof(trx_id_t) on 32-bit systems, it cannot reliably perform an implicit comparison to 0.
-rw-r--r--storage/innobase/lock/lock0lock.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 858b381e788..1c7407a0c23 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -351,18 +351,18 @@ lock_check_trx_id_sanity(
dict_index_t* index, /*!< in: index */
const rec_offs* offsets) /*!< in: rec_get_offsets(rec, index) */
{
- ut_ad(rec_offs_validate(rec, index, offsets));
- ut_ad(!rec_is_metadata(rec, index));
+ ut_ad(rec_offs_validate(rec, index, offsets));
+ ut_ad(!rec_is_metadata(rec, index));
- trx_id_t max_trx_id = trx_sys.get_max_trx_id();
- ut_ad(max_trx_id || srv_force_recovery >= SRV_FORCE_NO_UNDO_LOG_SCAN);
+ trx_id_t max_trx_id= trx_sys.get_max_trx_id();
+ ut_ad(max_trx_id || srv_force_recovery >= SRV_FORCE_NO_UNDO_LOG_SCAN);
- if (UNIV_LIKELY(max_trx_id) && UNIV_UNLIKELY(trx_id >= max_trx_id)) {
- lock_report_trx_id_insanity(
- trx_id, rec, index, offsets, max_trx_id);
- return false;
- }
- return(true);
+ if (UNIV_LIKELY(max_trx_id != 0) && UNIV_UNLIKELY(trx_id >= max_trx_id))
+ {
+ lock_report_trx_id_insanity(trx_id, rec, index, offsets, max_trx_id);
+ return false;
+ }
+ return true;
}
/*********************************************************************//**