pingcap/tidb

Able to set AUTO_INCREMENT to a value larger than maximum value of int

Open

#56 034 ouverte le 12 sept. 2024

Voir sur GitHub
 (10 commentaires) (0 réactions) (2 assignés)Go (6 186 forks)batch import
component/ddlgood first issueseverity/moderatetype/bug

Métriques du dépôt

Stars
 (40 090 stars)
Métriques de merge PR
 (Merge moyen 14j 4h) (346 PRs mergées en 30 j)

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. create a table with auto increment, and set AUTO_INCREMENT=2147483648, while max value for int is 2147483647 (https://docs.pingcap.com/tidb/stable/data-type-numeric#integer-type)
  2. insert into the value using auto increment
mysql> create table t1 (a int auto_increment) AUTO_INCREMENT=2147483648;
Query OK, 0 rows affected (0.07 sec)

mysql> insert into t1 values ();
ERROR 1690 (22003): constant 2147483648 overflows int

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

Create table should fail or user should be notified/warned in this case.

3. What did you see instead (Required)

Create table is OK, but later insert fails.

4. What is your TiDB version? (Required)

v8.4.0-alpha Edition: Community Git Commit Hash: f9c4773ba34854cec93dec3c5cae8a625925f9e9 Git Branch: heads/refs/tags/v8.4.0-alpha

Guide contributeur