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

[MySQL] CREATE TABLE with non-default CHARSET/COLLATE appear to be ignored #1360

Open
ssherwood opened this issue Mar 14, 2024 · 1 comment
Labels
triage Needs to be triaged

Comments

@ssherwood
Copy link

ssherwood commented Mar 14, 2024

Running Voyager to migrate a set of tables from MySQL (MariaDB 10.5) and have identified a possible issue.

Example:

CREATE TABLE `foo_abba` (
  `id` bigint(20) NOT NULL DEFAULT 0,
  `status` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

Results in:

CREATE TABLE foo_abba (
	id bigint NOT NULL DEFAULT 0,
	status varchar(255),
	PRIMARY KEY (id)
) ;

The non-default CHARSET/COLLATE appears to have been ignored.

@github-actions github-actions bot added the triage Needs to be triaged label Mar 14, 2024
@ssherwood
Copy link
Author

It isn't entirely clear to me what the correct behavior should be. From my initial research, Postgres does not appear to support COLLATE at a table level, only database-wide or per column.

It may be required to consider any text/varchar columns in the resulting CREATE:

CREATE TABLE foo_abba (
	id bigint NOT NULL DEFAULT 0,
	status varchar(255) COLLATE "sv-SE-x-icu",
	PRIMARY KEY (id)
) ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant