[MDEV-19330] InnoDB ALTER TABLE treats auto_increment_increment,auto_increment_offset differently from ALGORITHM=COPY Created: 2019-04-25  Updated: 2023-04-27

Status: Stalled
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Storage Engine - XtraDB
Affects Version/s: 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Julius Goryavsky
Resolution: Unresolved Votes: 0
Labels: corruption, ddl, replication, upstream

Issue Links:
Relates
relates to MDEV-19331 Merge new release of InnoDB 5.6.44 to... Closed

 Description   

The fix of Bug#14219624 - ALTER TABLE...ADD COL AUTO_INCREMENT DOES NOT OBEY AUTO_INCREMENT_OFFSET was incomplete. Contrary to what is claimed in the test innodb.innodb-alter-autoinc, the results do differ between ALGORITHM=COPY and ALGORITHM=INPLACE. Here is an example:

git checkout origin/10.1
diff -u <(tail +76 mysql-test/suite/innodb/r/innodb-alter-autoinc.result|head) --label COPY <(tail +156 mysql-test/suite/innodb/r/innodb-alter-autoinc.result|head) --label INPLACE

--- COPY
+++ INPLACE
@@ -6,5 +6,5 @@
 123	55
 347	60
 33101	65
-123	70
 123	75
+123	80

This could cause corruption in replication or in Galera cluster, especially if only some nodes are using old_alter_table=1, or some are running a server version where the ALTER TABLE operation is executed using a different ALGORITHM.



 Comments   
Comment by Marko Mäkelä [ 2019-04-25 ]

MDEV-19331 includes an upstream fix for something related in partitioned tables. That is what prompted me to file this bug.

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