Fix bug in delta codec caused by genious C++ implicit type conversion and consequent template type deduction

This commit is contained in:
alesapin 2019-06-28 13:42:36 +03:00
parent ab8dd1d4e3
commit cfd8df6568
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;