From 0c9c4b84b79a9fb26074fbd8b8cc47cede048d3b Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 11 Aug 2016 15:47:17 +0400 Subject: MDEV-10411 Providing compatibility for basic PL/SQL constructs Part 10: Default variable value: x INT := 10; --- mysql-test/suite/compat/oracle/t/sp.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mysql-test/suite/compat/oracle/t/sp.test') diff --git a/mysql-test/suite/compat/oracle/t/sp.test b/mysql-test/suite/compat/oracle/t/sp.test index 1880f153f2a..9ac4dbc7aed 100644 --- a/mysql-test/suite/compat/oracle/t/sp.test +++ b/mysql-test/suite/compat/oracle/t/sp.test @@ -1,5 +1,21 @@ SET sql_mode=ORACLE; +--echo # Testing ":=" to set the default value of a variable +DELIMITER /; +CREATE FUNCTION f1 () RETURNS NUMBER(10) AS + a NUMBER(10) := 10; +BEGIN + DECLARE + b NUMBER(10) DEFAULT 3; + BEGIN + RETURN a+b; + END; +END; +/ +DELIMITER ;/ +SELECT f1(); +DROP FUNCTION f1; + --echo # Testing labels DELIMITER /; -- cgit v1.2.1