I have a program that regularly exchanges a partition with a table.
MyTable is a partitioned table, and
MyTableTemplate is an empty copy of this table, with the same structure but no partitioning.
The process is the following:
CREATE TABLE tmp LIKE MyTableTemplate; INSERT INTO tmp VALUES (...); // more inserts... ALTER TABLE MyTable EXCHANGE PARTITION p1 WITH TABLE tmp; DROP TABLE tmp;
It worked fine so far, until I needed to add a column to the table:
ALTER TABLE MyTable ADD COLUMN someColumn TINYINT(1) UNSIGNED NULL DEFAULT NULL; ALTER TABLE MyTableTemplate ADD COLUMN someColumn TINYINT(1) UNSIGNED NULL DEFAULT NULL;
Now when I run
EXCHANGE PARTITION WITH TABLE, I get the following message:
General error: 1731 Non matching attribute 'INSTANT COLUMN(s)' between partition and table
Oddly, if I do not add the column at the last position:
ALTER TABLE ... ADD COLUMN ... AFTER someField;
...then the partition exchange works fine!
What's this "
INSTANT COLUMN(s) attribute" and what did I do wrong?
Is this a bug? I'm using MySQL 8.0.12.