mariadb/mysql-test/suite/json/t
Rucha Deodhar 85567aba45 MDEV-34081: View containing JSON_TABLE does not return JSON
Analysis:
While writing the view to .FRM file, we check the datatype of each column
and append the appropriate type to the string (which will be written to
the frm). This is where the conversion from JSON to longtext happens because
that is how it is stored internally.
Now, while SELECT, when the frm is read it has longtext instead of JSON
which also results in changing the handler type. Since the handler types
dont match, m_format_json becomes false for that specific column.
Now, when filling the values, since the format is not json, it does not
get added in the result. Hence the output is NULL.

Fix:
Before writing the view to the FRM file, check if the datatype for the
column is JSON (which means the m_format_json will be true). If it is JSON
append JSON.
2025-10-22 22:49:26 +05:30
..
json_no_table.test Merge 10.5 into 10.6 2024-10-03 09:31:39 +03:00
json_table.test MDEV-34081: View containing JSON_TABLE does not return JSON 2025-10-22 22:49:26 +05:30
json_table_binlog.test MDEV-25154: JSON_TABLE: Queries involving ordinality columns are unsafe ... 2021-05-13 15:34:25 +03:00
json_table_mysql.test MDEV-25822 JSON_TABLE: default values should allow non-string literals 2024-09-27 13:52:17 +03:00
json_table_notembedded.test MDEV-25151 JSON_TABLE: Unexpectedly padded values in a PATH column. 2021-04-21 10:21:44 +04:00
rpl_json_char.test MDEV-27018 IF and COALESCE lose "json" property 2022-01-21 19:28:48 +04:00
rpl_json_longtext.test MDEV-27018 IF and COALESCE lose "json" property 2022-01-21 19:28:48 +04:00
rpl_json_mediumtext.test MDEV-27018 IF and COALESCE lose "json" property 2022-01-21 19:28:48 +04:00
rpl_json_text.test MDEV-27018 IF and COALESCE lose "json" property 2022-01-21 19:28:48 +04:00
rpl_json_tinytext.test MDEV-27018 IF and COALESCE lose "json" property 2022-01-21 19:28:48 +04:00
rpl_json_varchar.test MDEV-27018 IF and COALESCE lose "json" property 2022-01-21 19:28:48 +04:00
type_json.test MDEV-30646 View created via JSON_ARRAYAGG returns incorrect json object 2024-04-29 13:47:45 +04:00