Merge pull request #5786 from yandex/awful_delta_codec_bug

Fix bug in delta codec
This commit is contained in:
alexey-milovidov 2019-06-28 14:46:05 +03:00 committed by GitHub
commit 72b0bdd0d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -48,7 +48,7 @@ void compressDataForType(const char * source, UInt32 source_size, char * dest)
while (source < source_end)
{
T curr_src = unalignedLoad<T>(source);
unalignedStore(dest, curr_src - prev_src);
unalignedStore<T>(dest, curr_src - prev_src);
prev_src = curr_src;
source += sizeof(T);

View File

@ -0,0 +1,2 @@
1111
2222

View File

@ -0,0 +1,9 @@
DROP TABLE IF EXISTS segfault_table;
CREATE TABLE segfault_table (id UInt16 CODEC(Delta(2))) ENGINE MergeTree() order by tuple();
INSERT INTO segfault_table VALUES (1111), (2222);
SELECT * FROM segfault_table;
DROP TABLE IF EXISTS segfault_table;