Merge pull request #70205 from ClickHouse/backport/24.9/70127

Backport #70127 to 24.9: Fix wrong result with skipping index
This commit is contained in:
robot-clickhouse 2024-10-01 21:02:09 +02:00 committed by GitHub
commit 9a435e4c9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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>(); size_t rows_to_read = field_rows.safeGet<size_t>();
if (rows_to_read == 0) if (rows_to_read == 0)
{
block.clear();
return; return;
}
size_t num_columns = block.columns(); 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.