mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
dbms: properly resize const strings passed into toFixedString.
This commit is contained in:
parent
8e801e7163
commit
23bf89d490
@ -453,7 +453,11 @@ public:
|
||||
if (column_const->getData().size() > n)
|
||||
throw Exception("String too long for type FixedString(" + toString(n) + ")",
|
||||
ErrorCodes::TOO_LARGE_STRING_SIZE);
|
||||
block.getByPosition(result).column = new ColumnConst<String>(column_const->size(), column_const->getData(), new DataTypeFixedString(n));
|
||||
|
||||
auto resized_string = column_const->getData();
|
||||
resized_string.resize(n);
|
||||
|
||||
block.getByPosition(result).column = new ColumnConst<String>(column_const->size(), std::move(resized_string), new DataTypeFixedString(n));
|
||||
}
|
||||
else if(const ColumnString * column_string = typeid_cast<const ColumnString *>(&*column))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user