mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Fixed regression in parsing of CAST [#CLICKHOUSE-3180].
This commit is contained in:
parent
3dbde50daa
commit
2c815356c1
@ -300,6 +300,8 @@ bool ParserCastExpression::parseImpl(Pos & pos, ASTPtr & node, Expected & expect
|
||||
return false;
|
||||
|
||||
const auto & id = typeid_cast<const ASTIdentifier &>(*identifier).name;
|
||||
|
||||
/// TODO This is ridiculous. Please get rid of this.
|
||||
if (id.length() != strlen(name) || 0 != strcasecmp(id.c_str(), name))
|
||||
{
|
||||
/// Parse as a CASE expression.
|
||||
@ -340,6 +342,8 @@ bool ParserCastExpression::parseImpl(Pos & pos, ASTPtr & node, Expected & expect
|
||||
}
|
||||
else
|
||||
{
|
||||
pos = contents_begin;
|
||||
|
||||
/// CAST(expression, 'type')
|
||||
/// Reparse argument list from scratch
|
||||
ParserExpressionWithOptionalAlias expression{false};
|
||||
|
@ -0,0 +1,2 @@
|
||||
1
|
||||
1
|
2
dbms/tests/queries/0_stateless/00483_cast_syntax.sql
Normal file
2
dbms/tests/queries/0_stateless/00483_cast_syntax.sql
Normal file
@ -0,0 +1,2 @@
|
||||
SELECT CAST(1 AS Int8);
|
||||
SELECT CAST(1, 'Int8');
|
Loading…
Reference in New Issue
Block a user