Skip to content

SQLite: Reject colon-based semi-structured data traversal - #2613

Open
LucaCappelletti94 wants to merge 4 commits into
mainfrom
upstream/sqlite-postfix-colon
Open

LucaCappelletti94 wants to merge 4 commits into
mainfrom
upstream/sqlite-postfix-colon

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

SQLiteDialect parses SELECT c:se as a JsonAccess expression, the same : semi-structured traversal Snowflake and Databricks use. Real SQLite rejects it: near ":se": syntax error.

SQLiteDialect now overrides get_next_precedence for Token::Colon, the same pattern PostgreSqlDialect and MsSqlDialect already use, so : never starts an infix parse there. Named parameters, :: casts, and ->/->> are unaffected.

@LucaCappelletti94 LucaCappelletti94 added bug Something isn't working fuzzer A bug found by the fuzzer labels Oct 5, 2026
@github-actions github-actions Bot added the SQLite label Oct 5, 2026
@codecov-commenter

codecov-commenter commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.00%. Comparing base (594bb04) to head (306917e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2613   +/-   ##
=======================================
  Coverage   81.99%   82.00%           
=======================================
  Files          42       42           
  Lines       35049    35050    +1     
  Branches    35049    35050    +1     
=======================================
+ Hits        28740    28741    +1     
  Misses       2744     2744           
  Partials     3565     3565           

☔ 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 marked this pull request as ready for review October 5, 2026 19:08
@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/sqlite-postfix-colon branch 2 times, most recently from a0425ba to e30f8ff Compare October 18, 2026 14:24

@sabir-akhadov-localstack sabir-akhadov-localstack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts with main: #2683 added get_next_precedence to this impl (&/| arm) and parse_unterminated_block_comment lands at the same spot in the test file; needs a rebase.

Comment thread src/dialect/sqlite.rs
None
}

fn get_next_precedence(&self, parser: &Parser) -> Option<Result<u8, ParserError>> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2559 carries this same Token::Colon arm; keep it here and drop it from #2559 so the two don't double-define get_next_precedence when both land.

@LucaCappelletti94

Copy link
Copy Markdown
Contributor Author

Conflicts with main: #2683 added get_next_precedence to this impl (&/| arm) and parse_unterminated_block_comment lands at the same spot in the test file; needs a rebase.

Please do not add review notes on rebases, those are pretty evident by themselves.

@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/sqlite-postfix-colon branch 5 times, most recently from 9aa2315 to add1eeb Compare October 24, 2026 14:06
@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/sqlite-postfix-colon branch from add1eeb to 306917e Compare October 24, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fuzzer A bug found by the fuzzer SQLite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants