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

AfterShip / clickhouse-sql-parser / 40628343801
57%
master: 57%

Build:
Build:
LAST BUILD BRANCH: column-value-without-type
DEFAULT BRANCH: master
Ran 28 Oct 2026 03:44AM UTC
Jobs 1
Files 18
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

28 Oct 2026 03:31AM UTC coverage: 56.589% (+0.02%) from 56.566%
40628343801

Pull #338

github

git-hulk
Fix modifier-only MODIFY COLUMN parsing

## Problem

Modifier-only `ALTER TABLE ... MODIFY COLUMN` can reject valid SQL or
store a modifier as `Column.Type`. In `parseTableColumnExpr`,
non-reserved keywords enter optional-type parsing before the modifier
parser sees them. This bug predates #337.

## Reproduction

```sql
ALTER TABLE t MODIFY COLUMN x CODEC(LZ4) COMMENT 'example' TTL ts;
```

Parsing succeeds, but `Column.Type` contains `CODEC(LZ4)` and
`Column.Codec` is nil. Starting with `COMMENT` instead fails to parse.

## Fix

Exclude COMMENT, CODEC and TTL from optional-type detection alongside
REMOVE. The existing modifier parser then fills their fields and rejects
duplicates, while explicit types follow the existing path.

## Test

Extend the modifier tests to cover omitted types in all six orders,
mixed keyword casing, compact and beautified AST round trips, and
duplicate or incomplete clauses. The new cases fail without the fix.
Add the reported SQL as fixtures with AST and formatting goldens.

- `make update_test` and `make test` pass with Go 1.26.3, including race
  and compatibility checks.
- `make lint` passes with golangci-lint 1.64.5 and Go 1.24.0.
- ClickHouse local 26.7.1.1315 executes the COMMENT, CODEC, TTL order on
  a MergeTree table. It rejects CODEC before COMMENT; arbitrary ordering
  is verified against the [26.8.34.13 parser source](https://github.com/ClickHouse/ClickHouse/blob/v26.8.34.13-lts/src/Parsers/ParserCreateQuery.h#L380-L407),
  rather than a running 26.8 binary.
Pull Request #338: Fix modifier-only MODIFY COLUMN parsing

1 of 1 new or added line in 1 file covered. (100.0%)

9838 of 17385 relevant lines covered (56.59%)

3681.86 hits per line

Jobs
ID Job ID Ran Files Coverage
1 40628343801.1 28 Oct 2026 03:44AM UTC 18
56.59
GitHub Action Run
Source Files on build 40628343801
  • Tree
  • List 18
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #338
  • PR Base - master (#40626500202)
  • 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