Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schemadiff: fix TableCharsetCollateIgnoreAlways and TableCharsetCollateIgnoreEmpty and normalized column charset & collation #14929

Closed
shlomi-noach opened this issue Jan 10, 2024 · 0 comments · Fixed by #14930

Comments

@shlomi-noach
Copy link
Contributor

Comparing tables with TableCharsetCollateStrategy = TableCharsetCollateIgnoreAlways or TableCharsetCollateIgnoreEmpty can generate a wrong plan depending on column definitions. As example: take these from and to statements:

from: "create table t (a varchar(64)) default charset=latin1",
to:   "create table t (a varchar(64) CHARACTER SET latin1 COLLATE latin1_bin)",

In the from definition, a's charset is really latin1, derived from the table. So is the charset in to, defined explicitly.

However, when converting between the two tables in TableCharsetCollateIgnoreAlways, the fact the table charset is ignored leads to the wrong behavior where the column's charset is modified.

PR is incoming with test cases and fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant