- 05 Apr, 2017 40 commits
-
-
Alexander Barkov authored
-
Alexander Barkov authored
Based on a contributed patch from Jerome Brauge.
-
Alexander Barkov authored
MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop
-
Alexander Barkov authored
Implementing cursor%ROWTYPE variables, according to the task description. This patch includes a refactoring in how sp_instr_cpush and sp_instr_copen work. This is needed to implement MDEV-10598 later easier, to allow variable declarations go after cursor declarations (which is currently not allowed). Before this patch, sp_instr_cpush worked as a Query_arena associated with the cursor. sp_instr_copen::execute() switched to the sp_instr_cpush's Query_arena when executing the cursor SELECT statement. Now the Query_arena associated with the cursor is stored inside an instance of a new class sp_lex_cursor (a LEX descendand) that contains the cursor SELECT statement. This simplifies the implementation, because: - It's easier to follow the code when everything related to execution of the cursor SELECT statement is stored inside the same sp_lex_cursor object (rather than distributed between LEX and sp_instr_cpush). - It's easier to link an sp_instr_cursor_copy_struct to sp_lex_cursor rather than to sp_instr_cpush. - Also, it allows to perform sp_instr_cursor_copy_struct::exec_core() without having a pointer to sp_instr_cpush, using a pointer to sp_lex_cursor instead. This will be important for MDEV-10598, because sp_instr_cpush will happen *after* sp_instr_cursor_copy_struct. After MDEV-10598 is done, this declaration: DECLARE CURSOR cur IS SELECT * FROM t1; rec cur%ROWTYPE; BEGIN OPEN cur; FETCH cur INTO rec; CLOSE cur; END; will generate about this code: +-----+--------------------------+ | Pos | Instruction | +-----+--------------------------+ | 0 | cursor_copy_struct rec@0 | Points to sp_cursor_lex through m_lex_keeper | 1 | set rec@0 NULL | | 2 | cpush cur@0 | Points to sp_cursor_lex through m_lex_keeper | 3 | copen cur@0 | Points to sp_cursor_lex through m_cursor | 4 | cfetch cur@0 rec@0 | | 5 | cclose cur@0 | | 6 | cpop 1 | +-----+--------------------------+ Notice, "cursor_copy_struct" and "set" will go before "cpush". Instructions at positions 0, 2, 3 point to the same sp_cursor_lex instance.
-
Alexander Barkov authored
-
Alexander Barkov authored
The bug was introduced in the patch for "MDEV-10597 Cursors with parameters". The LEX created in assignment_source_expr was not put into thd->lex->sphead->m_lex (the stack of LEX'es), so syntax error in "expr" caused a wrong memory cleanup in sp_head::~sp_head(). The fix changes the code to use sp_head::push_lex() followed by sp_head::restore_lex(), like it happens in all other similar cases.
-
Alexander Barkov authored
Allowing qualified procedure names to be used without the CALL keyword: BEGIN test.p1(10); test.p2; END; Note: - COMMIT and ROLLBACK cannot be used in a direct assignment anymore: COMMIT:= 10; ROLLBACK:= 10; But as they are reserved keywords in Oracle anyway, this is not a problem. - SHUTDOWN now also cannot be used in direct a direct assignment: SHUTDOWN:=10; If this causes migration problems in the future, the grammar should be modified. Note: Variables with names COMMIT, ROLLBACK and SHUTDOWN can still be assigned with the SET statement, e.g. SET COMMIT=10;
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
MDEV-12088 sql_mode=ORACLE: Do not require BEGIN..END in multi-statement exception handlers in THEN clause
-
Alexander Barkov authored
-
halfspawn authored
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
This is covered in mysql-test/t/variables.test. There is no sense to test this for every individual variables. This is to reduce the coming soon patch for ROW-type routine variables, which will change the error from ER_PARSE_ERROR to a new error "unknown structured variable".
-
Alexander Barkov authored
-
Alexander Barkov authored
Now when sql_mode=ORACLE, the concatenation operator || treats NULLs as empty strings. Based on the contributed patch from Jérôme Brauge.
-
Alexander Barkov authored
This fixes compat/oracle.sp test failure in release builds.
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
Part 2: Moving the part of Sql_condition that contain condition items (such as m_class_origin, m_cursor_name, etc) into a separate class Sql_condition_items. This allows to remove duplicate code in different Sql_condition constructors. Also, introducing new Sql_condition constructors and removing the method Sql_condition::set(). All code sequences that called an Sql_condition constructor followed by Sql_condition::set() are now replaced to the new constructor calls. This gives light performance improvement, as the relevant members are now initialized only one time.
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
An additional change for "Part 9: EXCEPTION handlers" This construct: EXCEPTION WHEN OTHERS THEN ...; now catches warning-alike conditions, e.g. NO_DATA_FOUND.
-
Alexander Barkov authored
MDEV-10867 PREPARE..EXECUTE is not consistent about non-ASCII characters Adding Oracle specific tests
-
Alexander Barkov authored
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;
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
Fixed that EXPLAIN EXTENDED erroneously returned "SQL%%ROWCOUNT" instead of "SQL%ROWCOUNT"
-
Alexander Barkov authored
Adding Oracle-specific tests for stored functions as EXECUTE..USING parameters.
-
Alexander Barkov authored
Adding Oracle specific tests
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
Adding Oracle specific tests
-
Alexander Barkov authored
Adding the Oracle style DECODE function: DECODE(operand, search, result [, search, result ...] [, default_result])
-
Alexander Barkov authored
MDEV-10596 Allow VARCHAR and VARCHAR2 without length as a data type of routine parameters and in RETURN clause
-
Alexander Barkov authored
-