Fix nullptr dereference in defaultValueOfTypeName

This commit is contained in:
Alexey Milovidov 2020-08-27 21:36:18 +03:00
parent 74d4fa3993
commit 01567d62a4
3 changed files with 3 additions and 3 deletions

View File

@ -40,9 +40,8 @@ public:
{
const ColumnConst * col_type_const = typeid_cast<const ColumnConst *>(arguments.front().column.get());
if (!col_type_const || !isString(arguments.front().type))
throw Exception("The argument of function " + getName() + " must be a constant string describing type. "
"Instead there is a column with the following structure: " + arguments.front().column->dumpStructure(),
ErrorCodes::ILLEGAL_COLUMN);
throw Exception("The argument of function " + getName() + " must be a constant string describing type.",
ErrorCodes::ILLEGAL_COLUMN);
return DataTypeFactory::instance().get(col_type_const->getValue<String>());
}

View File

@ -0,0 +1 @@
SELECT defaultValueOfTypeName(FQDN()); -- { serverError 44 }