Skip to content

Commit

Permalink
MDEV-22721 fixup for 32-bit GCC
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dr-m committed Jun 6, 2020
1 parent b9b279e commit e14ffd8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions storage/innobase/lock/lock0lock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*********************************************************************//**
Expand Down

0 comments on commit e14ffd8

Please sign in to comment.