Commit dc292bc6 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-10411 Providing compatibility for basic PL/SQL constructs

Part 11: NULL as a statement
parent 0c9c4b84
...@@ -107,6 +107,20 @@ SELECT @p1; ...@@ -107,6 +107,20 @@ SELECT @p1;
@p1 @p1
p1new p1new
DROP PROCEDURE p1; DROP PROCEDURE p1;
# Testing that NULL is a valid statement
CREATE PROCEDURE p1(a INT) AS
BEGIN
NULL;
END;
/
DROP PROCEDURE p1;
CREATE PROCEDURE p1(a INT) AS
a INT:=10;
BEGIN
IF a=10 THEN NULL; ELSE NULL; END IF;
END;
/
DROP PROCEDURE p1;
# Testing that (some) keyword_sp are allowed in Oracle-style assignments # Testing that (some) keyword_sp are allowed in Oracle-style assignments
CREATE PROCEDURE p1 (action OUT INT) AS BEGIN action:=10; END;/ CREATE PROCEDURE p1 (action OUT INT) AS BEGIN action:=10; END;/
DROP PROCEDURE p1/ DROP PROCEDURE p1/
......
...@@ -118,6 +118,27 @@ CALL p1(@p1); ...@@ -118,6 +118,27 @@ CALL p1(@p1);
SELECT @p1; SELECT @p1;
DROP PROCEDURE p1; DROP PROCEDURE p1;
--echo # Testing that NULL is a valid statement
DELIMITER /;
CREATE PROCEDURE p1(a INT) AS
BEGIN
NULL;
END;
/
DELIMITER ;/
DROP PROCEDURE p1;
DELIMITER /;
CREATE PROCEDURE p1(a INT) AS
a INT:=10;
BEGIN
IF a=10 THEN NULL; ELSE NULL; END IF;
END;
/
DELIMITER ;/
DROP PROCEDURE p1;
--echo # Testing that (some) keyword_sp are allowed in Oracle-style assignments --echo # Testing that (some) keyword_sp are allowed in Oracle-style assignments
DELIMITER /; DELIMITER /;
CREATE PROCEDURE p1 (action OUT INT) AS BEGIN action:=10; END;/ CREATE PROCEDURE p1 (action OUT INT) AS BEGIN action:=10; END;/
......
...@@ -2879,6 +2879,7 @@ sp_proc_stmt: ...@@ -2879,6 +2879,7 @@ sp_proc_stmt:
| sp_proc_stmt_open | sp_proc_stmt_open
| sp_proc_stmt_fetch | sp_proc_stmt_fetch
| sp_proc_stmt_close | sp_proc_stmt_close
| NULL_SYM { }
; ;
sp_proc_stmt_compound_ok: sp_proc_stmt_compound_ok:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment