Skip to content

bug: bigint boundary value problem #1344

@davidshiz

Description

@davidshiz

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

mysql> create table t1 (
    ->  value64  bigint  not null,
    ->  value32  integer          not null
    -> );
Query OK, 0 rows affected (0.02 sec)

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

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

mysql> select * from t1;
+---------------------+---------+
| value64             | value32 |
+---------------------+---------+
| 9223372036854775806 |       1 |
| 9223372036854775807 |       2 |
+---------------------+---------+
2 rows in set (0.00 sec)

mysql> select * from t1 where value64= 9223372036854775806;
+---------------------+---------+
| value64             | value32 |
+---------------------+---------+
| 9223372036854775806 |       1 |
+---------------------+---------+
1 row in set (0.00 sec)

mysql> select * from t1 where value64= 9223372036854775807;
Empty set (0.00 sec)

Expected behavior

mysql> select * from t1 where value64= 9223372036854775807;
+---------------------+---------+
| value64             | value32 |
+---------------------+---------+
| 9223372036854775807 |       2 |
+---------------------+---------+
1 row in set (0.00 sec)

How To Reproduce

create table t1 (
 value64  bigint   not null,
 value32  integer          not null
);
insert into t1 values(9223372036854775806, 1);
insert into t1 values(9223372036854775807, 2);
select * from t1 where value64= 9223372036854775807;

Environment

root@ub01:~# /stonedb57/install/bin/mysqld --version
/stonedb57/install/bin/mysqld  Ver 5.7.36-StoneDB-v1.0.2 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: 0f4250589
        Last commit time: Date:   Tue Feb 21 06:09:37 2023 +0000
        Build time: Date: Wed Feb 22 17:50:51 CST 2023
root@ub01:~# cat /etc/issue
Ubuntu 20.04.5 LTS \n \l

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

  • Yes, I will!

Metadata

Metadata

Assignees

Labels

A-bugSomething isn't workingC-stonedb-5.7associated with stonedb 5.7prio: highHigh priority

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions