fix failed uts

This commit is contained in:
taiyang-li 2024-03-20 22:08:15 +08:00
parent 49422debaf
commit 83645350fb
2 changed files with 3 additions and 3 deletions

View File

@ -241,7 +241,7 @@ namespace
bool all_ascii = UTF8::isAllASCII(reinterpret_cast<const UInt8 *>(pad_string.data()), pad_string.size())
&& UTF8::isAllASCII(chars.data(), chars.size());
if (all_ascii)
if (!is_utf8 || all_ascii)
{
PaddingChars<false> padding_chars{pad_string};
if (const auto * col_const = checkAndGetColumn<ColumnConst>(column_length.get()))

View File

@ -161,9 +161,9 @@ public:
StringRef str_ref = col_const->getDataAt(0);
bool all_ascii = UTF8::isAllASCII(reinterpret_cast<const UInt8 *>(str_ref.data), str_ref.size);
if (all_ascii)
return executeForSource(column_offset, column_length, column_offset_const, column_length_const, offset, length, ConstSource<UTF8StringSource>(*col_const), input_rows_count);
else
return executeForSource(column_offset, column_length, column_offset_const, column_length_const, offset, length, ConstSource<StringSource>(*col_const), input_rows_count);
else
return executeForSource(column_offset, column_length, column_offset_const, column_length_const, offset, length, ConstSource<UTF8StringSource>(*col_const), input_rows_count);
}
throw Exception(ErrorCodes::ILLEGAL_COLUMN, "Illegal column {} of first argument of function {}", arguments[0].column->getName(), getName());
}