1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-25149 JSON_TABLE: Inconsistency in implicit data type conversion.

Only return the error if field->store produced errors, not warnings.
This commit is contained in:
Alexey Botchkov
2021-04-15 11:52:22 +04:00
parent 0a09525625
commit 41e368f22d
5 changed files with 146 additions and 33 deletions

View File

@ -797,6 +797,23 @@ SELECT * FROM JSON_TABLE (CONVERT('[1,2]' USING koi8u), '$[*]' COLUMNS(a CHAR(8)
EXECUTE stmt1;
DEALLOCATE PREPARE stmt1;
--echo #
--echo # MDEV-25149 JSON_TABLE: Inconsistency in implicit data type conversion.
--echo #
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;
--echo #
--echo # MDEV-25377 JSON_TABLE: Wrong value with implicit conversion.
--echo #
select * from json_table('{"a":"foo", "b":1, "c":1000}', '$.*' columns(converted tinyint path '$', original text path '$')) as jt;
select * from json_table('{"a":"foo", "b":1, "c":1000}', '$.*' columns(converted tinyint path '$', original text path '$')) as jt order by converted;
select * from json_table('{"a":"foo", "b":1, "c":1000}', '$.*' columns(converted tinyint path '$', original text path '$')) as jt order by original;
--echo #
--echo # End of 10.6 tests
--echo #