MariaDB: inconsistent SELECT results involving JSON
1
vote
1
answer
218
views
When executing the following statments on MariaDB 10.6.14
SET @json_1 = JSON_OBJECT('id', 'name');
SET @json_result_1 = JSON_OBJECT('test', @json_1);
SELECT @json_result_1;
SET @json_result_2 = JSON_OBJECT('test', JSON_OBJECT('id', 'name'));
SELECT @json_result_2;
I receive the following results:
For
@json_result_1
:
{"test": "{\"id\": \"name\"}"}
And for @json_result_2
:
{"test": {"id": "name"}}
How does it come that I retrieve different result? Aren't those JSON string supposed to be internally all treated as TEXT?
Asked by Andreas Hinderberger
(111 rep)
Nov 17, 2023, 04:24 PM
Last activity: Jun 15, 2025, 03:06 PM
Last activity: Jun 15, 2025, 03:06 PM