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

[Direct PR] [release-18.0] Remove sql changes from schemacopy #17050

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions go/vt/schemadiff/schema_diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,18 @@ func TestSchemaDiff(t *testing.T) {
expectDeps: 1,
conflictingDiffs: 2,
},
{
name: "two identical tables, one with explicit charset, one without",
fromQueries: []string{
"create table t1 (id int primary key, foo varchar(64) character set utf8mb3 collate utf8mb3_bin)",
},
toQueries: []string{
"create table t1 (id int primary key, foo varchar(64) collate utf8mb3_bin)",
},
// This isn't strictly correct. We have a diff even though there shouldn't be one.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, if we assume the default charset is utf8mb4, right?

expectDiffs: 1,
entityOrder: []string{"t1"},
},

// FKs
{
Expand Down
18 changes: 9 additions & 9 deletions go/vt/sidecardb/schema/schematracker/schemacopy.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ limitations under the License.

CREATE TABLE IF NOT EXISTS schemacopy
(
`table_schema` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
`table_name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
`column_name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`ordinal_position` bigint unsigned NOT NULL,
`character_set_name` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`collation_name` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`data_type` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
`column_key` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
`table_schema` varchar(64) NOT NULL,
`table_name` varchar(64) NOT NULL,
`column_name` varchar(64) NOT NULL,
`ordinal_position` bigint unsigned NOT NULL,
`character_set_name` varchar(32) DEFAULT NULL,
`collation_name` varchar(32) DEFAULT NULL,
`data_type` varchar(64) NOT NULL,
`column_key` varchar(3) NOT NULL,
PRIMARY KEY (`table_schema`, `table_name`, `ordinal_position`)
) ENGINE = InnoDB, CHARACTER SET = utf8mb3
) ENGINE = InnoDB
Loading