-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
: assume default collation for textual column when collation is undefined
#16000
schemadiff
: assume default collation for textual column when collation is undefined
#16000
Conversation
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
…ation Signed-off-by: Shlomi Noach <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16000 +/- ##
==========================================
- Coverage 68.47% 68.25% -0.23%
==========================================
Files 1562 1562
Lines 197083 197206 +123
==========================================
- Hits 134962 134598 -364
- Misses 62121 62608 +487 ☔ View full report in Codecov by Sentry. |
go/vt/schemadiff/column.go
Outdated
@@ -104,7 +104,17 @@ func (c *ColumnDefinitionEntity) ColumnDiff( | |||
) (*ModifyColumnDiff, error) { | |||
if c.IsTextual() || other.IsTextual() { | |||
// We will now denormalize the columns charset & collate as needed (if empty, populate from table.) | |||
|
|||
// This column definition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the full comment? 🙂 I'm assuming it should be ~
// This column definition is using the implied / default collation for the character set
// so we need to determine the default/actual collation used for the specified character set
// based on the MySQL version being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this and other comments.
go/vt/schemadiff/column.go
Outdated
@@ -137,6 +147,17 @@ func (c *ColumnDefinitionEntity) ColumnDiff( | |||
c.columnDefinition.Type.Options.Collate = env.CollationEnv().LookupName(collation) | |||
} | |||
} | |||
// other column definition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. So "this" and "other" are the two things being diffed. The other related comments are still worthwhile though IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this and other comments.
Signed-off-by: Shlomi Noach <[email protected]>
Description
Fixes #15999. When looking at textual columns, if the character set is defined and the collation is not,
schemadiff
assumes the default collation for that character set.Related Issue(s)
#15999
cc @lizztheblizz
Checklist
Deployment Notes