-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insert Json loss accuracy #11386
Comments
Got it |
add these statements as the first two statements fmt.Println("----------------call convert json to float----------------")
fmt.Println(j.Type(), j.TypeCode == json.TypeCodeUint64) case onedrop table tb4;
create table `tb4`
(
`a` json,
`b` double
);
insert into tb4 (a, b)
values ('9223372036854775808', 9223372036854775808);
select *
from tb4
where a = b; The log TiDB print is
case twodrop table tb4;
create table `tb4`
(
`a` json,
`b` double
);
insert into tb4 (a, b)
values ('9223372036854775807', 9223372036854775807);
select *
from tb4
where a = b; The log TiDB print is
|
@H-ZeX Can we close this issue now? |
@crazycs520 no, the bug has not fixed, this pr(#11355) is not to fix this issue |
Here is a pasteable testcase showing the issue is still present in master: DROP TABLE IF EXISTS t4;
CREATE TABLE t4 (a json);
INSERT INTO t4 (a) values (cast('{"a": 9223372036854775809}' as json));
INSERT INTO t4 (a) values ('{"a": 9223372036854775809}');
SELECT * FROM t4;
SELECT tidb_version()\G
..
tidb> SELECT * FROM t4;
+----------------------------+
| a |
+----------------------------+
| {"a": 9223372036854776000} |
| {"a": 9223372036854776000} |
+----------------------------+
2 rows in set (0.00 sec)
tidb> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-745-g2b0b34b88
Edition: Community
Git Commit Hash: 2b0b34b88e43ad20f4e5ab1a0b5daf7ae6ff6046
Git Branch: master
UTC Build Time: 2020-07-09 10:12:32
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec) See also #11489 -- a different set of type conversion problems with JSON, that should probably be fixed at the same time. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: