ISSUES-15883 support zero length argument with string type

This commit is contained in:
zhang2014 2020-10-17 13:15:00 +08:00
parent 5207be9b32
commit d084e05aba

View File

@ -384,7 +384,7 @@ static DataTypePtr create(const ASTPtr & arguments)
throw Exception("String data type family mustn't have more than one argument - size in characters", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
const auto * argument = arguments->children[0]->as<ASTLiteral>();
if (!argument || argument->value.getType() != Field::Types::UInt64 || argument->value.get<UInt64>() == 0)
if (!argument || argument->value.getType() != Field::Types::UInt64)
throw Exception("String data type family may have only a number (positive integer) as its argument", ErrorCodes::UNEXPECTED_AST_STRUCTURE);
}