mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-33836 Compute modulus correctly in sequence
When the sequence is unsigned bigint, it needs to be cast to unsigned for correct computation of the modulus.
This commit is contained in:
@ -751,7 +751,10 @@ void sequence_definition::adjust_values(longlong next_value)
|
||||
|
||||
next_free_value % real_increment == offset
|
||||
*/
|
||||
off= next_free_value % real_increment;
|
||||
if (is_unsigned)
|
||||
off= (ulonglong) next_free_value % real_increment;
|
||||
else
|
||||
off= next_free_value % real_increment;
|
||||
if (off < 0)
|
||||
off+= real_increment;
|
||||
to_add= (real_increment + offset - off) % real_increment;
|
||||
|
Reference in New Issue
Block a user