MDEV-15732: Assertion `next_free_value % real_increment == offset && next_free_value >= reserved_until' failed in sequence_definition::adjust_values upon SETVAL for sequence with INCREMENT 0
there was a problem with "next_free_value >= reserved_until" condition: SEQUENCE::set_value handle next_free_value & reserved_until after adjust_values() call, so it is incorect to put assert on it in adjust_values()
This commit is contained in:
parent
7f89d9c9e3
commit
0bdc15d86e
@ -254,3 +254,18 @@ def SETVAL(s1,10) 8 20 2 Y 32896 0 63
|
|||||||
SETVAL(s1,10)
|
SETVAL(s1,10)
|
||||||
10
|
10
|
||||||
DROP SEQUENCE s1;
|
DROP SEQUENCE s1;
|
||||||
|
#
|
||||||
|
# MDEV-15732: Assertion `next_free_value % real_increment == offset &&
|
||||||
|
# next_free_value >= reserved_until' failed in
|
||||||
|
# sequence_definition::adjust_values upon SETVAL for sequence with
|
||||||
|
# INCREMENT 0
|
||||||
|
#
|
||||||
|
CREATE SEQUENCE s INCREMENT 0;
|
||||||
|
SELECT NEXTVAL(s);
|
||||||
|
NEXTVAL(s)
|
||||||
|
1
|
||||||
|
SELECT SETVAL(s, 10);
|
||||||
|
SETVAL(s, 10)
|
||||||
|
10
|
||||||
|
DROP SEQUENCE s;
|
||||||
|
# End of 10.3 tests
|
||||||
|
@ -137,3 +137,20 @@ SELECT SETVAL(s1,10);
|
|||||||
DROP SEQUENCE s1;
|
DROP SEQUENCE s1;
|
||||||
--enable_ps_protocol
|
--enable_ps_protocol
|
||||||
--disable_metadata
|
--disable_metadata
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-15732: Assertion `next_free_value % real_increment == offset &&
|
||||||
|
--echo # next_free_value >= reserved_until' failed in
|
||||||
|
--echo # sequence_definition::adjust_values upon SETVAL for sequence with
|
||||||
|
--echo # INCREMENT 0
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE SEQUENCE s INCREMENT 0;
|
||||||
|
SELECT NEXTVAL(s);
|
||||||
|
SELECT SETVAL(s, 10);
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
DROP SEQUENCE s;
|
||||||
|
|
||||||
|
|
||||||
|
--echo # End of 10.3 tests
|
||||||
|
@ -560,8 +560,7 @@ void sequence_definition::adjust_values(longlong next_value)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
next_free_value+= to_add;
|
next_free_value+= to_add;
|
||||||
DBUG_ASSERT(next_free_value % real_increment == offset &&
|
DBUG_ASSERT(next_free_value % real_increment == offset);
|
||||||
next_free_value >= reserved_until);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user