Fix: bad cast from type DB::ColumnLowCardinality to DB::ColumnString

This commit is contained in:
Igor Nikonov 2022-11-03 16:18:52 +00:00
parent 0c21434ec7
commit 3b44ac0a1d
3 changed files with 6 additions and 2 deletions

View File

@ -84,11 +84,12 @@ void SerializationString::deserializeBinary(IColumn & column, ReadBuffer & istr)
void SerializationString::serializeBinaryBulk(const IColumn & column, WriteBuffer & ostr, size_t offset, size_t limit) const
{
const ColumnString & column_string = typeid_cast<const ColumnString &>(column);
const auto & full_column = column.convertToFullColumnIfLowCardinality();
const ColumnString & column_string = typeid_cast<const ColumnString &>(*full_column);
const ColumnString::Chars & data = column_string.getChars();
const ColumnString::Offsets & offsets = column_string.getOffsets();
size_t size = column.size();
size_t size = column_string.size();
if (!size)
return;

View File

@ -0,0 +1,2 @@
bbbbb
bbbbb

View File

@ -0,0 +1 @@
SELECT if(materialize(0), extract(materialize(CAST('aaaaaa', 'LowCardinality(String)')), '\\w'), extract(materialize(CAST('bbbbb', 'LowCardinality(String)')), '\\w*')) AS res FROM numbers(2);