Skip to content

fix(clickhouse): tolerate the current no-digits parse message; skip tables with an unfinished mutation - #18

Open
alexey-milovidov wants to merge 1 commit into
mainfrom
fix-nightly-parse-number-and-stuck-mutation
Open

alexey-milovidov wants to merge 1 commit into
mainfrom
fix-nightly-parse-number-and-stuck-mutation

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

This fixes two kinds of false positive that turned the ClickHouse NightlySQLancer job red on master on 2026-09-19 and 2026-09-22.

1. An outdated expected-error message. Since ClickHouse/ClickHouse#113910, the integer reader throws Cannot parse number without any digits (CANNOT_PARSE_NUMBER) for a + with no digit after it, for example -1 = '+[' or '+kui' < 917426774. getExpectedExpressionErrors was already meant to tolerate this case, but it had an older wording that is no longer in the ClickHouse tree, so it never matched. This hit CODDTest, TLPHaving and Cast. The PR adds the current wording.

2. Tables left unreadable by a failed MODIFY COLUMN. Take ALTER TABLE t2 MODIFY COLUMN c0 UInt64 on a String column that holds ''. The new type is committed to the metadata before the mutation runs, and the mutation keeps failing. After that, every read converts the old parts on the fly and throws ATTEMPT_TO_READ_AFTER_EOF, CANNOT_PARSE_NUMBER or CANNOT_PARSE_TEXT "while reading from part". The server is working as designed here (see ClickHouse/ClickHouse#116182). MaterializedCte picked such columns because they now report an exact integer type.

A table with an unfinished mutation in system.mutations now counts as not stable for repeated reads, alongside the existing FINAL-engine exclusion. That covers every oracle that picks tables through getRandomTableNonEmptyTables. I chose this over allowlisting the parse errors because the Cast oracle needs to see those errors: its 2026-09-19 finding is a real bug, fixed by ClickHouse/ClickHouse#121064.

Checked: mvn verify -DskipTests=true passes, formatter included. Against a 26.10 server, the new system.mutations query flags a table after exactly this failed MODIFY COLUMN and leaves a table whose MODIFY COLUMN succeeded unflagged.

Reports:

Related: ClickHouse/ClickHouse#113910

🤖 Generated with Claude Code

…ables with an unfinished mutation

Two false-positive classes in the `NightlySQLancer` job on ClickHouse master:

1. `Cannot parse number without any digits` (`CANNOT_PARSE_NUMBER`) is what the
   integer reader throws for a `+` with no digit after it since
   ClickHouse/ClickHouse#113910 - e.g. `-1 = '+['`,
   `'+kui' < 917426774`. The expected-expression list already meant to
   tolerate this shape but carried an old wording that is no longer in the
   ClickHouse tree, so it never matched. This hit `CODDTest`, `TLPHaving`
   and `Cast` on 2026-09-19 and 2026-09-22.

2. An `ALTER ... MODIFY COLUMN` whose conversion cannot succeed on the stored
   values (`String` -> `UInt64` over `''`) commits the new type to the
   metadata, and the mutation keeps failing. Every read of the column then
   converts the old parts on the fly and throws `ATTEMPT_TO_READ_AFTER_EOF`,
   `CANNOT_PARSE_NUMBER` or `CANNOT_PARSE_TEXT` "while reading from part".
   `MaterializedCte` picked such a column because it now has an exact integer
   type (2026-09-04, 2026-09-22 twice). A table with an unfinished mutation
   in `system.mutations` is now not stable for repeated reads, next to the
   `FINAL`-engine exclusion, so all the schema-picking oracles skip it,
   rather than whitelisting parse errors that the `Cast` oracle needs to see.

Reports:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=de0be4574c3fbe20c7c28c8633416906392e3dd7&name_0=NightlySQLancer&name_1=SQLancer%20%28arm_release%29
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=de0be4574c3fbe20c7c28c8633416906392e3dd7&name_0=NightlySQLancer&name_1=SQLancer%20%28arm_asan_ubsan%29
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=112492e63e0866e7f63a4f777358702cbd2b5844&name_0=NightlySQLancer&name_1=SQLancer%20%28arm_asan_ubsan%29

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant