tidb
tidb copied to clipboard
bigint iota query failed
mysql
mysql> create table t1 (a bigint unsigned not null, primary key(a));
Query OK, 0 rows affected (0.30 sec)
mysql> insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
Query OK, 4 rows affected (0.04 sec)
Records: 4 Duplicates: 0 Warnings: 0
mysql> select * from t1;
+----------------------+
| a |
+----------------------+
| 18446744073709551612 |
| 18446744073709551613 |
| 18446744073709551614 |
| 18446744073709551615 |
+----------------------+
4 rows in set (0.00 sec)
mysql> select * from t1 where a=18446744073709551615;
+----------------------+
| a |
+----------------------+
| 18446744073709551615 |
+----------------------+
1 row in set (0.00 sec)
tidb
mysql> create table t1 (a bigint unsigned not null, primary key(a));
Query OK, 0 rows affected (0.02 sec)
mysql> insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
Query OK, 4 rows affected (0.00 sec)
mysql> select * from t1;
+----------------------+
| a |
+----------------------+
| 18446744073709551612 |
| 18446744073709551613 |
| 18446744073709551614 |
| 18446744073709551615 |
+----------------------+
4 rows in set (0.00 sec)
mysql> select * from t1 where a=18446744073709551615;
ERROR 1690 (22003): constant 18446744073709551615 overflows bigint
error msg:
github.com/pingcap/tidb/types/etc.go:170: [types:1690]constant 18446744073709551615 overflows bigint
github.com/pingcap/tidb/util/ranger/ranger.go:174:
github.com/pingcap/tidb/util/ranger/ranger.go:255:
github.com/pingcap/tidb/util/ranger/ranger.go:411:
github.com/pingcap/tidb/plan/physical_plan_builder.go:1019:
github.com/pingcap/tidb/plan/physical_plan_builder.go:666:
github.com/pingcap/tidb/plan/physical_plan_builder.go:558:
github.com/pingcap/tidb/plan/physical_plan_builder.go:544:
github.com/pingcap/tidb/plan/optimizer.go:151:
github.com/pingcap/tidb/plan/optimizer.go:123:
github.com/pingcap/tidb/executor/compiler.go:46:
github.com/pingcap/tidb/session.go:770:
github.com/pingcap/tidb/server/conn.go:744:
tidb-version:
| Release Version: v1.1.0-alpha-87-ge1511d0
Git Commit Hash: e1511d03aa248a69ef3589141ff9621ff4f07749
Git Branch: master
UTC Build Time: 2017-11-14 10:18:34 |
PTAL @winoros
This should be fixed after #5112
@coocood PTAL
fixed by https://github.com/pingcap/tidb/issues/5112