• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

AfterShip / clickhouse-sql-parser / 25668989343

11 May 2026 12:04PM UTC coverage: 51.545% (+0.08%) from 51.469%
25668989343

Pull #269

github

arifdemirel
Broaden bypass to all keywords and extend parseColumnExpr lookahead

Empirically validated against ClickHouse server 25.10.7.6: CH accepts
every reserved keyword as a bare column reference in SELECT projections
except NOT (a unary operator). Tested 256 keywords in both mid-list
(`SELECT a, KW, b FROM t`) and last-item (`SELECT a, KW FROM t`)
positions.

Changes:

- isSelectItemTerminatorKeyword: bypass terminator handling for ANY
  keyword whose next token is `,`, `AS`, or another clause-starter
  keyword. Backticked identifiers tokenize as TokenKindIdent (not
  TokenKindKeyword), so the trailing-comma-before-keyword-table case
  from #268 (`SELECT count(*), FROM `limit``) is still handled.
- parseColumnExpr: reuse the same lookahead so CASE/CAST/EXTRACT/INTERVAL
  parse as identifiers when used as bare column names (covers the
  last-select-item case where the line-420 `,`/AS fallback didn't fire).
- Fixtures: replace the single select_limit_as_column.sql with four
  fixtures covering the four classes — column-like tail keyword
  (LIMIT), clause-starter keyword (FROM/TO/WHERE/GROUP/ORDER),
  last-item form, and expression-starter keyword (CASE/CAST/EXTRACT/
  INTERVAL).

Existing trailing-comma fixture (select_trailing_comma_before_from_keyword_table.sql)
still passes.
Pull Request #269: fix: Allow reserved keywords as bare column names in SELECT list

47 of 65 new or added lines in 1 file covered. (72.31%)

181 existing lines in 1 file now uncovered.

8241 of 15988 relevant lines covered (51.54%)

2953.27 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

74.34
/parser/parser_column.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc