Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.3.8, 10.2, 10.3
-
None
-
MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)
OS High Sierra V10.13.6
Description
When I try to use JSON_ARRAY in a stored procedure, it outputs an array of String even though a list of Integer was given.
DELIMITER //
|
|
DROP PROCEDURE IF EXISTS test; |
|
CREATE PROCEDURE test(OUT testOutput TEXT) |
BEGIN
|
DECLARE C1 INT; |
DECLARE C2 INT; |
|
select count(*) from `tb1` into C1; |
select count(*) from `tb2` into C2; |
|
select JSON_ARRAY(C1 |
, C2) INTO testOutput; |
|
END; |
//
|
|
DELIMITER ;
|
|
CALL test(@testOutput);
|
|
SELECT @testOutput; |
output is : ["1", "2"]
If I change the last line into:
select JSON_ARRAY((select count(*) from `tb1`) |
, C2) INTO testOutput; |
output is correct as : [ 1, 2 ]