Skip to content

Conversation

@nielsreijers
Copy link
Contributor

Id columns always move when adding a first column, but they could also move when adding a column using AFTER, or when dropping a column if the primary key isn't the first column.

Probably a rare case, but the result if it happens would be that the column order in the internal state doesn't match the database anymore, which is bad since newly inserted data ends up in the wrong columns.

@nielsreijers nielsreijers marked this pull request as draft January 8, 2025 19:20
…primary key columns move.

Id columns always move when adding a first column, but they could also move when adding a column using AFTER, or when dropping a column if the primary key isn't the first column.

Probably a rare case, but the result if it happens would be that the column order in the internal state doesn't match the database anymore, which is bad.
@nielsreijers nielsreijers force-pushed the support-alter-column-add-first branch from f34b00e to 99b15b7 Compare January 8, 2025 19:34
@nielsreijers nielsreijers marked this pull request as ready for review January 8, 2025 19:34
@bakwc bakwc merged commit 507f2e8 into bakwc:master Jan 8, 2025
1 check passed
jaredmdobson pushed a commit to ReMatter/mysql_ch_replicator that referenced this pull request Nov 5, 2025
…primary key columns move. (bakwc#79)

Id columns always move when adding a first column, but they could also move when adding a column using AFTER, or when dropping a column if the primary key isn't the first column.

Probably a rare case, but the result if it happens would be that the column order in the internal state doesn't match the database anymore, which is bad.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants