From a9bee9884aed7d9221bf028138349a1e7b5c984c Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 7 Jun 2020 16:30:50 +0300 Subject: 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 --- sql/sql_sequence.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sql/sql_sequence.cc') 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 *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++) { -- cgit v1.2.1