From 1ade2397e44d134722556518c0349607b447e0a4 Mon Sep 17 00:00:00 2001 From: Alexey Arno Date: Tue, 20 Sep 2016 17:57:22 +0300 Subject: [PATCH] dbms: Server: better [#METR-19266] --- dbms/src/DataTypes/DataTypeArray.cpp | 12 ++---------- dbms/src/DataTypes/DataTypeNullable.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/dbms/src/DataTypes/DataTypeArray.cpp b/dbms/src/DataTypes/DataTypeArray.cpp index fbb64880ae0..17715ae313b 100644 --- a/dbms/src/DataTypes/DataTypeArray.cpp +++ b/dbms/src/DataTypes/DataTypeArray.cpp @@ -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); } diff --git a/dbms/src/DataTypes/DataTypeNullable.cpp b/dbms/src/DataTypes/DataTypeNullable.cpp index d5c19d16a66..3d94469cbc1 100644 --- a/dbms/src/DataTypes/DataTypeNullable.cpp +++ b/dbms/src/DataTypes/DataTypeNullable.cpp @@ -151,7 +151,12 @@ void DataTypeNullable::serializeTextQuoted(const IColumn & column, size_t row_nu const ColumnNullable & col = static_cast(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); }