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

insert value 2^64-1(18446744073709551615) in field failed which has bigint type and AUTO_INCREMENT property #10400

Closed
zacharyzhanghao opened this issue May 9, 2019 · 2 comments

Comments

@zacharyzhanghao
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?

1.create table with bigint field and AUTO_INCREMENT
CREATE TABLE table1 (
F_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
F_name varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (F_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=200610916638

2.insert big number with 2^64-1
INSERT INTO table1 VALUES(18446744073709551615,"sunyouhong")

3.error report follow
2019/05/08 21:58:33 db.go:112: [warning] [exec][sql][USE table1; INSERT INTO table1 VALUES(18446744073709551615,"sunyouhong")][error]Error 1690: constant 18446744073709551615 overflows bigint
2019/05/08 21:58:33 loader.go:110: [fatal] Error 1690: constant 18446744073709551615 overflows bigint
/home/jenkins/workspace/build_tidb_enterprise_tools_master/go/src/github.com/pingcap/tidb-enterprise-tools/loader/db.go:80:

  1. What did you expect to see?

insert correctly.

  1. What did you see instead?

if drop AUTO_INCREMENT ,it works well
INSERT INTO table1 VALUES(18446744073709551615,"sunyouhong")
1 row in set (0.04 sec)

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    5.7.10-TiDB-v2.0.0

I guess , there is some bug while AUTO_INCREMENT and bigint UNSIGNED in one field.

@wjhuang2016
Copy link
Member

Hi, @zacharyzhanghao .
The PR #8181 had solved this problem.
I found that it had been cherry-pick into release 2.1 and not into 2.0
PTAL @XuHuaiyu

@zacharyzhanghao
Copy link
Author

Hi, @zacharyzhanghao .
The PR #8181 had solved this problem.
I found that it had been cherry-pick into release 2.1 and not into 2.0
PTAL @XuHuaiyu

ok,I see it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants