Fix a possible logical error in ip_trie dictionary when key type is not String#97555
Merged
Fix a possible logical error in ip_trie dictionary when key type is not String#97555
Conversation
Contributor
|
Workflow [PR], commit [2118632] Summary: ❌
|
Algunenano
reviewed
Feb 21, 2026
Algunenano
approved these changes
Feb 22, 2026
Algunenano
pushed a commit
to Algunenano/ClickHouse
that referenced
this pull request
Feb 24, 2026
…rror-ip-address-dict Fix a possible logical error in ip_trie dictionary when key type is not String
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.
The
ip_triedictionary read path always produces a plainColumnStringfor the key regardless of the declared key type. When the key is declared as anything other thanString(e.g.Nullable(String)), the mismatch between the block header type and actual column type causes a bad cast fromColumnStringtoColumnNullableinSerializationNullable::enumerateStreams.This seems to only affect direct table reads (eg.
SELECT ... FROM dict) because:CREATE DICTIONARYdefers loading until first accessdictGet()-style queries use a separate lookup path (getColumn) that never reacheskeyViewGetter.The fix validates the key type in
keyViewGetterand rejects anything that is notString.Possibly one of the related fixes for: #97454 (repro and check: #97454 (comment))
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a possible logical error in
ip_triedictionary when key type is not String.Documentation entry for user-facing changes