PL/SQL parser
(MDEV-10142)
|
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Parser, Stored routines |
| Affects Version/s: | None |
| Fix Version/s: | 10.3.0 |
| Type: | Technical task | Priority: | Major |
| Reporter: | Dmitry Tolpeko | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Compatibility | ||
| Attachments: |
|
| Sprint: | 10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18 |
| Description |
|
Add support for PL/SQL stored procedures in MariaDB. |
| Comments |
| Comment by Dmitry Tolpeko [ 2016-07-21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2016-08-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Syntax difference: 1. [DONE] LabelsMariaDB:
Oracle:
2. [DONE] Different order of IN, OUT, INOUT keywordsMariaDB:
Oracle:
3. [DEFERRED] IN, OUT, INOUT in CREATE FUNCTION.See 4. [DONE] AS/IS keyword before a function or a procedure bodyOracle requires AS or IS keyword before the body:
5. [DONE] EXIT statementOracle supports this syntax to leave a loop block:
label is optional.
is similar to MariaDB syntax:
Note, unlike LEAVE, EXIT is valid only inside a loop block. This definition is not valid:
because EXIT is not inside a loop. 6. [DONE] Assignment operatorMariaDB:
Oracle:
Assignment operator will work for system variables:
7. [DONE] Variable declarationsIn MariaDB, the DECLARE statements are listed inside BEGIN..END blocks. One block can have multiple DECLARE statements:
In Oracle, DECLARE is a special optional section in the beginning of a DECLARE .. BEGIN .. END block. One block can have only one DECLARE section, with multiple declarations.
In the top level block variables are declared directly after the "AS" keyword:
8. [DEREFFED] Anonymous blocksSee 9. [DONE] EXCEPTION handlersMariaDB uses DECLARE HANDLER to catch exceptions:
In Oracle, exception handlers are declared in the end of a block:
OTHERS should catch all exceptions, including warnings. For example, although NO_DATA_FOUND is more like a warning than an error, it should still be handled by OTHERS.
10 [DONE] Default variable value: x INT := 10;In addition to the DEFAULT keyword, Oracle supports the := operator to assign a default value to a variable:
11. [DONE] NULL as a statementOracle does not support empty blocks with BEGIN immediately followed by END.
NULL can appear in other syntactic constructs as a statement:
12. [DONE] No parentheses if no argumentsIf a function or a procedure has no parameters, then parentheses must be omitted:
13. [DONE] RETURN vs RETURNSOracle uses RETURN rather than RETURNS:
14. [DONE] IN OUT instead of INOUTInstead of INOUT, Oracle uses two separate keywords: IN followed by OUT in an SP parameter declaration:
15. [DONE] ELSIF vs ELSEIF
16. [DONE] Cursor declarationMariaDB:
Oracle:
Example:
17. [DONE] RETURN in stored proceduresMariaDB supports RETURN only in stored functions.
18. [DONE] WHILE syntaxMariaDB:
Oracle
19. [DONE] CONTINUE statement
This is a replacement for the ITERATE statement in MariaDB. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Krishnadas [ 2016-10-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DBS Test cases MDEV-10411.txt |