Skip to content

Generic: Include the VALUES keyword in the clause span - #3074

Draft
icefery wants to merge 1 commit into
apache:mainfrom
icefery:fix/values-keyword-span
Draft

icefery wants to merge 1 commit into
apache:mainfrom
icefery:fix/values-keyword-span

Conversation

@icefery

@icefery icefery commented Nov 30, 2026

Copy link
Copy Markdown

Dialects: none

For VALUES (1), (2), Values::span() returns 1:8..1:16, so slicing the source gives (1), (2). The span should be 1:1..1:16 to include the keyword.

Store the consumed VALUES or MySQL VALUE in an AttachedToken and union its span with the row spans. Keywordless row lists still use the row spans alone.

Rust struct literals and exhaustive patterns for Values must account for the new values_token field. Older JSON without the field still loads with a row-only span. New JSON retains the keyword location.

Regression tests cover standalone VALUES, MySQL VALUE, bare FROM VALUES, MERGE inserts, keywordless row lists, and JSON compatibility. The stable all-features suite passed (1,988 passed, 7 ignored), along with formatting, strict Clippy, rustdoc, and host no_std checks.

Related to #1548.

The implementation, tests, and draft were prepared with AI assistance.

Capture the consumed VALUES or VALUE token and union its span with the existing row spans. Fall back to the row-only span for keywordless input and older JSON.

Cover the shared parser entry points and the JSON compatibility boundary with regression tests. Add a minimal VALUES fuzz seed.

Related to apache#1548.

Generated-by: omp
@icefery
icefery marked this pull request as draft December 1, 2026 13:28
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.

1 participant