Fix FixedString packing

This commit is contained in:
Avogar 2020-04-13 00:01:17 +03:00
parent e635b0e9eb
commit b9931863ef

View File

@ -85,7 +85,6 @@ void MsgPackRowOutputFormat::serializeField(const IColumn & column, DataTypePtr
packer.pack_uint64(assert_cast<const DataTypeDateTime64::ColumnType &>(column).getElement(row_num)); packer.pack_uint64(assert_cast<const DataTypeDateTime64::ColumnType &>(column).getElement(row_num));
return; return;
} }
case TypeIndex::FixedString: [[fallthrough]];
case TypeIndex::String: case TypeIndex::String:
{ {
const StringRef & string = assert_cast<const ColumnString &>(column).getDataAt(row_num); const StringRef & string = assert_cast<const ColumnString &>(column).getDataAt(row_num);
@ -93,6 +92,13 @@ void MsgPackRowOutputFormat::serializeField(const IColumn & column, DataTypePtr
packer.pack_str_body(string.data, string.size); packer.pack_str_body(string.data, string.size);
return; return;
} }
case TypeIndex::FixedString:
{
const StringRef & string = assert_cast<const ColumnFixedString &>(column).getDataAt(row_num);
packer.pack_str(string.size);
packer.pack_str_body(string.data, string.size);
return;
}
case TypeIndex::Array: case TypeIndex::Array:
{ {
auto nested_type = assert_cast<const DataTypeArray &>(*data_type).getNestedType(); auto nested_type = assert_cast<const DataTypeArray &>(*data_type).getNestedType();