[MDEV-19320] Sequence gets corrupted and produces ER_KEY_NOT_FOUND (Can't find record) after ALTER .. ORDER BY Created: 2019-04-24  Updated: 2020-06-17  Resolved: 2020-06-07

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Sequences
Affects Version/s: 10.3, 10.4
Fix Version/s: 10.5.4, 10.3.24, 10.4.14

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: affects-tests

Issue Links:
Relates
relates to MDEV-19977 Assertion `(0xFUL & mode) == LOCK_S |... Closed
relates to MDEV-22927 ER_KEY_NOT_FOUND or Assertion `(0xFUL... Confirmed
relates to MDEV-16397 ER_KEY_NOT_FOUND upon attempt to LOAD... Open
relates to MDEV-19303 Valgrind warnings about uninitialised... Open

 Description   

CREATE SEQUENCE s;
ALTER TABLE s ORDER BY cache_size;
SELECT NEXTVAL(s);
 
DROP SEQUENCE s;

10.3 765ae6e8

mysqltest: At line 3: query 'SELECT NEXTVAL(s)' failed: 1032: Can't find record in 's'



 Comments   
Comment by Elena Stepanova [ 2019-04-24 ]

The issue should only have a moderate-to-low importance to users, as such an ALTER is an unlikely operation, even though not impossible; but it badly affects tests, because ER_KEY_NOT_FOUND usually indicates data corruption and thus cannot be suppressed without increasing risks of getting false negatives.

Comment by Michael Widenius [ 2020-06-07 ]

Added a test to ensure one can't use ALTER TABLE ORDER BY with sequences

Generated at Thu Feb 08 08:50:46 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.