Follow up on : Allow certain functions without parentheses in SQL #95949#98941
Merged
zlareb1 merged 7 commits intoClickHouse:masterfrom Mar 9, 2026
Conversation
Contributor
Author
|
@novikd @alexey-milovidov Can you enable CI please, CC : @zlareb1 |
Contributor
Contributor
Author
zlareb1
reviewed
Mar 8, 2026
tests/queries/0_stateless/03801_functions_without_parentheses_extra_tests.sql
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@zlareb1 merged the tests in 1 file, and tests passed I believe it is ready to merge. |
Contributor
Author
|
@zlareb1 I cannot see what is |
novikd
reviewed
Mar 9, 2026
tests/queries/0_stateless/03800_functions_without_parentheses.sql
Outdated
Show resolved
Hide resolved
auto-merge was automatically disabled
March 9, 2026 14:59
Head branch was pushed to by a user without write access
Contributor
Author
|
@zlareb1 I fixed comment by the AI, can you please reenabled auto merge ? |
Contributor
LLVM Coverage Report
PR changed lines: PR changed-lines coverage: 100.00% (7/7) |
zlareb1
added a commit
to zlareb1/ClickHouse
that referenced
this pull request
Mar 17, 2026
…NG, CASE, and JOIN contexts (PR ClickHouse#98941) PR ClickHouse#98941 fixed a bug where `allow_to_resolve_niladic_functions` was incorrectly passed as `ignore_alias` in QueryAnalyzer.cpp:1083. The existing test (03800_functions_without_parentheses) only covered niladic functions in SELECT expressions, WHERE, DEFAULT, and INSERT-SELECT. This extends the test to cover the additional SQL contexts where `tryResolveIdentifier` is called with this flag: scalar subqueries, GROUP BY, ORDER BY, HAVING, CASE expressions, and JOIN conditions. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 task
zlareb1
added a commit
to zlareb1/ClickHouse
that referenced
this pull request
Mar 17, 2026
…se#98941 fix Replace the chained-alias test case with `WITH toDate(TODAY) AS d SELECT d = today()`, which places a niladic identifier directly inside a function alias body. This is the most direct regression test for the bug fixed in ClickHouse#98941: `allow_niladic_functions` was inadvertently passed as `false` when resolving a FUNCTION-type alias node at `QueryAnalyzer.cpp:1084`, so niladic identifiers inside such alias bodies could not resolve and would throw `UNKNOWN_IDENTIFIER`. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Note
Medium Risk
Touches core identifier/alias resolution in
QueryAnalyzer, which can subtly change query semantics (especially aroundASaliases vs niladic functions) across SELECT/DEFAULT/INSERT paths.Overview
Fixes alias-based identifier resolution so when an alias points to a
FUNCTIONnode,resolveExpressionNodeis called with the correctignore_aliasandallow_niladic_functionsarguments, preventingASaliases from interfering with niladic function resolution.Extends
03800_functions_without_parenthesesto cover multiple niladic functions (e.g.DATABASE,SCHEMA,USER,CURDATE,CURRENT_TIMESTAMP) and to validate behavior inDEFAULTexpressions andINSERT ... SELECTflows, with updated expected outputs.Written by Cursor Bugbot for commit 72fc2fa. This will update automatically on new commits. Configure here.