diff options
author | Alexander Barkov <bar@mariadb.org> | 2016-08-12 14:41:13 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-04-05 15:02:42 +0400 |
commit | bd76d44564b6e23356ff7de59101cf02aee1e338 (patch) | |
tree | dfb34c5f3a6f8add89e1616115b21c39ef5b9b88 /mysql-test/suite/compat/oracle | |
parent | f3a0df72f2ea15852c53b310335dd5551ae15e67 (diff) | |
download | mariadb-git-bd76d44564b6e23356ff7de59101cf02aee1e338.tar.gz |
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.
Diffstat (limited to 'mysql-test/suite/compat/oracle')
-rw-r--r-- | mysql-test/suite/compat/oracle/r/sp.result | 24 | ||||
-rw-r--r-- | mysql-test/suite/compat/oracle/t/sp.test | 17 |
2 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/suite/compat/oracle/r/sp.result b/mysql-test/suite/compat/oracle/r/sp.result index f5569360e44..19aa220cfdf 100644 --- a/mysql-test/suite/compat/oracle/r/sp.result +++ b/mysql-test/suite/compat/oracle/r/sp.result @@ -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; diff --git a/mysql-test/suite/compat/oracle/t/sp.test b/mysql-test/suite/compat/oracle/t/sp.test index 466f89b939b..4d35d056409 100644 --- a/mysql-test/suite/compat/oracle/t/sp.test +++ b/mysql-test/suite/compat/oracle/t/sp.test @@ -1,5 +1,22 @@ SET sql_mode=ORACLE; +--echo # Testing routines with no parameters +DELIMITER /; +CREATE PROCEDURE p1 +AS +BEGIN + SET @a=10; +END; +/ +DELIMITER ;/ +--vertical_results +SHOW CREATE PROCEDURE p1; +--horizontal_results +SET @a=0; +CALL p1(); +SELECT @a; +DROP PROCEDURE p1; + --echo # Testing ":=" to set the default value of a variable DELIMITER /; CREATE FUNCTION f1 () RETURNS NUMBER(10) AS |