Fix: check if zero storage has zeros before clean up

This commit is contained in:
Igor Nikonov 2023-05-07 21:31:01 +00:00
parent 68fcc39292
commit ba2e827aa7
2 changed files with 8 additions and 6 deletions

View File

@ -90,7 +90,8 @@ public:
this->m_size = 0;
/// clear ZeroValueStorage
this->clearHasZero();
if (this->hasZero())
this->clearHasZero();
}
};
@ -113,7 +114,8 @@ public:
this->m_size = 0;
/// clear ZeroValueStorage
this->clearHasZero();
if (this->hasZero())
this->clearHasZero();
}
};

View File

@ -1,8 +1,8 @@
set optimize_distinct_in_order=1;
DROP TABLE IF EXISTS test;
DROP TABLE IF EXISTS test_string;
CREATE TABLE test
CREATE TABLE test_string
(
`c1` String,
`c2` String
@ -10,6 +10,6 @@ CREATE TABLE test
ENGINE = MergeTree
ORDER BY c1;
INSERT INTO test(c1, c2) VALUES ('1', ''), ('2', '');
INSERT INTO test_string(c1, c2) VALUES ('1', ''), ('2', '');
SELECT DISTINCT c2, c1 FROM test FORMAT TSV;
SELECT DISTINCT c2, c1 FROM test_string;