Open shlomi-noach opened 5 months ago
There is furthermore the fact that MySQL does not support mixing and matching partitioning and non-partitioning changes in a single ALTER TABLE statement.
This is actually solved implicitly by:
sqlparser
, which will now parse such queries in the first place, andschemadiff
itself, which will not generate such an ALTER TABLE
statement (when schemadiff
sees such a complex diff, it breaks it down into subsequent ALTER TABLE
queries).https://github.com/vitessio/vitess/pull/15698 fulfills all that we need right now on the vitess
side, supporting RANGE
partition rotation.
Feature Description
Partitioning changes are quite nuanced. Some are perfectly applicable to Online DDL, some are expected to run directly, and some outright have to run directly and are incorrect to run through Online DDL.
We want Vitess Online DDL, likely through
schemadiff
, to be more aware of partitioning nuances. Examples:There is furthermore the fact that MySQL does not support mixing and matching partitioning and non-partitioning changes in a single
ALTER TABLE
statement. e.g. one cannotADD COLUMN
andDROP PARTITION
in the same statement. Also, one cannot add two partitions on aRANGE
partitioned table, and likewise one cannot bothADD
andDROP
partitions in the same statement. Interestingly it's OK toDROP
multipleRANGE
partitions.schemadiff
already recognizes some (most?) of these scenarios, but more work is needed.Some prior work was done in:
Use Case(s)
Better schema management;
vitess
to auto-resolve best approach to schema changes.