Skip to content

Conversation

@fanyang01
Copy link
Contributor

@fanyang01 fanyang01 commented Jan 7, 2025

This PR addresses an issue encountered when using MySQL Shell to copy a table containing both a UUID column and an ENUM column:

MySQL Error 1105 (HY000): Conversion Error: Unimplemented type for cast (BIGINT -> ENUM('draft', 'published', 'archived')): LOAD DATA LOCAL INFILE 'memory/testdb@documents@@0.tsv' REPLACE INTO TABLE `testdb`.`documents` CHARACTER SET 'utf8mb4' FIELDS TERMINATED BY '	' ESCAPED BY '\\' LINES STARTING BY '' TERMINATED BY '\n' (@`id`, `title`, `status`, `created_at`) SET `id` = FROM_BASE64(@`id`)

The root cause is that the go-mysql-server framework parses ENUM fields into ordinal values, whereas DuckDB does not support inserting ordinals directly into ENUM columns.

Ref: #329

@fanyang01 fanyang01 requested a review from Copilot January 7, 2025 09:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

@fanyang01 fanyang01 merged commit 052e742 into main Jan 7, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants