Merge pull request #47121 from liding1992/master

Fix the problem that the 'ReplicatedMergeTree' table failed to insert two similar data when the 'part_type' is configured as 'InMemory' mode.
This commit is contained in:
Sema Checherinda 2023-03-06 16:13:24 +01:00 committed by GitHub
commit 8292ffb81e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 2 deletions

View File

@ -187,8 +187,8 @@ public:
void updateHashFast(SipHash & hash) const override
{
hash.update(reinterpret_cast<const char *>(offsets.data()), size() * sizeof(offsets[0]));
hash.update(reinterpret_cast<const char *>(chars.data()), size() * sizeof(chars[0]));
hash.update(reinterpret_cast<const char *>(offsets.data()), offsets.size() * sizeof(offsets[0]));
hash.update(reinterpret_cast<const char *>(chars.data()), chars.size() * sizeof(chars[0]));
}
void insertRangeFrom(const IColumn & src, size_t start, size_t length) override;

View File

@ -0,0 +1,15 @@
-- Tags: no-s3-storage
DROP TABLE IF EXISTS inmemory_test;
CREATE TABLE inmemory_test (d Date, id String)
ENGINE=ReplicatedMergeTree('/clickhouse/tables/{database}/inmemory_test', 'r1')
PARTITION BY toYYYYMMDD(d) ORDER BY (d, id)
SETTINGS min_rows_for_compact_part = 10, index_granularity = 8192;
INSERT INTO inmemory_test(d, id) VALUES('2023-01-01', 'abcdefghijklmnopqrstuvwxyz');
INSERT INTO inmemory_test(d, id) VALUES('2023-01-01', 'a1234567890123456789012345');
SELECT COUNT(1) FROM inmemory_test;
DROP TABLE inmemory_test;