-
Notifications
You must be signed in to change notification settings - Fork 5.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
ddl: fix CREATE GLOBAL TEMPORARY TABLE ... LIKE creates a normal table #25644
Conversation
Signed-off-by: lihaowei <haoweili35@gmail.com>
Signed-off-by: lihaowei <haoweili35@gmail.com>
ddl/ddl_api.go
Outdated
if err = setTemporaryType(ctx, tbInfo, s); err != nil { | ||
return nil, errors.Trace(err) | ||
} | ||
if s.TemporaryKeyword == ast.TemporaryLocal { |
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.
I don't understand. Why leave this judgement out of setTemporaryType
?
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.
put it into the method would AppendWarning twice
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.
CreateTable
calls buildTableInfoWithLike
and buildTableInfoWithStmt
. So there are 2 ways:
- Call
setTemporaryType
only inCreateTable
, which is impossible. BecausesetTemporaryType
must be called in the middle ofbuildTableInfoWithStmt
, unless you remove the dependence oftbInfo.TempTableType
inbuildTableInfoWithStmt
. - Call
setTemporaryType
both inbuildTableInfoWithLike
andbuildTableInfoWithStmt
.
I meet this bug too... |
Did you meet the case |
No, I mean create a global temporary table from a normal table... |
This PR does exactly what its title says: fix CREATE GLOBAL TEMPORARY TABLE ... LIKE creates a normal table Maybe we can pay more attention to the combinations, it's a complex matrix:
|
PTAL @djshow832 |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 641bce1
|
/run-unit-tests |
ref #25724 |
What problem does this PR solve?
Issue Number: close #25613
What is changed and how it works?
Proposal: temporary table
Check List
Tests
Release note