Repository navigation
PostgreSQL: Parse namespaced options in ALTER VIEW SET and RESET - #2785
Open
LucaCappelletti94 wants to merge 2 commits into
Open
LucaCappelletti94 wants to merge 2 commits into
LucaCappelletti94 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2785 +/- ##
=======================================
Coverage 82.83% 82.83%
=======================================
Files 42 42
Lines 35900 35901 +1
Branches 35900 35901 +1
=======================================
+ Hits 29739 29740 +1
Misses 2654 2654
Partials 3507 3507 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
slopgobblercobbler
left a comment
There was a problem hiding this comment.
Audited the namespaced view option parsing in src/ast/ddl.rs and src/parser/mod.rs:
- AST alignment and parity:
- Transitioning
AlterViewOperation::ResetOptions.optionsfromVec<Ident>toVec<ObjectName>resolves a long-standing AST inconsistency withAlterTableOperation::ResetOptions, which already models storage parameters viaVec<ObjectName>. - Single-part options (
security_invoker) and multi-part options (toast.autovacuum_enabled) are now unified underObjectName.
- Transitioning
- Parsing logic and lookahead:
- In
parse_alter_view:SETusesparse_period_separatedto constructObjectNamekeys, properly handling both key-value pairs (toast.autovacuum_vacuum_threshold = 50) and standalone flags (toast.vacuum_truncate).RESETparses comma-separated object names viap.parse_object_name(false).
- Negative syntax checks correctly catch trailing period tokens (
SET (toast. = 1)andRESET (toast.)), rejecting with clean expected-identifier diagnostics.
- In
- Span derivation and Display roundtrip:
- Updated
Spannedimplementation insrc/ast/spans.rsto calli.span()onObjectName, maintaining accurate source spans. - Roundtrip formatting through
display_comma_separated(options)cleanly emits period-separated names.
- Updated
- Test and fuzz coverage:
- Unit tests in
sqlparser_common.rsverify roundtrip equivalence and AST structure across bothSETandRESETvariants. - Addition of
fuzz/fuzz_seeds/postgres_2785_alter_view_namespaced_options.sqlensures fuzzer coverage.
- Unit tests in
Solid cleanup that aligns view options with table options and supports standard PostgreSQL toast parameters.
Contributor
Author
|
@slopgobblercobbler don't post generated summaries on this pull request, issues or other interactions with humans in the Apache org. A review is welcome when it points at a concrete problem or asks a question. |
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.
ALTER VIEW v SET (toast.autovacuum_enabled = false)andALTER VIEW v RESET (toast.autovacuum_enabled)fail withExpected: ), found: ., while the same option already parses inCREATE VIEW v WITH (...)and inALTER TABLE t SET (...)andRESET (...).TLDR of the PR:
IdentbecomesObjectName, plus appropriate tests.