Commit bc284957 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-33251 Redundant check on prebuilt::n_rows_fetched overflow

row_search_mvcc(): Revise an overflow check, disabling it on 64-bit
systems. The maximum number of consecutive record reads in a key range
scan should be limited by the maximum number of records per page
(less than 2^13) and the maximum number of pages per tablespace (2^32)
to less than 2^45. On 32-bit systems we can simplify the overflow check.

Reviewed by: Vladislav Lesin
parent 57ffcd68
......@@ -4406,13 +4406,11 @@ row_search_mvcc(
goto func_exit;
}
#if SIZEOF_SIZE_T < 8
if (UNIV_LIKELY(~prebuilt->n_rows_fetched))
#endif
prebuilt->n_rows_fetched++;
if (prebuilt->n_rows_fetched > 1000000000) {
/* Prevent wrap-over */
prebuilt->n_rows_fetched = 500000000;
}
mode = pcur->search_mode;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment