Details
-
Technical task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18
Description
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
|
Attachments
Issue Links
- relates to
-
MDEV-12441 Variables declared after cursors with parameters lose value
- Closed