Description:
When opening a json column value by "Open Value in Editor" and going to the JSON tab, large numbers becoming negative. When applying the editor changes you can see in the command output it truly changes.
How to repeat:
Run the following script from MYSQL Workbench query tab (After connecting to a mysql):
CREATE SCHEMA `example` DEFAULT CHARACTER SET utf8 ;
CREATE TABLE `example`.`example_table` (
`id` INT NOT NULL,
`value` JSON NOT NULL,
PRIMARY KEY (`id`));
INSERT INTO `example`.`example_table` (`id`,`value`) VALUES(1, "{\"number\":999999999999999999999}");
SELECT * FROM `example`.`example_table`;
Right click on the value result of the query.
Choose "Open Value in Editor".
Go to the "JSON" tab.
You will see:
{
"number" : -9223372036854775808
}
Also applying from the editor will result with the following command:
UPDATE `example`.`example_table` SET `value`='{\n \"number\" : -9223372036854775808\n}' WHERE `id`='1';
Suggested fix:
I reported the same bug but with a smaller number in
https://bugs.mysql.com/bug.php?id=87646
I guess the answer is somewhere in the solution of this issue.
Description: When opening a json column value by "Open Value in Editor" and going to the JSON tab, large numbers becoming negative. When applying the editor changes you can see in the command output it truly changes. How to repeat: Run the following script from MYSQL Workbench query tab (After connecting to a mysql): CREATE SCHEMA `example` DEFAULT CHARACTER SET utf8 ; CREATE TABLE `example`.`example_table` ( `id` INT NOT NULL, `value` JSON NOT NULL, PRIMARY KEY (`id`)); INSERT INTO `example`.`example_table` (`id`,`value`) VALUES(1, "{\"number\":999999999999999999999}"); SELECT * FROM `example`.`example_table`; Right click on the value result of the query. Choose "Open Value in Editor". Go to the "JSON" tab. You will see: { "number" : -9223372036854775808 } Also applying from the editor will result with the following command: UPDATE `example`.`example_table` SET `value`='{\n \"number\" : -9223372036854775808\n}' WHERE `id`='1'; Suggested fix: I reported the same bug but with a smaller number in https://bugs.mysql.com/bug.php?id=87646 I guess the answer is somewhere in the solution of this issue.