Don't use type conversion with String query parameters

This commit is contained in:
Nikolay Degterinsky 2023-04-10 03:39:13 +02:00 committed by GitHub
parent 8e90b7d446
commit 6b1c86c6ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,10 @@ void ReplaceQueryParameterVisitor::visitQueryParameter(ASTPtr & ast)
else
literal = temp_column[0];
ast = addTypeConversionToAST(std::make_shared<ASTLiteral>(literal), type_name);
if (typeid_cast<const DataTypeString *>(&data_type))
ast = std::make_shared<ASTLiteral>(literal);
else
ast = addTypeConversionToAST(std::make_shared<ASTLiteral>(literal), type_name);
/// Keep the original alias.
ast->setAlias(alias);