-
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
planner: support foreign key choose parent schema as default in CreateTable stmt (#12548) #12675
planner: support foreign key choose parent schema as default in CreateTable stmt (#12548) #12675
Conversation
/run-all-tests |
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
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
/run-all-tests |
@sre-bot merge failed. |
/run-integration-common-test |
@bb7133, @crazycs520, PTAL. |
LGTM |
/merge |
/run-all-tests |
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
cherry-pick #12548 to release-3.0
What problem does this PR solve?
Aligned with MySQL behavior
MySQL can deal with above sql well, but TiDB will get
ERROR 1046 (3D000) at line 4: No database selected
What is changed and how it works?
if foreign key has no schema, use parent table schema
Check List
Tests
Code changes
Side effects
Related changes
Release note
CREATE TABLE
statement has no schema, schema of the created table should be used instead of returningNo Database selected
error.