Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5, 10.6, 10.10(EOL)
-
None
-
Linux
Description
Also happens with json_array()
DELIMITER //
|
CREATE OR REPLACE FUNCTION json_function_test ( a INT ) |
RETURNS JSON |
BEGIN
|
DECLARE `_id` INT UNSIGNED; |
DECLARE `_id2` INT UNSIGNED; |
DECLARE `_id3` INT UNSIGNED DEFAULT 9; |
|
SET @_temp = UNIX_TIMESTAMP(); |
SET _id = UNIX_TIMESTAMP(); |
SET _id2 = 444; |
|
return JSON_OBJECT("argument_int", a, "_id",_id, "_id2",_id2, "_id3", _id3, "temp_var", @_temp) ; |
END;// |
DELIMITER ;
|
|
select json_function_test(123); |
Everything is a string:
{"argument_int": "123", "_id": "1692396866", "_id2": "444", "_id3": "9", "temp_var": "1692396866"}
|
select JSON_OBJECT("temp_var",@_temp, "a",UNIX_TIMESTAMP()); |
| {"temp_var": "1692396982", "a": 1692397120} | |
---------------
In 10.3 in the other hand, the results are different:
select JSON_OBJECT("temp_var",@_temp, "a",UNIX_TIMESTAMP()); |
| {"temp_var": 1692397171, "a": 1692397176} | |