Skip to content

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

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

LucaCappelletti94 wants to merge 2 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 81.30%. Comparing base (d32825d) to head (8ec5e9d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2613   +/-   ##
=======================================
  Coverage   81.29%   81.30%           
=======================================
  Files          42       42           
  Lines       33950    33955    +5     
  Branches    33950    33955    +5     
=======================================
+ Hits        27601    27606    +5     
  Misses       2785     2785           
  Partials     3564     3564           

☔ 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 from 8ec5e9d to 5d9e3a6 Compare October 21, 2026 07:42
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