Skip to content

Accept CREATE SEQUENCE options in any order - #2414

Open
LucaCappelletti94 wants to merge 1 commit into
apache:mainfrom
LucaCappelletti94:pg-create-sequence-unordered-options
Open

LucaCappelletti94 wants to merge 1 commit into
apache:mainfrom
LucaCappelletti94:pg-create-sequence-unordered-options

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

CREATE SEQUENCE options were parsed by a fixed chain of independent if blocks, one per option, so only a single order was accepted. CREATE SEQUENCE s INCREMENT BY 1 START WITH 1 parsed, but CREATE SEQUENCE s START WITH 1 INCREMENT BY 1 left the INCREMENT keyword unconsumed and failed with Expected: end of statement. PostgreSQL treats these as an unordered list.

Therefore, following the same pattern we used in other methods, parse_create_sequence_options now loops, dispatching on whichever option keyword comes next and breaking when none matches, and rejects repeated options. Options are recorded in the order written, so Display round-trips the input unchanged.

@LucaCappelletti94 LucaCappelletti94 changed the title Accept CREATE SEQUENCE options in any order Accept CREATE SEQUENCE options in any order Jul 30, 2026
@LucaCappelletti94
LucaCappelletti94 marked this pull request as ready for review July 30, 2026 16:29
@LucaCappelletti94
LucaCappelletti94 force-pushed the pg-create-sequence-unordered-options branch 2 times, most recently from f0ba878 to b5f4edb Compare August 24, 2026 11:45
@LucaCappelletti94
LucaCappelletti94 force-pushed the pg-create-sequence-unordered-options branch from b5f4edb to fb40c1a Compare September 3, 2026 17:05
@LucaCappelletti94
LucaCappelletti94 force-pushed the pg-create-sequence-unordered-options branch 4 times, most recently from 2f43c43 to 15c849c Compare September 22, 2026 21:20
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.98%. Comparing base (9ae00e7) to head (4d8634f).

Files with missing lines Patch % Lines
src/parser/mod.rs 81.81% 0 Missing and 8 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2414      +/-   ##
==========================================
+ Coverage   80.96%   80.98%   +0.02%     
==========================================
  Files          42       42              
  Lines       33359    33356       -3     
  Branches    33359    33356       -3     
==========================================
+ Hits        27009    27014       +5     
+ Misses       2790     2788       -2     
+ Partials     3560     3554       -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucaCappelletti94
LucaCappelletti94 force-pushed the pg-create-sequence-unordered-options branch from 4d8634f to b296c52 Compare October 2, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants