Skip to content

Support MySQL KEY keyword in column definitions#2243

Merged
yoavcloud merged 2 commits intoapache:mainfrom
mvzink:push-vuqvpqzkltln
Feb 27, 2026
Merged

Support MySQL KEY keyword in column definitions#2243
yoavcloud merged 2 commits intoapache:mainfrom
mvzink:push-vuqvpqzkltln

Conversation

@mvzink
Copy link
Copy Markdown
Contributor

@mvzink mvzink commented Feb 25, 2026

Add supports_key_column_option() dialect trait method to enable MySQL-specific KEY syntax in column-level constraints:

  • UNIQUE [KEY] — optional KEY after UNIQUE
  • [PRIMARY] KEY — standalone KEY as shorthand for PRIMARY KEY

Add `supports_key_column_option()` dialect trait method to enable
MySQL-specific KEY syntax in column-level constraints:
- `UNIQUE [KEY]` — optional KEY after UNIQUE
- `[PRIMARY] KEY` — standalone KEY as shorthand for PRIMARY KEY
@yoavcloud yoavcloud enabled auto-merge February 27, 2026 10:55
@yoavcloud yoavcloud added this pull request to the merge queue Feb 27, 2026
Merged via the queue into apache:main with commit 83baf5e Feb 27, 2026
10 checks passed
@mvzink mvzink deleted the push-vuqvpqzkltln branch February 27, 2026 16:42
readysetbot pushed a commit to readysettech/readyset that referenced this pull request Apr 17, 2026
The readyset-patched fork only carried one patch on top of v0.61.0
(optimizer hints), which has since been upstreamed as apache/
datafusion-sqlparser-rs#2216. Fast-forward the readyset-patched branch
to upstream main (9f04ebe) so we pick up recent upstream fixes, and
adapt to the API changes.

Also creates two date-stamped tags on the fork:

- readyset-patched-2026-02-13 pins the prior branch tip (f287484)
- readyset-patched-2026-04-16 pins the new branch tip (9f04ebe)

Picks up upstream fixes for REA-5841 (MySQL `UNIQUE KEY` on column
definitions, apache/datafusion-sqlparser-rs#2243) and REA-5842 (`UNIQUE
KEY ... USING` suffix). Those ignored parity tests are now enabled.

Key changes:

- Handle ValueWithSpan wrapping around Value (Separator clause,
  `post_visit_value` visitor signature)
- Add missing output / `order_by` fields to Update pattern match
- Handle qualified INSERT columns (`Vec<Ident>` -> `Vec<ObjectName>`)
  via `try_into_dialect`
- Handle new enum variants: `FunctionArgExpr::WildcardWithOptions`,
  TableConstraint::{PrimaryKeyUsingIndex,UniqueUsingIndex},
  `SelectItem::ExprWithAliases`
- Postgres PRIMARY KEY/UNIQUE USING INDEX is rejected for now.

Fixes: REA-5841, REA-5842
Release-Note-Core: Fixed parsing of MySQL UNIQUE KEY column constraints
  (both inline x INT UNIQUE KEY and UNIQUE KEY name (col) USING
  {HASH,BTREE} suffix forms).
AI-Use: level:3
Change-Id: Iae446870aa321735885be562e2e009b86a6a6964
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/12809
Tested-by: Buildkite CI
Reviewed-by: Marcelo Altmann <marcelo@readyset.io>
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