1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-10411 Providing compatibility for basic PL/SQL constructs

Part 10: Default variable value: x INT := 10;
This commit is contained in:
Alexander Barkov
2016-08-11 15:47:17 +04:00
parent 8fdc1f0147
commit 0c9c4b84b7
3 changed files with 32 additions and 0 deletions

View File

@ -1,4 +1,19 @@
SET sql_mode=ORACLE;
# Testing ":=" to set the default value of a variable
CREATE FUNCTION f1 () RETURNS NUMBER(10) AS
a NUMBER(10) := 10;
BEGIN
DECLARE
b NUMBER(10) DEFAULT 3;
BEGIN
RETURN a+b;
END;
END;
/
SELECT f1();
f1()
13
DROP FUNCTION f1;
# Testing labels
CREATE FUNCTION f1 (a INT) RETURNS CLOB AS
BEGIN