Skip to content

Disable table function view in expression#20350

Merged
tavplubix merged 2 commits intoClickHouse:masterfrom
amosbird:tviewf
Feb 16, 2021
Merged

Disable table function view in expression#20350
tavplubix merged 2 commits intoClickHouse:masterfrom
amosbird:tviewf

Conversation

@amosbird
Copy link
Copy Markdown
Collaborator

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Check if table function view is used in expression list and throw an error. This fixes #20342

Detailed description / Documentation draft:

.

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Feb 12, 2021
@tavplubix tavplubix self-assigned this Feb 12, 2021
@tavplubix
Copy link
Copy Markdown
Member

Maybe we should forbid subqueries as function arguments on parser level? We can allow it for table functions only by passing special flag (something like is_table_function) to ParserFunction constructor from ParserTableExpression::parseImpl(...), ParserCreateTableQuery::parseImpl(...) and similar places.

@amosbird
Copy link
Copy Markdown
Collaborator Author

Maybe we should forbid subqueries as function arguments on parser level? We can allow it for table functions only by passing special flag (something like is_table_function) to ParserFunction constructor from ParserTableExpression::parseImpl(...), ParserCreateTableQuery::parseImpl(...) and similar places.

Good idea! Actually we only need to do that for ParserTableExpression.

@tavplubix tavplubix merged commit d4b2a37 into ClickHouse:master Feb 16, 2021
tavplubix added a commit that referenced this pull request Feb 19, 2021
Backport #20350 to 21.2: Disable table function view in expression
tavplubix added a commit that referenced this pull request Feb 19, 2021
Backport #20350 to 21.1: Disable table function view in expression
tavplubix added a commit that referenced this pull request Feb 19, 2021
Backport #20350 to 20.12: Disable table function view in expression
@amosbird
Copy link
Copy Markdown
Collaborator Author

amosbird commented Mar 5, 2021

There are still places where expression parser is used directly, for instance, select * from remote('127.0.0.1:9000', system.numbers, view(select 1)). https://clickhouse-test-reports.s3.yandex.net/21401/909cb3c24324e923a371255e01cbba6f0730b854/fuzzer_debug/fuzzer.log

We still need a guard in ASTFunction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logical error: trying to get name of not a column: table function view.

3 participants