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

Bad collation Error Message #4236

Closed
timsehn opened this issue Aug 30, 2022 · 5 comments · Fixed by dolthub/go-mysql-server#1227
Closed

Bad collation Error Message #4236

timsehn opened this issue Aug 30, 2022 · 5 comments · Fixed by dolthub/go-mysql-server#1227
Assignees
Labels
bug Something isn't working

Comments

@timsehn
Copy link
Sponsor Contributor

timsehn commented Aug 30, 2022

test-mo-indexes $ cat file.sql 
CREATE TABLE `wp_e_submissions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(60) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
  `hash_id` varchar(60) COLLATE utf8mb4_unicode_520_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `hash_id_unique_index` (`hash_id`),
  KEY `hash_id_index` (`hash_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci
test-mo-indexes $ dolt sql < file.sql 
error on line 1 for query CREATE TABLE `wp_e_submissions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(60) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
  `hash_id` varchar(60) COLLATE utf8mb4_unicode_520_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `hash_id_unique_index` (`hash_id`),
  KEY `hash_id_index` (`hash_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci
: The collation `utf8mb4` has not yet been implemented, please create an issue at https://github.com/dolthub/go-mysql-server/issues/new and the DoltHub developers will implement it
The collation `utf8mb4` has not yet been implemented, please create an issue at https://github.com/dolthub/go-mysql-server/issues/new and the DoltHub developers will implement it

I assume it's supposed to say the collation utf8mb4_unicode_520_ci not utf8mb4 which is the character set.

@chadmpaul
Copy link

Possibly related to my experience. I was able to run a sql dump as an import yesterday and it ran fine. Today, after rebuilding my container, I'm getting a utf8mb3 error and there's no mention of it anywhere in the dump file.

error on line 9 for query
CREATE TABLE `Account` (
  `accountId` int(11) NOT NULL AUTO_INCREMENT,
  `class` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `label` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `type` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `id` int(11) DEFAULT NULL,
  `isActive` tinyint(4) DEFAULT NULL,
  `createDateTime` datetime DEFAULT NULL,
  `cancelDateTime` datetime DEFAULT NULL,
  `xcode` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `subAccountCode` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`accountId`)
) ENGINE=InnoDB AUTO_INCREMENT=67961 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci: The collation `utf8mb3` has not yet been implemented, please create an issue at https://github.com/dolthub/go-mysql-server/issues/new and the DoltHub developers will implement it
The collation `utf8mb3` has not yet been implemented, please create an issue at https://github.com/dolthub/go-mysql-server/issues/new and the DoltHub developers will implement it

@timsehn
Copy link
Sponsor Contributor Author

timsehn commented Aug 30, 2022

Unrelated.

Possibly related to my experience. I was able to run a sql dump as an import yesterday and it ran fine. Today, after rebuilding my container, I'm getting a utf8mb3 error and there's no mention of it anywhere in the dump file.

error on line 9 for query
CREATE TABLE `Account` (
  `accountId` int(11) NOT NULL AUTO_INCREMENT,
  `class` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `label` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `type` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `id` int(11) DEFAULT NULL,
  `isActive` tinyint(4) DEFAULT NULL,
  `createDateTime` datetime DEFAULT NULL,
  `cancelDateTime` datetime DEFAULT NULL,
  `xcode` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `subAccountCode` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`accountId`)
) ENGINE=InnoDB AUTO_INCREMENT=67961 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci: The collation `utf8mb3` has not yet been implemented, please create an issue at https://github.com/dolthub/go-mysql-server/issues/new and the DoltHub developers will implement it
The collation `utf8mb3` has not yet been implemented, please create an issue at https://github.com/dolthub/go-mysql-server/issues/new and the DoltHub developers will implement it

Unrelated. We don't support the utf8mb3 character set yet. Make a new issue to support it entitled "Support utf8mb3 character set" or change your character set to utf8mb4.

@timsehn timsehn closed this as completed Aug 30, 2022
@timsehn timsehn reopened this Aug 30, 2022
@chadmpaul
Copy link

Actually, I do think it's similar. From my sample above and all other tables, the charset it is trying to use is utf8. I can see from a SHOW CHARACTER SET that Dolt does not support plain ol' utf8 as a charset. But it has mislabeled (or at least misled) the issue as trying to use utf8mb3.

@timsehn timsehn added the bug Something isn't working label Aug 30, 2022
@bpf120
Copy link

bpf120 commented Aug 30, 2022

Hi @chadmpaul , We'd love to learn what you are using Dolt for. Business or pleasure? Swing by our Discord or shoot me an email if you want to share.

@Hydrocharged
Copy link
Contributor

Hydrocharged commented Aug 30, 2022

@timsehn This is fixed in dolthub/go-mysql-server#1227

@chadmpaul So utf8 is an alias for utf8mb3. Tim is incorrect here, as we do support utf8mb3. MySQL, at some point, will switch utf8 to be utf8mb4 instead, so we accept utf8 to mean utf8mb3 just like MySQL does, but we're very explicit that you're actually using utf8mb3. In the future, when MySQL switches utf8 to utf8mb4, there will probably be some unexpected issues with old exports having their character set changed since it just reports utf8. By being explicit, we're avoiding any potential future issues.

Also, the above PR adds utf8mb3_unicode_ci, so once that's in, look for our next Dolt release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants