Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
Implement overloading in package functions and procedures, to make it possible to declare routines with the same name but with different number of arguments. This is an SQL Standard feature.
Note: Having routines with the same name and same number of arguments, but with different argument types is also called overloading, but is not subject of this MDEV. This is not an SQL Standard feature.
to make possible declarations like this:
SET sql_mode=ORACLE; |
DELIMITER $$
|
CREATE OR REPLACE PACKAGE pkg1 |
AS
|
FUNCTION f1() RETURN INT; -- zero arguments |
FUNCTION f1(a INT) RETURN INT; -- one argument |
FUNCTION f1(a INT, b TEXT) RETURN INT; -- two arguments |
FUNCTION f1(a INT, b TEXT, c DATE, d CHAR DEFAULT 'x' ) RETURN INT; -- three or four arguments |
END; |
$$
|
Overloading will work in all sql_mode's using their respective syntax.
To support such overloading in schema routines we'll need to introduce a concept of routine's specific name, which is mangled name and is unique within a schema. CREATE and routine invocation will use routine name, but DROP and other commands (like SHOW) must use specific name. For backward compatibility and user-friendliness we'll allow DROP and other commands to use routine name, when unambiguous (not overloaded).
Attachments
Issue Links
- blocks
-
MDEV-34569 Oracle compatibility project 4
-
- Open
-
- relates to
-
MDEV-10862 Stored procedures: default values for parameters (optional parameters)
-
- Closed
-
-
MDEV-18951 Polymorphic Data Types for Functions
-
- Open
-
-
MDEV-23290 Add overloading support in MariaDB_FUNCTION_PLUGIN
-
- Open
-