1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-10411 Providing compatibility for basic PL/SQL constructs

Part 12: No parentheses if no arguments
Now "CREATE PROCEDURE p1 AS" is supported with no parentheses after the name.
Note, "CREATE FUNCTION f1 AS" is not supported yet, due to grammar conflict
with UDFs. Functions will be done in a separate patch.
This commit is contained in:
Alexander Barkov
2016-08-12 14:41:13 +04:00
parent f3a0df72f2
commit bd76d44564
4 changed files with 127 additions and 75 deletions

View File

@ -1,4 +1,28 @@
SET sql_mode=ORACLE;
# Testing routines with no parameters
CREATE PROCEDURE p1
AS
BEGIN
SET @a=10;
END;
/
SHOW CREATE PROCEDURE p1;
Procedure p1
sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER
Create Procedure CREATE DEFINER="root"@"localhost" PROCEDURE "p1"()
AS
BEGIN
SET @a=10;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SET @a=0;
CALL p1();
SELECT @a;
@a
10
DROP PROCEDURE p1;
# Testing ":=" to set the default value of a variable
CREATE FUNCTION f1 () RETURNS NUMBER(10) AS
a NUMBER(10) := 10;