1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Don't allow ALTER TABLE ... ORDER BY on SEQUENCE objects

MDEV-19320 Sequence gets corrupted and produces ER_KEY_NOT_FOUND
           (Can't find record) after ALTER .. ORDER BY
This commit is contained in:
Monty
2020-06-07 16:30:50 +03:00
parent e6a6382f15
commit a9bee9884a
3 changed files with 23 additions and 0 deletions

View File

@ -242,3 +242,10 @@ CREATE SEQUENCE t1 engine=innodb;
ALTER IGNORE TABLE t1 ADD CHECK (start_value < minimum_value);
ERROR HY000: Sequence 'test.t1' table structure is invalid (Sequence tables cannot have any constraints)
DROP SEQUENCE t1;
CREATE SEQUENCE s;
ALTER TABLE s ORDER BY cache_size;
ERROR HY000: Sequence 'test.s' table structure is invalid (ORDER BY)
SELECT NEXTVAL(s);
NEXTVAL(s)
1
DROP SEQUENCE s;