Skip to content

bug: The data type of the field is bigint,when you insert a value,maybe inserted with a null value. #1206

@haitaoguan

Description

@haitaoguan

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

create table ttt(id bigint unsigned);

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

mysql> insert into ttt values(9223372036854775807);
Query OK, 1 row affected (0.00 sec)

mysql> select * from ttt;
+---------------------+
| id                  |
+---------------------+
|                   0 |
| 9223372036854775807 |
+---------------------+
2 rows in set (0.00 sec)

mysql> insert into ttt values(9223372036854775808);
Query OK, 1 row affected (0.00 sec)

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

mysql> select * from ttt;
+---------------------+
| id                  |
+---------------------+
|                   0 |
| 9223372036854775807 |
|                NULL |
|                NULL |
+---------------------+
4 rows in set (0.01 sec)

mysql> insert into ttt values(9223372036854775810);
Query OK, 1 row affected (0.00 sec)

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

mysql> select * from ttt;
+----------------------+
| id                   |
+----------------------+
|                    0 |
|  9223372036854775807 |
|                 NULL |
|                 NULL |
|  9223372036854775810 |
| 18446744073709551615 |
+----------------------+
6 rows in set (0.00 sec)

mysql> insert into ttt values(18446744073709551616);
ERROR 1264 (22003): Out of range value for column 'id' at row 1

The value range is [0,18446744073709551615].However, if you insert a value(92233720368547758089223372036854775809), null is inserted by default.
mysql> create table ttt(id bigint);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into ttt values(-9223372036854775806);
Query OK, 1 row affected (0.01 sec)

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

mysql> select * from ttt;
+----------------------+
| id                   |
+----------------------+
| -9223372036854775806 |
|  9223372036854775807 |
+----------------------+
2 rows in set (0.01 sec)

mysql> insert into ttt values(-9223372036854775807);
Query OK, 1 row affected (0.00 sec)

mysql> insert into ttt values(-9223372036854775808);
Query OK, 1 row affected (0.00 sec)

mysql> select * from ttt;
+----------------------+
| id                   |
+----------------------+
| -9223372036854775806 |
|  9223372036854775807 |
|                 NULL |
|                 NULL |
+----------------------+
4 rows in set (0.01 sec)

mysql> insert into ttt values(-9223372036854775809);
ERROR 1264 (22003): Out of range value for column 'id' at row 1

The value range is [-9223372036854775808,9223372036854775807,].However, if you insert a value(-9223372036854775807-9223372036854775808), null is inserted by default.

Expected behavior

How To Reproduce

No response

Environment

./mysqld Ver 5.7.36-StoneDB-debug for Linux on x86_64 (build-)
build information as follow:
Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
Branch name: stonedb-5.7-dev
Last commit ID: 562afcb
Last commit time: Date: Mon Jan 9 07:11:42 2023 +0000
Build time: Date: Mon Jan 9 17:33:31 CST 2023

Are you interested in submitting a PR to solve the problem?

  • Yes, I will!

Metadata

Metadata

Assignees

Labels

A-bugSomething isn't workingB-storagedata type, data storage, insert,update,delete, transactionsgood first issueGood for newcomersprio: highHigh priority

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions