Skip to content

Validate ClickHouseVersion format with explicit suffix parsing#2007

Open
il9ue wants to merge 1 commit into
antalya-26.3from
fix/antalya-26.3/version-parser
Open

Validate ClickHouseVersion format with explicit suffix parsing#2007
il9ue wants to merge 1 commit into
antalya-26.3from
fix/antalya-26.3/version-parser

Conversation

@il9ue

@il9ue il9ue commented Jul 6, 2026

Copy link
Copy Markdown

Fixes #1831.

The ClickHouseVersion parser introduced in #1653 stopped at the first non-numeric token and treated the rest of the string as a build suffix. However, it missed to check the suffix text, the number of numeric groups, or empty tokens, so malformed strings like 26..1, 26.1., 26.x.1 and 26.altinityantalya were accepted instead of rejected with BAD_ARGUMENTS.

This replaces the previous scan with an explicit format check. The last token is classified first, so a trailing suffix is distinguished from a malformed middle token.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All with Aarch64
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

The parser introduced in #1653 stopped at the first non-numeric token and
treated the rest of the string as a build suffix.
However, it didn't checked the suffix text, the number of components, or empty tokens,
so malformed strings like "26..1", "26.1.", "26.x.1" and "26.altinityantalya"
were silently accepted.

Replace/update the scan with an explicit format check based on the shapes that
actually occur, such as:

- 2, 3, or 4 numeric groups with no suffix, or
- exactly 4 numeric groups followed by the "altinityantalya" suffix
- every group must be a non-empty integer

anything else is rejected.
(note: Three groups is the YY.M.minor form still used upstream, so it's a normal accepted shape)

Closes #1831.
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Workflow [PR], commit [6d5f091]

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.

antalya-26.3: ClickHouseVersion parser accepts malformed version strings instead of rejecting them (PR #1653)

1 participant