dbms: Server: better [#METR-19266]

This commit is contained in:
Alexey Arno 2016-09-20 17:57:22 +03:00
parent af84b22697
commit 1ade2397e4
2 changed files with 8 additions and 11 deletions

View File

@ -282,21 +282,13 @@ void DataTypeArray::deserializeText(IColumn & column, ReadBuffer & istr) const
void DataTypeArray::serializeTextEscaped(const IColumn & column, size_t row_num, WriteBuffer & ostr) const
{
serializeTextImpl(column, row_num, ostr,
[&](const IColumn & nested_column, size_t i)
{
nested->serializeTextEscaped(nested_column, i, ostr);
});
serializeText(column, row_num, ostr);
}
void DataTypeArray::deserializeTextEscaped(IColumn & column, ReadBuffer & istr) const
{
deserializeTextImpl(column, istr,
[&](IColumn & nested_column)
{
nested->deserializeTextEscaped(nested_column, istr);
});
deserializeText(column, istr);
}

View File

@ -151,7 +151,12 @@ void DataTypeNullable::serializeTextQuoted(const IColumn & column, size_t row_nu
const ColumnNullable & col = static_cast<const ColumnNullable &>(column);
if (col.isNullAt(row_num))
writeCString(NullSymbol::Quoted::name, ostr);
{
/// This is not a typo. We really mean "Escaped" and not "Quoted".
/// The reason is that, when displaying an array of nullable strings,
/// we want to see \N instead of NULL.
writeCString(NullSymbol::Escaped::name, ostr);
}
else
nested_data_type->serializeTextQuoted(*col.getNestedColumn(), row_num, ostr);
}