summaryrefslogtreecommitdiff
path: root/sql/sql_sequence.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-06-07 16:30:50 +0300
committerMonty <monty@mariadb.org>2020-06-07 16:32:00 +0300
commita9bee9884aed7d9221bf028138349a1e7b5c984c (patch)
tree60bd0804fabb309a9fddcdcdfd5ae688a04c37c9 /sql/sql_sequence.cc
parente6a6382f15834943ce3814e4f30debe58076e24d (diff)
downloadmariadb-git-a9bee9884aed7d9221bf028138349a1e7b5c984c.tar.gz
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
Diffstat (limited to 'sql/sql_sequence.cc')
-rw-r--r--sql/sql_sequence.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc
index 68d9efb3093..939963de682 100644
--- a/sql/sql_sequence.cc
+++ b/sql/sql_sequence.cc
@@ -208,6 +208,11 @@ bool check_sequence_fields(LEX *lex, List<Create_field> *fields)
reason= "Sequence tables cannot have any constraints";
goto err;
}
+ if (lex->alter_info.flags & ALTER_ORDER)
+ {
+ reason= "ORDER BY";
+ goto err;
+ }
for (field_no= 0; (field= it++); field_no++)
{