-
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: fix create partition table error under NO_UNSIGNED_SUBTRACTION #25435
Conversation
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, please address Jiwei's comments.
@qw4990: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
oh... I have no privilege to approve it, PTAL @wjhuang2016 |
@@ -447,6 +447,31 @@ func (ts *testSuite) TestCreatePartitionTableNotSupport(c *C) { | |||
c.Assert(ddl.ErrPartitionFunctionIsNotAllowed.Equal(err), IsTrue) | |||
} | |||
|
|||
// issue 24880 | |||
func (ts *testSuite) TestRangePartitionUnderNoUnsignedSub(c *C) { | |||
tk := testkit.NewTestKitWithInit(c, ts.store) |
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.
We‘d better check create table like
too.
c.Assert(err, NotNil) | ||
|
||
// test `create table like` | ||
tk.MustExec(`CREATE TABLE tu2 like tu;`) |
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.
MySQL:
mysql> SET @@sql_mode='NO_UNSIGNED_SUBTRACTION';
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE TABLE tu2 like tu;
Query OK, 0 rows affected (0.02 sec)
mysql> SET @@sql_mode='';
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE TABLE tu2 like tu;
ERROR 1563 (HY000): Partition constant is out of partition function domain
Sorry, I don't think you get my point. I want to ask you to test if NO_UNSIGNED_SUBTRACTION
affects create table like
. To test it, you also need to set the sql_mode
back.
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.
TiDB's create table like
will bypass partition table checks, and can successfully create the above table no matter which SQLMode it is in. This behaves different with MySQL. Should this be fixed in this pr?
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.
Also update this test in the new commit.
PTAL @wjhuang2016 |
/run-check_dev_2 |
1 similar comment
/run-check_dev_2 |
[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. |
/run-all-tests |
/merge |
@qw4990: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 43874d2
|
/run-cherry-picker |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.1 in PR #25556 |
What problem does this PR solve?
Issue Number: close #24880, related to #24150
Problem Summary:
What is changed and how it works?
What's Changed:
How it Works:
Check List
Tests
Side effects
Release note