Repository navigation
Backport #117314 to 26.7: Strip FixedString padding before extracting text-index search terms - #123522
Conversation
…ng text-index search terms
|
Workflow [BackportPR], commit [73ed98b] Summary: ✅ |
# Conflicts: # src/Storages/MergeTree/MergeTreeIndexConditionText.cpp
…stant` on 26.7
On 26.7 the statistics part pruning (`use_statistics_for_part_pruning`) drops the whole part
for `s IN (SELECT toFixedString('hello', 10))` on a `FixedString(6)` column when statistics are
materialized on insert, even on a table without any skip index and with `use_skip_indexes = 0`.
`materialize_statistics_on_insert` is randomized in CI, so the test failed. This is a separate
pre-existing bug of 26.7, already absent on master, and not related to the text index change
being backported, so the test disables statistics pruning to check only the index behavior.
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=123522&sha=a8511444a682e24870d741f5bd52fcbf17911760&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20distributed%20plan%2C%20parallel%29
PR: #123522
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 Merged The failure of CREATE TABLE t (id UInt32, s FixedString(6)) ENGINE = MergeTree ORDER BY id;
INSERT INTO t VALUES (1, 'hello'), (2, 'world'), (3, 'hello'), (4, 'foobar');
SELECT count() FROM t WHERE s IN (SELECT toFixedString('hello', 10)); -- 0 on 26.7.20.1 with materialize_statistics_on_insert = 1, 2 on master (26.10)
-- EXPLAIN indexes = 1 shows: Statistics ... Parts: 0/1The test now sets @groeneai, please investigate the |
|
The master change is #109977 (merged 2026-07-29, first in #109977 fixes it by taking The set conversion is still wrong on master through the primary key: CREATE TABLE tp (id UInt32, s FixedString(6)) ENGINE = MergeTree ORDER BY s;
INSERT INTO tp VALUES (1, 'hello'), (2, 'world'), (3, 'hello'), (4, 'foobar');
SELECT count() FROM tp WHERE s IN (SELECT toFixedString('hello', 10)); -- 0 (PrimaryKey Parts: 0/1), 2 with use_primary_key = 0It returns 0 on master |
Original pull-request #117314
Cherry-pick pull-request #123480
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job
Version info
26.7.21.4