vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.43k stars 2.08k forks source link

Feature Request: `schemadiff` strategy for `enum`/`set` value ordinal change #15105

Closed shlomi-noach closed 6 months ago

shlomi-noach commented 7 months ago

Feature Description

Consider this scenario: a schema is being changed from create table t(e enum('a', 'b', 'c')) to create table t(e enum(''b', 'c', 'a')). The ordinals of the names 'a', 'b', and 'c' have all changed. Remember that in MySQL enum values are numeric and therefore this change causes unexpected behavior on the application side, where same 'a' value yields different stored numeric value. This kind of change is undesired and likely accidental. schemadiff should have a way to prevent/error this type of change.

Use Case(s)

-

dbussink commented 7 months ago

@shlomi-noach Should we also have a bit more overarching issue that renames today break for online DDL? And track that separately? Maybe we'd want to one day fix that by having the correct schema knowledge but that this change is a stop-gap until we'd have that?

shlomi-noach commented 6 months ago

This was fixed by https://github.com/vitessio/vitess/pull/15106

shlomi-noach commented 6 months ago

Should we also have a bit more overarching issue that renames today break for online DDL? And track that separately?

Tracked in https://github.com/vitessio/vitess/issues/15349