MySQL Version: 8.0.27
This isn't making any sense to me. I have the following definition:
DECLARE p_array_only bool DEFAULT IFNULL(JSON_EXTRACT(in_parameters, '$.array_only'),FALSE);
If I pass a proper JSON structure of:
{"array_only":true}
I get the error:
Incorrect integer value: 'true' for column 'p_array_only' at row 1
Note if I omit the key altogether, it's fine (because IFNULL comes back as Null and sets FALSE).
What on earth is going on here? All other code assignments from JSON work perfectly fine (INT, Text, SMALLINT, and others) - in the exact same format. And I could have sworn this code worked a few months ago (back with 8.0.24).
I even tried:
IFNULL(IF(JSON_EXTRACT(@test1, '$.array_only') IS TRUE,TRUE,FALSE),FALSE)
Same error.
So how on earth can I simply cast a true/false BOOL JSON value to a BOOL MySQL value with 8.0.27?