Skip to content

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

Open
LucaCappelletti94 wants to merge 2 commits into
mainfrom
tokenizer-dot-underscore
Open

LucaCappelletti94 wants to merge 2 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 97.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.32%. Comparing base (ada8314) to head (32a2953).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/tokenizer.rs 97.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2677      +/-   ##
==========================================
+ Coverage   81.28%   81.32%   +0.04%     
==========================================
  Files          42       42              
  Lines       33920    33980      +60     
  Branches    33920    33980      +60     
==========================================
+ Hits        27571    27634      +63     
+ Misses       2785     2784       -1     
+ Partials     3564     3562       -2     

☔ 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
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.

2 participants