Support MySQL KEY keyword in column definitions#2243
Merged
yoavcloud merged 2 commits intoapache:mainfrom Feb 27, 2026
Merged
Conversation
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
1e80290 to
df75250
Compare
yoavcloud
approved these changes
Feb 27, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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