Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
bd1d6ee4
Commit
bd1d6ee4
authored
Apr 08, 2021
by
Sergei Petrunia
Committed by
Alexey Botchkov
Apr 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-25352: JSON_TABLE: Inconsistent name resolution and ER_VIEW_INVALID
Add testcase
parent
74895090
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
mysql-test/suite/json/r/json_table.result
mysql-test/suite/json/r/json_table.result
+19
-0
mysql-test/suite/json/t/json_table.test
mysql-test/suite/json/t/json_table.test
+25
-0
No files found.
mysql-test/suite/json/r/json_table.result
View file @
bd1d6ee4
...
...
@@ -675,6 +675,25 @@ json_table(JT.d, '$' COLUMNS (d for ordinality)) as JT2
ERROR 42S22: Unknown column 'JT2.d' in 'JSON_TABLE argument'
drop table t1, t2;
#
# MDEV-25352: JSON_TABLE: Inconsistent name resolution and ER_VIEW_INVALID ...
# (Just the testcase)
#
CREATE TABLE t1 (a INT, b VARCHAR(8));
INSERT INTO t1 VALUES (1,'{}'),(2,'[]');
CREATE TABLE t2 (a INT);
INSERT INTO t2 VALUES (2),(3);
SELECT t1.*
FROM
t1 NATURAL JOIN t2
RIGHT JOIN
JSON_TABLE (t1.b, '$' COLUMNS(o FOR ORDINALITY)) AS jt ON (t1.a = jt.o)
WHERE t1.a = 1;
ERROR 42S22: Unknown column 't1.b' in 'JSON_TABLE argument'
CREATE OR REPLACE VIEW v AS
SELECT t1.* FROM t1 NATURAL JOIN t2 RIGHT JOIN JSON_TABLE (t1.b, '$' COLUMNS(o FOR ORDINALITY)) AS jt ON (t1.a = jt.o) WHERE t1.a = 1;
ERROR 42S22: Unknown column 't1.b' in 'JSON_TABLE argument'
drop table t1,t2;
#
# MDEV-25256: JSON_TABLE: Error ER_VIEW_INVALID upon running query via view
#
SELECT * FROM
...
...
mysql-test/suite/json/t/json_table.test
View file @
bd1d6ee4
...
...
@@ -563,6 +563,31 @@ select * from
drop
table
t1
,
t2
;
--
echo
#
--
echo
# MDEV-25352: JSON_TABLE: Inconsistent name resolution and ER_VIEW_INVALID ...
--
echo
# (Just the testcase)
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
b
VARCHAR
(
8
));
INSERT
INTO
t1
VALUES
(
1
,
'{}'
),(
2
,
'[]'
);
CREATE
TABLE
t2
(
a
INT
);
INSERT
INTO
t2
VALUES
(
2
),(
3
);
--
error
ER_BAD_FIELD_ERROR
SELECT
t1
.*
FROM
t1
NATURAL
JOIN
t2
RIGHT
JOIN
JSON_TABLE
(
t1
.
b
,
'$'
COLUMNS
(
o
FOR
ORDINALITY
))
AS
jt
ON
(
t1
.
a
=
jt
.
o
)
WHERE
t1
.
a
=
1
;
--
error
ER_BAD_FIELD_ERROR
CREATE
OR
REPLACE
VIEW
v
AS
SELECT
t1
.*
FROM
t1
NATURAL
JOIN
t2
RIGHT
JOIN
JSON_TABLE
(
t1
.
b
,
'$'
COLUMNS
(
o
FOR
ORDINALITY
))
AS
jt
ON
(
t1
.
a
=
jt
.
o
)
WHERE
t1
.
a
=
1
;
drop
table
t1
,
t2
;
--
echo
#
--
echo
# MDEV-25256: JSON_TABLE: Error ER_VIEW_INVALID upon running query via view
--
echo
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment