Skip to content

bigint unsigned range error when insert select #26977

Closed
@mjonss

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

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

mysql> create table t1 (a bigint unsigned);
Query OK, 0 rows affected (0,08 sec)

mysql> insert into t1 values (0xfffffffffffffff0);
Query OK, 1 row affected (0,04 sec)

mysql> insert into t1 select a + 1 from t1;
Query OK, 1 row affected (0,03 sec)
Records: 1  Duplicates: 0  Warnings: 0

3. What did you see instead (Required)

tidb> create table t1 (a bigint unsigned);
Query OK, 0 rows affected (0.01 sec)

tidb> insert into t1 values (0xfffffffffffffff0);
Query OK, 1 row affected (0.00 sec)

tidb> insert into t1 select a + 1 from t1;
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '(test.t1.a + 1)'
tidb> 

4. What is your TiDB version? (Required)

Release Version: v5.2.0-alpha-526-g072cf2791-dirty
Edition: Community
Git Commit Hash: 072cf27
Git Branch: hexadecimal-literals-23602
UTC Build Time: 2021-08-06 16:34:38
GoVersion: go1.16.6
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions