Skip to content
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

create partition table error while using 'NO_UNSIGNED_SUBTRACTION sql mode #24880

Closed
aytrack opened this issue May 25, 2021 · 3 comments · Fixed by #25435
Closed

create partition table error while using 'NO_UNSIGNED_SUBTRACTION sql mode #24880

aytrack opened this issue May 25, 2021 · 3 comments · Fixed by #25435
Assignees
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@aytrack
Copy link
Contributor

aytrack commented May 25, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

SET @@sql_mode='NO_UNSIGNED_SUBTRACTION';
CREATE TABLE tu (c1 BIGINT UNSIGNED) PARTITION BY RANGE(c1 - 10) (
PARTITION p0 VALUES LESS THAN (-5),
PARTITION p1 VALUES LESS THAN (0),
PARTITION p2 VALUES LESS THAN (5),
PARTITION p3 VALUES LESS THAN (10),
PARTITION p4 VALUES LESS THAN (MAXVALUE)
);

2. What did you expect to see? (Required)

create table successfully

3. What did you see instead (Required)

MySQL root@127.0.0.1:test> SET @@sql_mode='NO_UNSIGNED_SUBTRACTION';
                       ->  CREATE TABLE tu (c1 BIGINT UNSIGNED) PARTITION BY RANGE(c1 - 10) (
                       ->  PARTITION p0 VALUES LESS THAN (-5),
                       ->  PARTITION p1 VALUES LESS THAN (0),
                       ->  PARTITION p2 VALUES LESS THAN (5),
                       ->  PARTITION p3 VALUES LESS THAN (10),
                       ->  PARTITION p4 VALUES LESS THAN (MAXVALUE)
                       ->  );
Query OK, 0 rows affected
Time: 0.002s
(1563, 'Partition constant is out of partition function domain')

4. What is your TiDB version? (Required)

master: 8c25a00
v4.0.12
v5.0.1

@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/sql-infra SIG: SQL Infra severity/major labels May 25, 2021
@AilinKid
Copy link
Contributor

/cc @mjonss

@zhuo-zhi
Copy link
Contributor

/assign

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants