Backport #70127 to 24.9: Fix wrong result with skipping index

This commit is contained in:
robot-clickhouse 2024-10-01 16:08:19 +00:00
parent 0fb2ebccd1
commit 97a8f0de7b
4 changed files with 24 additions and 0 deletions

View File

@ -100,7 +100,10 @@ void MergeTreeIndexGranuleSet::deserializeBinary(ReadBuffer & istr, MergeTreeInd
size_t rows_to_read = field_rows.safeGet<size_t>();
if (rows_to_read == 0)
{
block.clear();
return;
}
size_t num_columns = block.columns();

View File

@ -0,0 +1,2 @@
22
22

View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
$CLICKHOUSE_LOCAL -m "
CREATE TABLE t
(
c0 UInt64,
c1 String,
INDEX c1_idx c1 TYPE set(666) GRANULARITY 1
)
ENGINE = MergeTree
ORDER BY c0;
INSERT INTO t SELECT * FROM file('$CURDIR/data_i70108/repro.tsv.zstd');
SELECT count() FROM t WHERE c1 = 'dedenk1d4q' SETTINGS use_skip_indexes=1;
SELECT count() FROM t WHERE c1 = 'dedenk1d4q' SETTINGS use_skip_indexes=0;
"

Binary file not shown.