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

AfterShip / clickhouse-sql-parser / 25711855554

12 May 2026 03:39AM UTC coverage: 51.621% (+0.2%) from 51.469%
25711855554

push

github

web-flow
Allow reserved keywords as bare column names in SELECT list (#269)

Extend keyword-as-identifier handling to recognize end-of-statement
(EOF or `;`) as a disambiguator in expression position, so projections
like `SELECT case`, `SELECT case;`, or `SELECT limit` parse as bare
column refs — matching ClickHouse server (verified against 25.10.7.6,
which returns UNKNOWN_IDENTIFIER, i.e. syntactic accept).

The eos check is applied inline in parseColumnExpr rather than added to
keywordIsSelectItemIdentifier, because the latter is shared with the
terminator/alias-position check, where a trailing clause-starter
keyword at EOF (e.g. `SELECT * FROM`) must still be treated as a
terminator. Verified `SELECT * FROM` still errors as before.

Fixtures:
- select_keyword_as_only_column.sql        (`SELECT interval`)
- select_keyword_as_only_column_semicolon  (`SELECT case;`)
- select_clause_keyword_as_only_column     (`SELECT limit`)
- select_keyword_as_alias                  (`SELECT 1 AS interval, 2 AS from, 3 AS limit`)

The AS-alias fixture documents that `SELECT 1 AS <reserved-kw>` already
works for every reserved keyword without special handling, because
matchTokenKind(TokenKindIdent) coerces TokenKindKeyword and so
parseIdent accepts keyword tokens as alias names; added a comment at
the AS branch of parseSelectItem to make that intentional.

8247 of 15976 relevant lines covered (51.62%)

2990.69 hits per line

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

75.58
/parser/parser_column.go


Build SHA Not Found

The commit SHA "33c6bf25c7c5bd86bec60109e38db0b15a2cd3e7" was not found in your repository, so the file cannot be loaded. This may be because you posted from a local development environment, or your CI created an ephemeral commit.

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

© 2026 Coveralls, Inc