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

AfterShip / clickhouse-sql-parser / 33832045281
56%
master: 56%

Build:
Build:
LAST BUILD BRANCH: fix/alter-table-settings-statement-level
DEFAULT BRANCH: master
Ran 04 Sep 2026 03:08AM UTC
Jobs 1
Files 17
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Sep 2026 03:06AM UTC coverage: 56.199% (+0.06%) from 56.14%
33832045281

Pull #320

github

Lance726
Move ALTER TABLE SETTINGS to the statement level

SETTINGS on ALTER TABLE is a query-level clause: ClickHouse accepts it
once, after the last alter clause, and rejects it mid-statement.

  -- rejected by ClickHouse
  ALTER TABLE t ADD COLUMN c Int SETTINGS alter_sync = 2, DROP COLUMN b
  -- accepted by ClickHouse
  ALTER TABLE t ADD COLUMN c Int, DROP COLUMN b SETTINGS alter_sync = 2

It was instead parsed per clause, by ADD COLUMN, ADD INDEX, DETACH
PARTITION and DROP PARTITION only, so every other form failed to parse
even though ClickHouse accepts it:

  ALTER TABLE t MODIFY COLUMN a Int64 SETTINGS alter_sync = 2
  ALTER TABLE t DROP COLUMN b SETTINGS alter_sync = 2
  ALTER TABLE t ADD COLUMN c Int, DROP COLUMN b SETTINGS alter_sync = 2
  ALTER TABLE t MATERIALIZE INDEX IF EXISTS idx SETTINGS mutations_sync = 2

Parse it once in parseAlterTable instead, after the clause list, and
reject it mid-statement as ClickHouse does.

Formatted SQL is unchanged for the clauses that already accepted
SETTINGS: only the AST placement moves, so their format/ goldens do not
change.

Breaking AST change: AlterTableAddColumn.Settings,
AlterTableAddIndex.Settings, AlterTableDetachPartition.Settings and
AlterTableDropPartition.Settings are removed in favour of
AlterTable.Settings.

Every form above was verified against clickhouse-local 26.8.2.7, in both
directions: the SQL parses here, and this parser's formatted output is
accepted by ClickHouse.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Pull Request #320: Move ALTER TABLE SETTINGS to the statement level

16 of 24 new or added lines in 4 files covered. (66.67%)

1 existing line in 1 file now uncovered.

9542 of 16979 relevant lines covered (56.2%)

4095.09 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
18.11
0.03% parser/ast.go
2
73.45
0.16% parser/parser_alter.go
2
43.2
0.04% parser/walk.go

Coverage Regressions

Lines Coverage ∆ File
1
18.11
0.03% parser/ast.go
Jobs
ID Job ID Ran Files Coverage
1 33832045281.1 04 Sep 2026 03:08AM UTC 17
56.2
GitHub Action Run
Source Files on build 33832045281
  • Tree
  • List 17
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #320
  • PR Base - master (#33618398997)
  • Delete
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