Implement endianness-independent serialization

This commit is contained in:
ltrk2 2023-08-21 10:35:14 -07:00
parent ec7b22d218
commit 5016257181
2 changed files with 4 additions and 4 deletions

View File

@ -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)
{

View File

@ -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