Skip to content

fix: emit bare CURRENT_TIMESTAMP(6) default for TIMESTAMP(6)/DATETIME(6) - #596

Open
The-king-king wants to merge 1 commit into
apecloud:mainfrom
The-king-king:fix/mysql-current-timestamp-precision
Open

fix: emit bare CURRENT_TIMESTAMP(6) default for TIMESTAMP(6)/DATETIME(6)#596
The-king-king wants to merge 1 commit into
apecloud:mainfrom
The-king-king:fix/mysql-current-timestamp-precision

Conversation

@The-king-king

@The-king-king The-king-king commented Sep 11, 2026

Copy link
Copy Markdown

Summary

This regression was introduced in #431 (which refactored parse_column_default to pass raw col_type), an incomplete fix from #403.

Test plan

  • cargo check -p dt-connector passes
  • Manual: struct task on MySQL 5.7 → 5.7 with timestamp(6) DEFAULT CURRENT_TIMESTAMP(6) NOT NULL column
  • Consider adding a regression fixture with the precision form

🤖 Generated with Claude Code

to_simple_mysql_col_type does an exact match on the raw COLUMN_TYPE and
returns Unknown for "timestamp(6)"/"datetime(6)", so the type branch never
matched and the value was emitted as DEFAULT 'CURRENT_TIMESTAMP(6)', which
MySQL rejects with 1064 (5.7) / 1067 (8.0). Match the base type name by
prefix on the raw type string instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

[BUG] struct migration emits quoted DEFAULT 'CURRENT_TIMESTAMP(6)' for TIMESTAMP(6)/DATETIME(6) (1067) — incomplete fix in #403, re-broken by #431

1 participant