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?