Details
-
Bug
-
Status: Open (View Workflow)
-
Critical
-
Resolution: Unresolved
-
N/A
-
None
Description
A plain SP variable in a view definition is rejected at CREATE PROCEDURE with ER_VIEW_SELECT_VARIABLE; a method call on one is accepted. The view is stored without the variable and can't be used afterwards.
--delimiter $$
|
--error ER_VIEW_SELECT_VARIABLE
|
CREATE PROCEDURE p0() |
BEGIN
|
DECLARE x XMLTYPE DEFAULT '<root>9</root>'; |
CREATE VIEW v0 AS SELECT x AS c; |
END$$ |
--echo # BUG if no ER_VIEW_SELECT_VARIABLE, as for p0
|
CREATE PROCEDURE p1() |
BEGIN
|
DECLARE x XMLTYPE DEFAULT '<root>9</root>'; |
CREATE VIEW v1 AS SELECT x.getRootElement() AS c; |
END$$ |
--delimiter ;
|
CALL p1();
|
SHOW CREATE VIEW v1; |
--error ER_VIEW_INVALID
|
SELECT * FROM v1; |
DROP VIEW v1; |
DROP PROCEDURE p1; |
SHOW CREATE VIEW v1;
|
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `getRootElement`() AS `c` latin1 latin1_swedish_ci
|
Warnings:
|
Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
SELECT * FROM v1;
|
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
Attachments
Issue Links
- relates to
-
MDEV-36261 XMLTYPE: methods - step 1
-
- In Testing
-