more fixes for big endian

This commit is contained in:
Suzy Wang 2023-08-21 12:13:56 -07:00
parent 78771fc0ed
commit 6edf8f78cc
2 changed files with 7 additions and 7 deletions

View File

@ -109,7 +109,7 @@ public:
void serialize(ConstAggregateDataPtr __restrict place, WriteBuffer & buf, std::optional<size_t> /* version */) const override
{
writeBinary(this->data(place).numerator, buf);
writeBinaryLittleEndian(this->data(place).numerator, buf);
if constexpr (std::is_unsigned_v<Denominator>)
writeVarUInt(this->data(place).denominator, buf);
@ -119,7 +119,7 @@ public:
void deserialize(AggregateDataPtr __restrict place, ReadBuffer & buf, std::optional<size_t> /* version */, Arena *) const override
{
readBinary(this->data(place).numerator, buf);
readBinaryLittleEndian(this->data(place).numerator, buf);
if constexpr (std::is_unsigned_v<Denominator>)
readVarUInt(this->data(place).denominator, buf);

View File

@ -19,7 +19,7 @@ ODBCDriver2BlockOutputFormat::ODBCDriver2BlockOutputFormat(
static void writeODBCString(WriteBuffer & out, const std::string & str)
{
writeIntBinary(Int32(str.size()), out);
writePODBinaryLittleEndian(Int32(str.size()), out);
out.write(str.data(), str.size());
}
@ -33,7 +33,7 @@ void ODBCDriver2BlockOutputFormat::writeRow(const Columns & columns, size_t row_
if (column->isNullAt(row_idx))
{
writeIntBinary(Int32(-1), out);
writePODBinaryLittleEndian(Int32(-1), out);
}
else
{
@ -72,11 +72,11 @@ void ODBCDriver2BlockOutputFormat::writePrefix()
const size_t columns = header.columns();
/// Number of header rows.
writeIntBinary(Int32(2), out);
writePODBinaryLittleEndian(Int32(2), out);
/// Names of columns.
/// Number of columns + 1 for first name column.
writeIntBinary(Int32(columns + 1), out);
writePODBinaryLittleEndian(Int32(columns + 1), out);
writeODBCString(out, "name");
for (size_t i = 0; i < columns; ++i)
{
@ -85,7 +85,7 @@ void ODBCDriver2BlockOutputFormat::writePrefix()
}
/// Types of columns.
writeIntBinary(Int32(columns + 1), out);
writePODBinaryLittleEndian(Int32(columns + 1), out);
writeODBCString(out, "type");
for (size_t i = 0; i < columns; ++i)
{