Alexander Barkov
08799831cc
MDEV-11880 sql_mode=ORACLE: Make the concatenation operator ignore NULL arguments
...
Now when sql_mode=ORACLE, the concatenation operator || treats
NULLs as empty strings.
Based on the contributed patch from Jérôme Brauge.
2017-04-05 15:02:55 +04:00
Alexander Barkov
46d076d67a
MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
2017-04-05 15:02:54 +04:00
Alexander Barkov
cd1afe0aac
MDEV-10588 sql_mode=ORACLE: TRUNCATE TABLE t1 [ {DROP|REUSE} STORAGE ]
2017-04-05 15:02:54 +04:00
Alexander Barkov
c0576ba5ec
MDEV-11275 sql_mode=ORACLE: CAST(..AS VARCHAR(N))
2017-04-05 15:02:54 +04:00
Alexander Barkov
f8a714c848
MDEV-10597 Cursors with parameters
2017-04-05 15:02:53 +04:00
Alexander Barkov
4ed804aa4d
MDEV-10587 sql_mode=ORACLE: User defined exceptions
2017-04-05 15:02:53 +04:00
Alexander Barkov
ffca1e4830
MDEV-10578 sql_mode=ORACLE: SP control functions SQLCODE, SQLERRM
2017-04-05 15:02:52 +04:00
Alexander Barkov
de6d40592c
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
An additional change for "Part 9: EXCEPTION handlers"
This construct:
EXCEPTION WHEN OTHERS THEN ...;
now catches warning-alike conditions, e.g. NO_DATA_FOUND.
2017-04-05 15:02:52 +04:00
Alexander Barkov
f7043858ba
MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressions
...
MDEV-10867 PREPARE..EXECUTE is not consistent about non-ASCII characters
Adding Oracle specific tests
2017-04-05 15:02:52 +04:00
Alexander Barkov
054d00a9a3
A fix for MDEV-10411 Providing compatibility for basic PL/SQL constructs (Part 6: Assignment operator)
...
Fixed that a crash in this script:
SET sql_mode=ORACLE;
max_sort_length:= 1024;
2017-04-05 15:02:52 +04:00
Alexander Barkov
7fa1ad14dc
MDEV-10840 sql_mode=ORACLE: RAISE statement for predefined exceptions
2017-04-05 15:02:51 +04:00
Alexander Barkov
76714a5c9a
MDEV-10582 sql_mode=ORACLE: explicit cursor attributes %ISOPEN, %ROWCOUNT, %FOUND, %NOTFOUND
2017-04-05 15:02:51 +04:00
Alexander Barkov
a2a196c04c
MDEV-10709 Expressions as parameters to Dynamic SQL
...
Adding Oracle-specific tests for stored functions as EXECUTE..USING parameters.
2017-04-05 15:02:50 +04:00
Alexander Barkov
417c8c9daf
MDEV-10585 EXECUTE IMMEDIATE statement
...
Adding Oracle specific tests
2017-04-05 15:02:50 +04:00
Alexander Barkov
a699a5f967
MDEV-10583 sql_mode=ORACLE: SQL%ROWCOUNT
2017-04-05 15:02:50 +04:00
Alexander Barkov
ccb91eb3ce
MDEV-10839 sql_mode=ORACLE: Predefined exceptions: TOO_MANY_ROWS, NO_DATA_FOUND, DUP_VAL_ON_INDEX
2017-04-05 15:02:50 +04:00
Alexander Barkov
c2c45c55ce
MDEV-10709 Expressions as parameters to Dynamic SQL
...
Adding Oracle specific tests
2017-04-05 15:02:49 +04:00
Alexander Barkov
c8822d71ef
MDEV-10342 Providing compatibility for basic SQL built-in functions
...
Adding the Oracle style DECODE function:
DECODE(operand, search, result [, search, result ...] [, default_result])
2017-04-05 15:02:49 +04:00
Alexander Barkov
02a72cf87c
MDEV-10596 Allow VARCHAR and VARCHAR2 without length as a data type of routine parameters and in RETURN clause
2017-04-05 15:02:49 +04:00
Alexander Barkov
ec527face3
MDEV-10801 sql_mode: dynamic SQL placeholders
2017-04-05 15:02:49 +04:00
Alexander Barkov
f564ceb473
Fixed a crash in a EXIT/CONTINUE with an unknown identifier in the WHEN clause
...
The crash happened because of a wrong reset_lex() .. restore_lex() sequence.
The Item in WHERE clause and the corresponding sp_instr_jump_if_not() were
erroneously created using different LEX.
2017-04-05 15:02:48 +04:00
Alexander Barkov
cfb6345982
Fixed that 'FOR i IN 1..10' with no spaces around '..' returned a syntax error.
...
This is a fix for "MDEV-10580 sql_mode=ORACLE: FOR loop statement"
The tokenizer now treats digits followed by two dots (e.g. '1..')
as an integer number '1' followed by DOT_DOT_SYM.
Previously this sequence was treated as a double number '1.' followed by '.'.
2017-04-05 15:02:48 +04:00
Alexander Barkov
bf573e21c7
MDEV-10580 sql_mode=ORACLE: FOR loop statement
...
Fixed a crash when trying to use a FOR loop as a compound statement
outside of an SP. A bug in 051e415d8a251bd70e9b73619dbcc40f3c65371d.
2017-04-05 15:02:48 +04:00
Alexander Barkov
30bec863cf
MDEV-10342 Providing compatibility for basic SQL built-in functions
...
Adding functions NVL() and NVL2().
2017-04-05 15:02:48 +04:00
Alexander Barkov
7e7ba7cb94
Removing SHOW FUNCTION CODE from compat/oracle.sp,
...
as this type of SHOW is only available in debug builds.
A bug in b7af3e704dd7800638ef677e9d921ad3e467a9a6.
All SHOW FUNCTION CODE queries should be in compat/oracle.sp-code.
2017-04-05 15:02:47 +04:00
Alexander Barkov
5721ea6ab7
MDEV-10579 sql_mode=ORACLE: Triggers: Understand :NEW.c1 and :OLD.c1 instead of NEW.c1 and OLD.c1
2017-04-05 15:02:47 +04:00
Alexander Barkov
ca242117ce
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 19: CONTINUE statement
2017-04-05 15:02:47 +04:00
Alexander Barkov
442ea81ed3
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Fixed that the ITERATE statement inside a FOR LOOP statement did not
increment the index variable before jumping to the beginning
of the loop, which caused the loop to repeat endlessly.
2017-04-05 15:02:47 +04:00
Alexander Barkov
2ea63492f7
MDEV-10580 sql_mode=ORACLE: FOR loop statement
...
Adding labeled FOR LOOP
2017-04-05 15:02:46 +04:00
Alexander Barkov
c570636ba2
MDEV-10580 sql_mode=ORACLE: FOR loop statement
...
Adding non-labeled FOR LOOP statement.
2017-04-05 15:02:46 +04:00
Alexander Barkov
28f2859136
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 18: WHILE syntax
2017-04-05 15:02:45 +04:00
Alexander Barkov
4212039db7
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 17: RETURN in stored procedures
2017-04-05 15:02:45 +04:00
Alexander Barkov
ed19ed6a4b
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 16: CURSOR declaration
2017-04-05 15:02:45 +04:00
Alexander Barkov
6cd24d124f
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 15: ELSIF vs ELSEIF
Also, moving tests for Oracle keywords in sql_mode=DEFAULT
from "parser.test" to a better place "keywords.test".
2017-04-05 15:02:44 +04:00
Alexander Barkov
a83d0aee96
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 5: EXIT statement
Adding optional WHEN clause:
EXIT [label] [WHEN expr]
2017-04-05 15:02:44 +04:00
Alexander Barkov
8feb984211
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 5: EXIT statement
Adding unconditional EXIT statement:
EXIT [ label ]
Conditional EXIT statements with WHERE clause
will be added in a separate patch.
2017-04-05 15:02:44 +04:00
Alexander Barkov
4b61495576
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 9: EXCEPTION handlers
EXCEPTION is now supported in inner blocks.
2017-04-05 15:02:43 +04:00
Alexander Barkov
4940a91a5f
A test clean-up for 7c78b27a33b749656cbc28091eac32bbbeee9e42
2017-04-05 15:02:42 +04:00
Alexander Barkov
81ba971d03
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
- Part 9: EXCEPTION handlers
The top-most stored routine blocks now support EXCEPTION clause
in its correct place:
AS [ declarations ]
BEGIN statements
[ EXCEPTION exceptions ]
END
Inner block will be done in a separate commit.
- Part 14: IN OUT instead of INOUT (in SP parameter declarations)
2017-04-05 15:02:42 +04:00
Alexander Barkov
0040b0f380
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 13: RETURN vs RETURNS in function definition:
CREATE FUNCTION f1(a INT) RETURN INT ...
Part 12: No parentheses if no arguments:
CREATE FUNCTION f1 RETURN INT ...
2017-04-05 15:02:42 +04:00
Alexander Barkov
bd76d44564
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.
2017-04-05 15:02:42 +04:00
Alexander Barkov
dc292bc6eb
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 11: NULL as a statement
2017-04-05 15:02:41 +04:00
Alexander Barkov
0c9c4b84b7
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 10: Default variable value: x INT := 10;
2017-04-05 15:02:41 +04:00
Alexander Barkov
8fdc1f0147
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 9: EXCEPTION handlers
- Adding exception handler syntax:
WHEN exception_name THEN statement
- Adding EXCEPTION section intoi the top BEGIN..END SP block.
Note, currently EXCEPTION goes in the beginning of the top BEGIN..END
SP block.
TODO:
- add EXCEPTION section into inner blocks
- move EXCEPTION to the end of the block
2017-04-05 15:02:41 +04:00
Alexander Barkov
a44e90ae05
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 7: variable declarations
2017-04-05 15:02:40 +04:00
Alexander Barkov
f71a1f736d
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part 4: AS/IS keyword before a function or a procedure body
2017-04-05 15:02:39 +04:00
Alexander Barkov
892af78085
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part6: assignment operator
var:= 10;
2017-04-05 15:02:39 +04:00
Alexander Barkov
7e10e38825
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Part2: Different order of IN, OUT, INOUT keywords in CREATE PROCEDURE params
2017-04-05 15:02:38 +04:00
Alexander Barkov
47a75ed7cb
MDEV-10411 Providing compatibility for basic PL/SQL constructs
...
Changing label syntax from "label:" to "<<label>>".
2017-04-05 15:02:38 +04:00
Alexander Barkov
4de26a8e0e
MDEV-10343 Providing compatibility for basic SQL data types
...
Based on the patch by Dmitry Tolpeko.
2017-04-05 15:02:38 +04:00