diff --git a/dbms/src/Parsers/ExpressionElementParsers.cpp b/dbms/src/Parsers/ExpressionElementParsers.cpp index 59c63f89189..c4e43829da9 100644 --- a/dbms/src/Parsers/ExpressionElementParsers.cpp +++ b/dbms/src/Parsers/ExpressionElementParsers.cpp @@ -1026,8 +1026,7 @@ bool ParserCollectionOfLiterals::parseImpl(Pos & pos, ASTPtr & node, } else { - String message = String("comma or ") + getTokenName(closing_bracket); - expected.add(pos, message.c_str()); + expected.add(pos, "comma or closing bracket"); return false; } } diff --git a/dbms/tests/queries/0_stateless/01107_tuples_arrays_parsing_exceptions.reference b/dbms/tests/queries/0_stateless/01107_tuples_arrays_parsing_exceptions.reference new file mode 100644 index 00000000000..a589234b956 --- /dev/null +++ b/dbms/tests/queries/0_stateless/01107_tuples_arrays_parsing_exceptions.reference @@ -0,0 +1,2 @@ +Syntax error +Syntax error diff --git a/dbms/tests/queries/0_stateless/01107_tuples_arrays_parsing_exceptions.sh b/dbms/tests/queries/0_stateless/01107_tuples_arrays_parsing_exceptions.sh new file mode 100755 index 00000000000..96f4a1348a4 --- /dev/null +++ b/dbms/tests/queries/0_stateless/01107_tuples_arrays_parsing_exceptions.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +$CLICKHOUSE_CLIENT -q "SELECT (1, 2 2)" 2>&1 | grep -o "Syntax error" +$CLICKHOUSE_CLIENT -q "SELECT [1, 2 2]" 2>&1 | grep -o "Syntax error" \ No newline at end of file