- 05 Apr, 2017 40 commits
-
-
Alexander Barkov authored
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 '.'.
-
Alexander Barkov authored
Fixed a crash when trying to use a FOR loop as a compound statement outside of an SP. A bug in 051e415d8a251bd70e9b73619dbcc40f3c65371d.
-
Alexander Barkov authored
Adding functions NVL() and NVL2().
-
Alexander Barkov authored
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.
-
Alexander Barkov authored
-
Alexander Barkov authored
Part 19: CONTINUE statement
-
Alexander Barkov authored
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.
-
Alexander Barkov authored
Adding labeled FOR LOOP
-
Alexander Barkov authored
Adding non-labeled FOR LOOP statement.
-
Alexander Barkov authored
from "const Lex_field_type_st &" to "const Column_definition &".
-
Alexander Barkov authored
Adding methods: - LEX::sp_while_loop_expression() - LEX::sp_while_loop_finalize() to reuse code between sql_yacc.yy and sql_yacc_ora.yy. FOR loop will also reuse these methods.
-
Alexander Barkov authored
Part 18: WHILE syntax
-
Alexander Barkov authored
Part 17: RETURN in stored procedures
-
Alexander Barkov authored
Part 16: CURSOR declaration
-
Alexander Barkov authored
Part 15: ELSIF vs ELSEIF Also, moving tests for Oracle keywords in sql_mode=DEFAULT from "parser.test" to a better place "keywords.test".
-
Alexander Barkov authored
Part 5: EXIT statement Adding optional WHEN clause: EXIT [label] [WHEN expr]
-
Alexander Barkov authored
Part 5: EXIT statement Adding unconditional EXIT statement: EXIT [ label ] Conditional EXIT statements with WHERE clause will be added in a separate patch.
-
Alexander Barkov authored
Moving similar code from sql_yacc.yy and sql_yacc_ora.yy to methods: LEX::maybe_start_compound_statement() LEX::sp_push_loop_label() LEX::sp_push_loop_empty_label() LEX::sp_pop_loop_label() LEX::sp_pop_loop_empty_label() The EXIT statement will also reuse this code.
-
Alexander Barkov authored
Moving the code from *.yy to methods: LEX::sp_change_context() LEX::sp_leave_statement() LEX::sp_iterate_statement() to reuse the same code between LEAVE and ITERATE statements. EXIT statement will also reuse the same code.
-
Alexander Barkov authored
Part 9: EXCEPTION handlers EXCEPTION is now supported in inner blocks.
-
Alexander Barkov authored
When processing an SP body: CREATE PROCEDURE p1 (parameters) AS [ declarations ] BEGIN statements [ EXCEPTION exceptions ] END; the parser generates two "jump" instructions: - from the end of "declarations" to the beginning of EXCEPTION - from the end of EXCEPTION to "statements" These jumps are useless if EXCEPTION does not exist. This patch makes sure that these two "jump" instructions are generated only if EXCEPTION really exists.
-
Alexander Barkov authored
-
Alexander Barkov authored
- 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)
-
Alexander Barkov authored
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 ...
-
Alexander Barkov authored
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.
-
Alexander Barkov authored
-
Alexander Barkov authored
Part 11: NULL as a statement
-
Alexander Barkov authored
Part 10: Default variable value: x INT := 10;
-
Alexander Barkov authored
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
-
Alexander Barkov authored
Part 7: variable declarations
-
Alexander Barkov authored
-
Alexander Barkov authored
1. Adding const qualifiers into a few method parameters. 2. Adding methods: - sp_label::block_label_declare() - LEX::sp_block_init() - LEX::sp_block_finalize() to share more code between the files sql_yacc.yy and sql_yacc_ora.yy, as well as between the rules sp_labeled_block, sp_unlabeled_block, sp_unlabeled_block_not_atomic. 3. sql_yacc.yy, sql_yacc_ora.yy changes: - Removing sp_block_content - Reorganizing the grammar so the rules sp_labeled_block, sp_unlabeled_block, sp_unlabeled_block_not_atomic now contain both BEGIN_SYM and END keywords. Previously, BEGIN_SYM and END resided in different rules. This change makes the grammar easier to read, as well as simplifies adding Oracle-style DECLARE section (coming soon): DECLARE .. BEGIN .. END; Good side effects: - SP block related grammar does not use Lex->name any more. - The "splabel" member was removed from %union
-
Alexander Barkov authored
Adding: LEX::sp_variable_declarations_init() LEX::sp_variable_declarations_finalize() LEX::sp_handler_declaration_init() LEX::sp_handler_declaration_finalize() LEX::sp_declare_cursor() sp_context::declare_condition()
-
Alexander Barkov authored
In the affected test chunk in sp.test, sql_mode is set to 0xFFFFFFFF, which includes ORACLE, therefore an additional "AS" keyword is required: CREATE PROCEDURE p1() AS BEGIN END;
-
Alexander Barkov authored
Part 4: AS/IS keyword before a function or a procedure body
-
Alexander Barkov authored
Part6: assignment operator var:= 10;
-
Alexander Barkov authored
Part2: Different order of IN, OUT, INOUT keywords in CREATE PROCEDURE params
-
Alexander Barkov authored
Changing label syntax from "label:" to "<<label>>".
-
Alexander Barkov authored
Based on the patch by Dmitry Tolpeko.
-
Alexander Barkov authored
Reusing sp_create_assignment_lex() and sp_create_assignment_lex() in sql_yacc.yy and sql_yacc_ora.yy
-