mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 03:22:14 +00:00
Implement endianness-independent serialization
This commit is contained in:
parent
ec7b22d218
commit
5016257181
@ -547,7 +547,7 @@ public:
|
||||
|
||||
/// For serialization we use signed Int32 (for historical reasons), -1 means "no value"
|
||||
Int32 size_to_write = size ? size : -1;
|
||||
writeBinary(size_to_write, buf);
|
||||
writeBinaryLittleEndian(size_to_write, buf);
|
||||
if (has())
|
||||
buf.write(getData(), size);
|
||||
}
|
||||
@ -573,7 +573,7 @@ public:
|
||||
{
|
||||
/// For serialization we use signed Int32 (for historical reasons), -1 means "no value"
|
||||
Int32 rhs_size_signed;
|
||||
readBinary(rhs_size_signed, buf);
|
||||
readBinaryLittleEndian(rhs_size_signed, buf);
|
||||
|
||||
if (rhs_size_signed < 0)
|
||||
{
|
||||
|
@ -258,12 +258,12 @@ struct AggregateFunctionSumData
|
||||
|
||||
void write(WriteBuffer & buf) const
|
||||
{
|
||||
writeBinary(sum, buf);
|
||||
writeBinaryLittleEndian(sum, buf);
|
||||
}
|
||||
|
||||
void read(ReadBuffer & buf)
|
||||
{
|
||||
readBinary(sum, buf);
|
||||
readBinaryLittleEndian(sum, buf);
|
||||
}
|
||||
|
||||
T get() const
|
||||
|
Loading…
Reference in New Issue
Block a user