Validate ClickHouseVersion format with explicit suffix parsing#2007
Open
il9ue wants to merge 1 commit into
Open
Validate ClickHouseVersion format with explicit suffix parsing#2007il9ue wants to merge 1 commit into
il9ue wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1831.
The
ClickHouseVersionparser 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 like26..1,26.1.,26.x.1and26.altinityantalyawere accepted instead of rejected withBAD_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):
CI/CD Options
Exclude tests:
Regression jobs to run: