Hi Alexey,
Consider this:
select * from
json_table(
'{"a":[1,2]}',
'$' columns (
jsn_path json path '$.a' default '{}' on empty
)
) as tt;
MySQL produces:
+--+
| jsn_path |
+--+
| [1, 2] |
+--+
MariaDB produces:
+--+
| jsn_path |
+--+
| NUL
== Short ==
I've discovered another mismatch between MariaDB implementation and MySQL.
I don't think we need to fix it.
== Long ==
select * from
json_table(
'[{"a":"aa"}, {"b":"bb"}]',
'$[*]' columns (
col1 varchar(100) path '$.b' default 'bbb' on empty
)
) as tt;
In MySQL, this gi
== Short ==
JSON null value should be converted to SQL NULL value, but it is converted to 0
or "null" instead:
== Long ==
select * from
json_table(
'[{"a":"aa"}, {"b":null}]',
'$[*]' columns (
col1 int path '$.b' default '456' on empty
)
) as tt;
MariaDB:
+--+
| col1 |
+--+
Hi Alexey,
Consider this:
select * from
json_table(
'[{"a":"asd"},
{"a":123},
{"a":[]},
{"a":{}}
]',
'$[*]'
columns (
id for ordinality,
intcol int path '$.a' default '1234' on empty default '5678' on error
)
) as tt;
+--++
| id | intcol |
+--+-
4 matches
Mail list logo