Skip to content

Commit

Permalink
Fix warnings for page_header_get_field() comparisons
Browse files Browse the repository at this point in the history
The type uint16_t is apparently promoted to int in a comparison,
causing a sign mismatch when comparing to ulint. Convert to ulint
before comparison.
  • Loading branch information
dr-m committed Sep 14, 2017
1 parent 88106ef commit 126a581
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/innobase/page/page0page.cc
Expand Up @@ -2117,7 +2117,7 @@ page_simple_validate_old(
goto func_exit;
}

if (UNIV_UNLIKELY(page_header_get_field(page, PAGE_N_RECS)
if (UNIV_UNLIKELY(ulint(page_header_get_field(page, PAGE_N_RECS))
+ PAGE_HEAP_NO_USER_LOW
!= count + 1)) {
ib::error() << "n recs wrong "
Expand Down Expand Up @@ -2308,7 +2308,7 @@ page_simple_validate_new(
goto func_exit;
}

if (UNIV_UNLIKELY(page_header_get_field(page, PAGE_N_RECS)
if (UNIV_UNLIKELY(ulint(page_header_get_field(page, PAGE_N_RECS))
+ PAGE_HEAP_NO_USER_LOW
!= count + 1)) {
ib::error() << "n recs wrong "
Expand Down

0 comments on commit 126a581

Please sign in to comment.