-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix TRUNCATE command for temporary tables. #2624
Conversation
select * from test; | ||
|
||
select '======After Truncate And Empty======'; | ||
truncate table test; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
truncate temporary table test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temporary
isn't needed if no database prefix is specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can refer to https://github.com/zhang2014/ClickHouse/blob/960fad130ca68dc6e9e5fb282a541d3a780c2200/dbms/tests/queries/0_stateless/00564_show_tables_with_temporary.sql, They should be consistent : )
@@ -0,0 +1,16 @@ | |||
drop table if exists test; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The keyword should be uppercase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well from what I can tell there isn't a consistency or rationale about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but I think it would be better : )
{ | ||
StoragePtr table = (context.hasSessionContext() ? context.getSessionContext() : context).tryRemoveExternalTable(table_name); | ||
auto & context_handle = context.hasSessionContext() ? context.getSessionContext() : context; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why context_handle ? session_context is better ?
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en