Details
-
Technical task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3(EOL)
-
None
-
None
Description
The task MDEV-10577 implemented anchored data types for stored routine local variables and parameters.
- TYPE OF, for sql_mode=DEFAULT
- %TYPE, for sql_mode=ORACLE
This task will additionally allow to use anchored data types as stored function return data types:
SET sql_mode=DEFAULT; |
DROP TABLE t1; |
DROP FUNCTION f1; |
CREATE TABLE t1 (a INT); |
DELIMITER /
|
CREATE FUNCTION f1() RETURNS TYPE OF t1.a RETURN 0; |
BEGIN
|
RETURN 0; |
END; |
/
|
DELIMITER ;
|
SELECT f1() FROM DUAL; |
SET sql_mode=ORACLE; |
DROP TABLE t1; |
DROP FUNCTION f1; |
CREATE TABLE t1 (a INT); |
DELIMITER /
|
CREATE FUNCTION f1 RETURN t1.a%TYPE |
AS
|
BEGIN
|
RETURN 0; |
END; |
/
|
DELIMITER ;
|
SELECT f1() FROM DUAL; |
Attachments
Issue Links
- is duplicated by
-
MDEV-17057 %TYPE not working for function return values
- Closed
- relates to
-
MDEV-10914 ROW data type for stored routine variables
- Closed
-
MDEV-12252 ROW data type for stored function return values
- Closed