[MDEV-25142] JSON_TABLE: CREATE VIEW involving EXISTS PATH ends up with invalid frm Created: 2021-03-15  Updated: 2021-04-21  Resolved: 2021-03-16

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

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-17399 Add support for JSON_TABLE Closed
relates to MDEV-25144 JSON_TABLE: Assertion `thd->is_error(... Closed

 Description   

CREATE VIEW v AS SELECT * FROM JSON_TABLE('[]', '$' COLUMNS (f INT EXISTS PATH '$')) a ;

bb-10.6-mdev17399-psergey2 8b533cc1d5

MariaDB [test]> CREATE VIEW v AS SELECT * FROM JSON_TABLE('[]', '$' COLUMNS (f INT EXISTS PATH '$')) a ;
Query OK, 0 rows affected (0.015 sec)
 
MariaDB [test]> SELECT * FROM v;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''$')) `a`' at line 1
MariaDB [test]> show create view v;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''$')) `a`' at line 1

.frm contents:

$ cat data/test/v.frm 
TYPE=VIEW
query=select `a`.`f` AS `f` from JSON_TABLE(\'[]\', \'$\' COLUMNS (`f` int(11) EXISTS \'$\')) `a`
md5=bbd1c0cae1934192b0e8ff8a3f6c491a
updatable=1
algorithm=0
definer_user=root
definer_host=localhost
suid=2
with_check_option=0
timestamp=2021-03-15 15:10:36
create-version=2
source=SELECT * FROM JSON_TABLE(\'[]\', \'$\' COLUMNS (f INT EXISTS PATH \'$\')) a
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `a`.`f` AS `f` from JSON_TABLE(\'[]\', \'$\' COLUMNS (`f` int(11) EXISTS \'$\')) `a`
mariadb-version=100600


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