Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.10.3, 10.4(EOL)
-
Windows
Description
According to documentation, regarding Views: "Within a stored program, the definition cannot refer to program parameters or local variables". Apparently in practice that does not work, following code completely bypass that rule:
DELIMITER $$
|
CREATE FUNCTION f() |
RETURNS TEXT |
BEGIN
|
RETURN @d; |
END;$$ |
DELIMITER ;
|
SET @d='6'; |
CREATE VIEW v1 AS select f() AS F; |
select * FROM v1; |
Honestly, I am not complaining for that particular inconsistency, I however wonder if you intend to keep it or fix it, in future releases?
It might be useful to have an ability to manipulate views or be able to retain some of subroutine state between its consecutive executions (this way some optimizations can be done), using at least user variables.