Commit 13390a70 authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-25255 JSON_TABLE: CREATE TABLE ignores NULL ON ERROR (implicit or explicit) and fails.

should not abort on field::set().
parent d2e2219e
...@@ -581,5 +581,13 @@ show warnings; ...@@ -581,5 +581,13 @@ show warnings;
Level Code Message Level Code Message
Error 4177 Can't store an array or an object in the scalar column 'a' of JSON_TABLE 't'. Error 4177 Can't store an array or an object in the scalar column 'a' of JSON_TABLE 't'.
# #
# MDEV-JSON_TABLE: CREATE TABLE ignores NULL ON ERROR (implicit or explicit) and fails.
#
CREATE TABLE t1 AS SELECT * FROM JSON_TABLE('{"x":1}', '$' COLUMNS(f DATE PATH '$.*')) AS jt;
SELECT * FROM t1;
f
NULL
DROP TABLE t1;
#
# End of 10.6 tests # End of 10.6 tests
# #
...@@ -453,6 +453,14 @@ drop table json_table; ...@@ -453,6 +453,14 @@ drop table json_table;
select a from json_table('[[]]', '$' columns(a char(8) path '$' error on error)) t; select a from json_table('[[]]', '$' columns(a char(8) path '$' error on error)) t;
show warnings; show warnings;
--echo #
--echo # MDEV-JSON_TABLE: CREATE TABLE ignores NULL ON ERROR (implicit or explicit) and fails.
--echo #
CREATE TABLE t1 AS SELECT * FROM JSON_TABLE('{"x":1}', '$' COLUMNS(f DATE PATH '$.*')) AS jt;
SELECT * FROM t1;
DROP TABLE t1;
--echo # --echo #
--echo # End of 10.6 tests --echo # End of 10.6 tests
--echo # --echo #
...@@ -325,6 +325,7 @@ int ha_json_table::fill_column_values(uchar * buf, uchar *pos) ...@@ -325,6 +325,7 @@ int ha_json_table::fill_column_values(uchar * buf, uchar *pos)
Json_table_column *jc; Json_table_column *jc;
List_iterator_fast<Json_table_column> jc_i(m_jt->m_columns); List_iterator_fast<Json_table_column> jc_i(m_jt->m_columns);
my_ptrdiff_t ptrdiff= buf - table->record[0]; my_ptrdiff_t ptrdiff= buf - table->record[0];
Abort_on_warning_instant_set ao_set(table->in_use, FALSE);
while ((jc= jc_i++)) while ((jc= jc_i++))
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment