Skip to content

SQLite, DuckDB, PostgreSQL: Accept ._name after whitespace in a qualified name - #2677

Merged
LucaCappelletti94 merged 5 commits into
mainfrom
tokenizer-dot-underscore
Oct 24, 2026
Merged

LucaCappelletti94 merged 5 commits into
mainfrom
tokenizer-dot-underscore

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

SELECT t ._a FROM t failed to tokenize with Unexpected character '_', although SQLite 3.51.1, DuckDB 1.4.4 and PostgreSQL 16 all run it and read it as t._a. The tokenizer treats ._ as a period only when the previous token is a word, and with whitespace in between the previous token was the whitespace, so it fell through to number parsing.

The check now looks at the previous token that is not whitespace. A ._ that follows a number, as in SELECT 1 ._a, is still a tokenizer error, and SELECT ._abc with no qualifier is still rejected by the parser. Tests cover these forms in every dialect where _ can start an identifier.

@codecov-commenter

codecov-commenter commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.25373% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.79%. Comparing base (13ce307) to head (78224d9).

Files with missing lines Patch % Lines
src/tokenizer.rs 99.25% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2677      +/-   ##
==========================================
+ Coverage   81.72%   81.79%   +0.07%     
==========================================
  Files          42       42              
  Lines       34476    34583     +107     
  Branches    34476    34583     +107     
==========================================
+ Hits        28174    28286     +112     
+ Misses       2757     2755       -2     
+ Partials     3545     3542       -3     

☔ 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 draft October 18, 2026 14:12
@LucaCappelletti94
LucaCappelletti94 marked this pull request as ready for review October 18, 2026 17:06
@LucaCappelletti94
LucaCappelletti94 force-pushed the tokenizer-dot-underscore branch 3 times, most recently from dca4319 to 5df0f29 Compare October 24, 2026 06:26
@LucaCappelletti94
LucaCappelletti94 added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit 80d63da Oct 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants