diff --git a/src/Analyzer/QueryTreeBuilder.cpp b/src/Analyzer/QueryTreeBuilder.cpp index 0d44cf76462..a45702cf5b0 100644 --- a/src/Analyzer/QueryTreeBuilder.cpp +++ b/src/Analyzer/QueryTreeBuilder.cpp @@ -1104,8 +1104,6 @@ QueryTreeNodePtr QueryTreeBuilder::setFirstArgumentAsParameter(const ASTFunction "If groupConcat is used with two arguments, the first argument must be a constant String"); } - std::string separator = first_arg_literal->value.safeGet(); - ASTPtr second_arg = function->arguments->children[1]->clone(); auto function_node = std::make_shared(function->name); diff --git a/tests/queries/0_stateless/03156_group_concat.reference b/tests/queries/0_stateless/03156_group_concat.reference index 6f4b84fbc1d..8bf47211a1d 100644 --- a/tests/queries/0_stateless/03156_group_concat.reference +++ b/tests/queries/0_stateless/03156_group_concat.reference @@ -22,4 +22,6 @@ abc.a.makson95 [1,2,3]/[993,986,979,972]/[] [1,2,3]/[993,986,979,972]/[] [1,2,3]/[993,986,979,972]/[] +[1,2,3]/[993,986,979,972]/[] +[1,2,3]/[993,986,979,972]/[] 488890 diff --git a/tests/queries/0_stateless/03156_group_concat.sql b/tests/queries/0_stateless/03156_group_concat.sql index 719d271f4b5..eee71d9490f 100644 --- a/tests/queries/0_stateless/03156_group_concat.sql +++ b/tests/queries/0_stateless/03156_group_concat.sql @@ -48,12 +48,14 @@ TRUNCATE TABLE test_groupConcat; INSERT INTO test_groupConcat VALUES (0, 95, 'abc', [1, 2, 3]), (1, NULL, 'a', [993, 986, 979, 972]), (2, 123, 'makson95', []); -SELECT groupConcat(',', p_int) FROM test_groupConcat; -SELECT groupConcat('.')(p_string) FROM test_groupConcat; -SELECT groupConcat('/', p_array) FROM test_groupConcat; +SELECT groupConcat(',', p_int) FROM test_groupConcat SETTINGS enable_analyzer=1; +SELECT groupConcat('.')(p_string) FROM test_groupConcat SETTINGS enable_analyzer=1; +SELECT groupConcat('/', p_array) FROM test_groupConcat SETTINGS enable_analyzer=1; -SELECT group_concat('/', p_array) FROM test_groupConcat; -SELECT grouP_CONcat('/', p_array) FROM test_groupConcat; +SELECT group_concat('/', p_array) FROM test_groupConcat SETTINGS enable_analyzer=1; +SELECT grouP_CONcat('/', p_array) FROM test_groupConcat SETTINGS enable_analyzer=1; +SELECT grouP_CONcat(',')('/', p_array) FROM test_groupConcat SETTINGS enable_analyzer=1; -- overrides current parameter +SELECT grouP_CONcat(',', 2)('/', p_array) FROM test_groupConcat SETTINGS enable_analyzer=1; -- works fine with both arguments DROP TABLE IF EXISTS test_groupConcat;