-
Type:
Technical task
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 10.3.0
-
Component/s: Parser, Stored routines
-
Labels:
-
Sprint:10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18
In MariaDB variable declarations cannot go after cursor declarations.
In Oracle there is no such restriction:
DROP TABLE t1; |
DROP FUNCTION f1; |
CREATE TABLE t1 (a INT); |
INSERT INTO t1 VALUES (1); |
CREATE FUNCTION f1 RETURN INT |
AS
|
CURSOR c IS SELECT a FROM t1; |
v_a INT; |
BEGIN
|
OPEN c; |
FETCH c INTO v_a; |
CLOSE c; |
RETURN v_a; |
EXCEPTION
|
WHEN OTHERS THEN RETURN -1; |
END; |
/
|
SELECT f1() FROM DUAL; |
F1()
|
----------
|
1
|
- relates to
-
MDEV-12441 Variables declared after cursors with parameters lose value
-
- Closed
-