1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-13005: Fixing bugs in SEQUENCE, part 3, 3/5

Task 3:
Added an additional condition for SEQUENCE option to check if cache < 0.
This commit is contained in:
Rucha Deodhar
2022-03-28 15:12:33 +05:30
parent 0b9842a3e7
commit c6eeacd10f
3 changed files with 8 additions and 1 deletions

View File

@ -121,7 +121,7 @@ bool sequence_definition::check_and_adjust(bool set_reserved_until)
start >= min_value &&
max_value != LONGLONG_MAX &&
min_value != LONGLONG_MIN &&
cache < (LONGLONG_MAX - max_increment) / max_increment &&
cache >= 0 && cache < (LONGLONG_MAX - max_increment) / max_increment &&
((real_increment > 0 && reserved_until >= min_value) ||
(real_increment < 0 && reserved_until <= max_value)))
DBUG_RETURN(FALSE);