-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
ddl, planner, config: report unsupported for create/drop temporary table #14452
ddl, planner, config: report unsupported for create/drop temporary table #14452
Conversation
May I suggest an error message similar to "CREATE TEMPORARY TABLE is currently unsupported". The message "Unsupported temporary table" is ambiguous; it could be interpreted as temporary tables are supported, but this particular one is not. |
Hi @ffutop , thanks for your contribution! |
The implementation looks fine for me. However, changing such behaviors means a potential breakdown for TiDB users. For example, many users switched their databases from MySQL to TiDB may have their scripts with Would you please add a configuration option(naming 'compatible mode', for example)? You can check the implementation of https://github.com/pingcap/tidb/blob/master/config/config.toml.example#L61 as a reference. |
@bb7133 I think the behavior proposed here is an improvement since the case where the keyword
|
@bb7133 I'd like to take your advice. I'm not sure is it ok naming new option |
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.
Rest LGTM
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.
LGTM
|
@kennytm I can not find any mysql docs that introduce
|
@ffutop You could refer to MariaDB's documentation https://mariadb.com/kb/en/create-sequence/ for the syntax (this mostly equivalent to the "sequence generator" feature in ANSI SQL:2003, also shared by PostgreSQL, Oracle Database, Microsoft Transact-SQL, IBM DB2, and probably many other RDBMS). Anyway, my comment is that |
The support of |
…d-for-temporary-table # Conflicts: # config/config.toml.example # config/config_test.go
@bb7133 PTAL |
@ffutop, please update your pull request. |
…for-temporary-table # Conflicts: # config/config.go # config/config.toml.example # config/config_test.go # planner/core/preprocess.go # planner/core/preprocess_test.go
…d-for-temporary-table # Conflicts: # ddl/ddl.go
Codecov Report
@@ Coverage Diff @@
## master #14452 +/- ##
===========================================
Coverage 80.6165% 80.6165%
===========================================
Files 505 505
Lines 136142 136142
===========================================
Hits 109753 109753
Misses 17892 17892
Partials 8497 8497 |
config/config.toml.example
Outdated
# ignore-ddl-temporary-keyword is used to make ddl TEMPORARY keyword compatible with previous version TiDB. | ||
# turn on this option, 'TEMPORARY' will ignored by TiDB as previous. Please make sure you fully understand the negative impact. | ||
# turn off this option, use 'CREATE/DROP TEMPORARY TABLE' or 'CREATE/DROP TEMPORARY SEQUENCE' will reported an error. | ||
ignore-ddl-temporary-keyword = false |
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.
Consider an older version of TiDB, which do not have this config item in the config file, updated to this version. The default value of this item is false
, then there is chance that the application may failed to run on the newer version TiDB.
BTW, it makes user confused when we using double negation. How about renaming it to reserve-ddl-temporary-keyword
?
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.
OK, I will change the defaultConf.IgnoreDDLTemporaryKeyword
to true
.
but, I cannot agree to your renaming advice. reserve-ddl-temporary-keyword
is ambiguous compare with ignore-xxx
for new user, TEMPORARY
is standard SQL syntax, why need to reserve? set to false
might be interpreted as
- no
TEMPORARY
syntax supported for tidb, or - just ignore
TEMPORARY
@ffutop, please update your pull request. |
Hi @ffutop , please update the PR, thank you! |
@ffutop, please update your pull request. |
…for-temporary-table # Conflicts: # config/config.go # ddl/error.go
@ffutop, please update your pull request. |
1 similar comment
@ffutop, please update your pull request. |
@ffutop PR closed due to no update for a long time. Feel free to reopen it anytime. |
What problem does this PR solve?
Fix pingcap/parser#609
report unsupported error.
What is changed and how it works?
Check List
Tests