mariadb/mysql-test/suite/json/r
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.result MDEV-35614: JSON_UNQUOTE doesn't work with emojis 2025-04-19 08:55:05 +10:00
json_table.result MDEV-34081: View containing JSON_TABLE does not return JSON 2025-10-22 22:49:26 +05:30
json_table_binlog.result MDEV-25154: JSON_TABLE: Queries involving ordinality columns are unsafe ... 2021-05-13 15:34:25 +03:00
json_table_mysql.result MDEV-27898 CREATE VIEW AS SELECT FROM JSON_TABLE column requires global privileges 2025-10-16 10:24:29 +11:00
json_table_notembedded.result MDEV-25151 JSON_TABLE: Unexpectedly padded values in a PATH column. 2021-04-21 10:21:44 +04:00
rpl_json_char.result MDEV-27018 IF and COALESCE lose "json" property 2022-01-21 19:28:48 +04:00
rpl_json_longtext.result MDEV-27018 IF and COALESCE lose "json" property 2022-01-21 19:28:48 +04:00
rpl_json_mediumtext.result MDEV-27018 IF and COALESCE lose "json" property 2022-01-21 19:28:48 +04:00
rpl_json_text.result MDEV-27018 IF and COALESCE lose "json" property 2022-01-21 19:28:48 +04:00
rpl_json_tinytext.result MDEV-27018 IF and COALESCE lose "json" property 2022-01-21 19:28:48 +04:00
rpl_json_varchar.result MDEV-27018 IF and COALESCE lose "json" property 2022-01-21 19:28:48 +04:00
type_json.result Merge branch '10.6' into 10.11 2024-05-10 20:02:18 +02:00