1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-25379 JSON_TABLE: ERROR ON clauses are ignored if a column is not on select list.

If a field is not in the read set - read it in the local buffer anyway to check for errors.
This commit is contained in:
Alexey Botchkov
2021-04-13 14:18:04 +04:00
parent 1eda21be1f
commit 991bfebe8f
4 changed files with 42 additions and 15 deletions

View File

@@ -813,6 +813,14 @@ SUM(o)
NULL
set sql_mode=@save_sql_mode;
drop table t1;
# MDEV-25379 JSON_TABLE: ERROR ON clauses are ignored if a column is not on select list.
#
SELECT * FROM JSON_TABLE ('{}', '$' COLUMNS(a INT PATH '$.*' ERROR ON EMPTY, o FOR ORDINALITY)) AS jt;
ERROR HY000: Field 'a' can't be set for JSON_TABLE 'jt'.
SELECT o FROM JSON_TABLE ('{}', '$' COLUMNS(a INT PATH '$.*' ERROR ON EMPTY, o FOR ORDINALITY)) AS jt;
ERROR HY000: Field 'a' can't be set for JSON_TABLE 'jt'.
SELECT COUNT(*) FROM JSON_TABLE ('{}', '$' COLUMNS(a INT PATH '$.*' ERROR ON EMPTY, o FOR ORDINALITY)) AS jt;
ERROR HY000: Field 'a' can't be set for JSON_TABLE 'jt'.
#
# End of 10.6 tests
#