1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-25138 JSON_TABLE: A space between JSON_TABLE and opening bracket causes syntax error.

syntax fixed.
This commit is contained in:
Alexey Botchkov
2021-03-26 10:15:32 +04:00
parent 0cea1ea7d3
commit 11c8ce4348
5 changed files with 27 additions and 3 deletions

View File

@@ -559,5 +559,19 @@ DROP VIEW v;
SELECT val, MATCH(val) AGAINST( 'MariaDB') FROM JSON_TABLE('{"db":"xx"}', '$' COLUMNS(val VARCHAR(32) PATH '$**.*')) AS jt;
ERROR HY000: The storage engine JSON_TABLE function doesn't support FULLTEXT indexes
#
# MDEV-25138 JSON_TABLE: A space between JSON_TABLE and opening bracket causes syntax error
#
select * from json_table ('{}', '$' COLUMNS(x FOR ORDINALITY)) a;
x
1
create table json_table(id int);
insert into json_table values (1), (2), (3);
select * from json_table;
id
1
2
3
drop table json_table;
#
# End of 10.6 tests
#

View File

@@ -846,11 +846,11 @@ SET jt1.a=1;
ERROR HY000: The target table jt1 of the UPDATE is not updatable
DELETE JSON_TABLE(t1.c1,'$[*]' COLUMNS (a INT PATH '$.a')) AS jt1
FROM t1;
ERROR 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 'JSON_TABLE(t1.c1,'$[*]' COLUMNS (a INT PATH '$.a')) AS jt1
ERROR 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 '(t1.c1,'$[*]' COLUMNS (a INT PATH '$.a')) AS jt1
FROM t1' at line 1
DELETE t1, JSON_TABLE(t1.c1,'$[*]' COLUMNS (a INT PATH '$.a')) AS jt1
USING t1;
ERROR 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 'JSON_TABLE(t1.c1,'$[*]' COLUMNS (a INT PATH '$.a')) AS jt1
ERROR 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 '(t1.c1,'$[*]' COLUMNS (a INT PATH '$.a')) AS jt1
USING t1' at line 1
DROP TABLE t1;
#