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

bigint unsigned primary key duplicate error info is not correct #12420

Closed
cyliu0 opened this issue Sep 26, 2019 · 8 comments · Fixed by #22153
Closed

bigint unsigned primary key duplicate error info is not correct #12420

cyliu0 opened this issue Sep 26, 2019 · 8 comments · Fixed by #22153
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. severity/minor sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@cyliu0
Copy link
Contributor

cyliu0 commented Sep 26, 2019

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.

Check the below symptoms.

  1. What did you expect to see?
    On MySQL:
mysql> create table t(a bigint unsigned primary key);
Query OK, 0 rows affected (0.05 sec)

mysql> insert into t values(18446744073709551615);
Query OK, 1 row affected (0.01 sec)

mysql> insert into t values(18446744073709551615);
ERROR 1062 (23000): Duplicate entry '18446744073709551615' for key 'PRIMARY'
  1. What did you see instead?
    On TiDB:
mysql> create table t(a bigint unsigned primary key);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into t values(18446744073709551615);
Query OK, 1 row affected (0.01 sec)

mysql> insert into t values(18446744073709551615);
ERROR 1062 (23000): Duplicate entry '-1' for key 'PRIMARY'
mysql> select * from t;
+----------------------+
| a                    |
+----------------------+
| 18446744073709551615 |
+----------------------+
1 row in set (0.00 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-alpha-367-gde2df75a3-dirty
Git Commit Hash: de2df75a3e3cbebfa03e0d1ab33d6b70e6228eee
Git Branch: master
UTC Build Time: 2019-09-26 09:29:39
GoVersion: go version go1.12.9 darwin/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
@cyliu0 cyliu0 added the type/bug The issue is confirmed as a bug. label Sep 26, 2019
@cyliu0
Copy link
Contributor Author

cyliu0 commented Sep 26, 2019

Found this bug during review #10056 which has been fixed by #10113. Hope this might help.

@zz-jason
Copy link
Member

zz-jason commented Mar 2, 2020

Found this bug during review #10056 which has been fixed by #10113. Hope this might help.

So can we close issue?

@cyliu0
Copy link
Contributor Author

cyliu0 commented Mar 2, 2020

Found this bug during review #10056 which has been fixed by #10113. Hope this might help.

So can we close issue?

Sry if I haven't cleared this out. I mean #10113 fixed #10056. But it doesn't fix this bug. They may related to this one.

@zz-jason zz-jason added the sig/planner SIG: Planner label Mar 16, 2020
@zz-jason zz-jason added this to the v4.0.0 ga milestone Mar 16, 2020
@zz-jason zz-jason modified the milestones: v4.0.0-ga, v4.0.1 May 28, 2020
@zz-jason zz-jason removed this from the v4.0.1 milestone Jun 2, 2020
@ghost
Copy link

ghost commented Jul 24, 2020

Confirming issue still exists against master (it's minor):

drop table if exists t;
create table t(a bigint unsigned primary key);
insert into t values(18446744073709551615);
insert into t values(18446744073709551615);

..


mysql> insert into t values(18446744073709551615);
ERROR 1062 (23000): Duplicate entry '-1' for key 'PRIMARY'
mysql> 
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-821-gfe07417e6
Edition: Community
Git Commit Hash: fe07417e6b2f28eb334117d44640d0760d7e9866
Git Branch: master
UTC Build Time: 2020-07-22 12:51:37
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)

@ghost ghost added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jul 24, 2020
@tangenta tangenta self-assigned this Aug 27, 2020
@ti-srebot
Copy link
Contributor

ti-srebot commented Jan 27, 2021

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

[v3.0.0:v3.0.20], [v4.0.0:v4.0.10], [v5.0.0-rc]

6. Fixed versions

master

@ti-srebot
Copy link
Contributor

The values in ( FixedVersions ) fields are incorrect.

1 similar comment
@ti-srebot
Copy link
Contributor

The values in ( FixedVersions ) fields are incorrect.

@ti-srebot
Copy link
Contributor

The values in ( FixedVersions ) fields are incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. severity/minor sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants