[MDEV-22294] JSON_TABLE: Cannot create a view selecting from json_table Created: 2020-04-18  Updated: 2020-06-03  Resolved: 2020-06-03

Status: Closed
Project: MariaDB Server
Component/s: JSON, Views
Affects Version/s: N/A
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-17399 Add support for JSON_TABLE Closed

 Description   

bb-10.5-hf 6dfb3fab2

MariaDB [test]> create view v as select * from json_table('{"a":"b"}',"$" columns(a varchar(8) path '$.a')) x;
ERROR 1352 (HY000): View's SELECT refers to a temporary table 'x'

It works in MySQL:

MySQL 8.0.19

MySQL [test]> create view v as select * from json_table('{"a":"b"}',"$" columns(a varchar(8) path '$.a')) x;
Query OK, 0 rows affected (0.098 sec)
 
MySQL [test]> select * from v;
+------+
| a    |
+------+
| b    |
+------+
1 row in set (0.005 sec)


Generated at Thu Feb 08 09:13:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.