summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-11952 Oracle-style packages: stage#5mariadb-10.3.5bb-10.3-compatibilityAlexander Barkov2018-02-251-28/+333
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - CREATE PACKAGE [BODY] statements are now entirely written to mysql.proc with type='PACKAGE' and type='PACKAGE BODY'. - CREATE PACKAGE BODY now supports IF NOT EXISTS - DROP PACKAGE BODY now supports IF EXISTS - CREATE OR REPLACE PACKAGE [BODY] is now supported - CREATE PACKAGE [BODY] now support the DEFINER clause: CREATE DEFINER user@host PACKAGE pkg ... END; CREATE DEFINER user@host PACKAGE BODY pkg ... END; - CREATE PACKAGE [BODY] now supports SQL SECURITY and COMMENT clauses, e.g.: CREATE PACKAGE p1 SQL SECURITY INVOKER COMMENT "comment" AS ... END; - Package routines are now created from the package CREATE PACKAGE BODY statement and don't produce individual records in mysql.proc. - CREATE PACKAGE BODY now supports package-wide variables. Package variables can be read and set inside package routines. Package variables are stored in a separate sp_rcontext, which is cached in THD on the first packate routine call. - CREATE PACKAGE BODY now supports the initialization section. - All public routines (i.e. declared in CREATE PACKAGE) must have implementations in CREATE PACKAGE BODY - Only public package routines are available outside of the package - {CREATE|DROP} PACKAGE [BODY] now respects CREATE ROUTINE and ALTER ROUTINE privileges - "GRANT EXECUTE ON PACKAGE BODY pkg" is now supported - SHOW CREATE PACKAGE [BODY] is now supported - SHOW PACKAGE [BODY] STATUS is now supported - CREATE and DROP for PACKAGE [BODY] now works for non-current databases - mysqldump now supports packages - "SHOW {PROCEDURE|FUNCTION) CODE pkg.routine" now works for package routines - "SHOW PACKAGE BODY CODE pkg" now works (the package initialization section) - A new package body level MDL was added - Recursive calls for package procedures are now possible - Routine forward declarations in CREATE PACKATE BODY are now supported. - Package body variables now work as SP OUT parameters - Package body variables now work as SELECT INTO targets - Package body variables now support ROW, %ROWTYPE, %TYPE
* Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-151-28/+10
|\
| * Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2018-02-081-28/+10
| |\
| | * Merge branch 'github/10.1' into 10.2Sergei Golubchik2018-02-061-28/+7
| | |\
| | | * MDEV-14857: problem with 10.2.11 server crashing when executing stored procedureOleksandr Byelkin2018-02-011-28/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Counter for select numbering made stored with the statement (before was global) So now it does have always accurate value which does not depend on interruption of statement prepare by errors like lack of table in a view definition.
| | * | Ensure that thd->user_var_events_alloc is always relevantMonty2018-02-011-1/+4
| | | | | | | | | | | | | | | | | | | | If binary logging is not enabled thd->user_var_events_alloc would never be initialized.
* | | | MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-19/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
* | | | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2018-02-041-11/+13
|\ \ \ \ | |/ / /
| * | | Added name to MEM_ROOT for esier debuggingMonty2018-02-021-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will make it easier to how memory allocation is done when debugging with either DBUG or gdb. Will especially help when debugging stored procedures Main change is a name argument as second argument to init_alloc_root() init_sql_alloc() Other things: - Added DBUG_ENTER/EXIT to some Virtual_tmp_table functions
| * | | A cleanup in sp_rcontext, as requested by MontyAlexander Barkov2018-01-311-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Changing sp_rcontext::m_var_items from list of Item to list of Item_field - Renaming sp_rcontext::get_item() to get_variable() and changing its return type from Item* to Item_field * - Adding sp_rcontext::get_parameter() and sp_rcontext::set_parameter(), wrappers for get_variable() and set_variable() with extra DBUG_ASSERT. Using new methods instead of get_variable()/set_variable() in relevant places.
* | | | Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-30/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done in, among other things: - thd->db and thd->db_length - TABLE_LIST tablename, db, alias and schema_name - Audit plugin database name - lex->db - All db and table names in Alter_table_ctx - st_select_lex db Other things: - Changed a lot of functions to take const LEX_CSTRING* as argument for db, table_name and alias. See init_one_table() as an example. - Changed some function arguments from LEX_CSTRING to const LEX_CSTRING - Changed some lists from LEX_STRING to LEX_CSTRING - threads_mysql.result changed because process list_db wasn't always correctly updated - New append_identifier() function that takes LEX_CSTRING* as arguments - Added new element tmp_buff to Alter_table_ctx to separate temp name handling from temporary space - Ensure we store the length after my_casedn_str() of table/db names - Removed not used version of rename_table_in_stat_tables() - Changed Natural_join_column::table_name and db_name() to never return NULL (used for print) - thd->get_db() now returns db as a printable string (thd->db.str or "")
* | | | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2018-01-291-104/+30
|\ \ \ \ | |/ / /
| * | | MDEV-15107 Add virtual Field::sp_prepare_and_store_item(), make sp_rcontext ↵Alexander Barkov2018-01-291-104/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | symmetric for scalar and ROW After MDEV-14212, the Virtual_tmp_table instance that stores a ROW variable elements is accessible from the underlying Field_row (rather than Item_field_row). This patch makes some further changes by moving the code from sp_instr_xxx, sp_rcontext, Item_xxx to Virtual_tmp_table and Field_xxx. The data type specific code (scalar vs ROW) now resides in a new virtual method Field_xxx::sp_prepare_and_store_item(). The the code in sp_rcontext::set_variable() and sp_eval_expr() is now symmetric for scalar and ROW values. The code in sp_rcontext::set_variable_row_field(), sp_rcontext::set_variable_row_field(), sp_rcontext::set_variable_row() is now symmetric for ROW elements (i.e. scalar and ROW elements inside a ROW). Rationale: Prepare the code to implement these tasks soon easier: - MDEV-12252 ROW data type for stored function return values - MDEV-12307 ROW data type for built-in function return values - MDEV-6121 Data type: Array - MDEV-10593 sql_mode=ORACLE: TYPE .. AS OBJECT: basic functionality - ROW with ROW fields (no MDEV yet) Details: 1. Moving the code in sp_eval_expr() responsible to backup/restore thd->count_cuted_fields, thd->abort_on_warning, thd->transaction.stmt.modified_non_trans_table into a new helper class Sp_eval_expr_state, to reuse it easier. Fixing sp_eval_expr() to use this new class. 2. Moving sp_eval_expr() and sp_prepare_func_item() from public functions to methods in THD, so they can be reused in *.cc files easier without a need to include "sp_head.h". Splitting sp_prepare_func_item() into two parts. Adding a new function sp_fix_func_item(), which fixes the underlying items, but does not do check_cols() for them. Reusing sp_fix_func_item() in Field_row::sp_prepare_and_store_item(). 3. Moving the code to find ROW fields by name from Item to Virtual_tmp_table Moving the code searching for ROW fields by their names from Item_field_row::element_index_by_name() to a new method Item_field_row to Virtual_tmp_table::sp_find_field_by_name(). Adding wrapper methods sp_rcontext::find_row_field_by_name() and find_row_field_by_name_or_error(), to search for a ROW variable fields by the variable offset and its field name. Changing Item_splocal_row_field_by_name::fix_fields() to do use sp_rcontext::find_row_field_by_name_or_error(). Removing virtual Item::element_index_by_name(). 4. Splitting sp_rcontext::set_variable() Adding a new virtual method Field::sp_prepare_and_store_item(). Spliting the two branches of the code in sp_rcontext::set_variable() into two virtual implementations of Field::sp_prepare_and_store_item(), (for Field and for Field_row). Moving the former part of sp_rcontext::set_variable() with the loop doing set_null() for all ROW fields into a new method Virtual_tmp_table::set_all_fields_to_null() and using it in Field_row::sp_prepare_and_store_item(). Moving the former part of sp_rcontext::set_variable() with the loop doing set_variable_row_field() into a new method Virtual_tmp_table::set_all_fields_from_item() and using it in Field_row::sp_prepare_and_store_item(). The loop in the new method now uses sp_prepare_and_store_item() instead of set_variable_row_field(), because saving/restoring THD flags is now done on the upper level. No needs to save/restore on every iteration. 5. Fixing sp_eval_expr() to simply do two things: - backup/restore THD flags - call result_field->sp_prepare_and_store_item() So now sp_eval_expr() can be used for both scalar and ROW variables. Reusing it in sp_rcontext::set_variable*(). 6. Moving the loop in sp_rcontext::set_variable_row() into a new method Virtual_tmp_table::sp_set_all_fields_from_item_list(). Changing the loop body to call field->sp_prepare_and_store_item() instead of doing set_variable_row_field(). This removes saving/restoring of the THD flags from every interation. Instead, adding the code to save/restore the flags around the entire loop in set_variable_row(), using Sp_eval_expr_state. So now saving/restoring is done only once for the entire ROW (a slight performance improvement). 7. Removing the code in sp_instr_set::exec_core() that sets a variable to NULL if the value evaluation failed. sp_rcontext::set_variable() now makes sure to reset the variable properly by effectively calling sp_eval_expr(), which calls virtual Field::sp_prepare_and_store_item(). Removing the similar code from sp_instr_set_row_field::exec_core() and sp_instr_set_row_field_by_name::exec_core(). Removing the method sp_rcontext::set_variable_row_field_to_null(), as it's not used any more. 8. Removing the call for sp_prepare_func_item() from sp_rcontext::set_variable_row_field(), as it was duplicate: it was done inside sp_eval_expr(). Now it's done inside virtual Field::sp_prepare_and_store_item(). 9. Moving the code from sp_instr_set_row_field_by_name::exec_core() into sp_rcontext::set_variable_row_field_by_name(), for symmetry with other sp_instr_set*::exec_core()/sp_rcontext::set_variable*() pairs. Now sp_instr_set_row_field_by_name::exec_core() calls sp_rcontext::set_variable_row_field_by_name(). 10. Misc: - Adding a helper private method sp_rcontext::virtual_tmp_table_for_row(), reusing it in a new sp_rcontext methods. - Removing Item_field_row::get_row_field(), as it's not used any more. - Removing the "Item *result_item" from sp_eval_expr(), as it's not needed any more.
* | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-171-4/+4
|\ \ \ \ | |/ / /
| * | | Merge 10.2 into bb-10.2-extMarko Mäkelä2018-01-171-4/+4
| |\ \ \ | | |/ /
| | * | Moving a change_list related methods from THD to Item_change_listAlexander Barkov2018-01-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Moving the following methods from THD to Item_change_list: nocheck_register_item_tree_change() check_and_register_item_tree_change() rollback_item_tree_changes() as they work only with the "change_list" member and don't require anything else from THD. 2. Deriving THD from Item_change_list This change will help to fix "MDEV-14603 signal 11 with short stacktrace" easier.
* | | | Revert "SQL: Backup_query_start_time RAII"Sergei Golubchik2018-01-131-2/+5
| | | | | | | | | | | | | | | | This reverts commit 07b1a7743096b01ea55407bada7bfad8c609397c.
* | | | System Versioning 1.0 pre8Aleksey Midenkov2018-01-101-4/+4
|\ \ \ \ | | | | | | | | | | | | | | | Merge branch '10.3' into trunk
| * \ \ \ Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-051-3/+2
| |\ \ \ \ | | |/ / /
| | * | | Fix a warning about extra parenthesisMarko Mäkelä2018-01-051-3/+2
| | | | |
| * | | | MDEV 13679 Enabled sequences to be used in DEFAULTMonty2017-12-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other changes done to get this to work: - Added 'internal_tables' to TABLE object to list which sequence tables is needed to use the table. - Mark any expression using DEFAULT() with LEX->default_used. This is needed when deciding if we should open internal sequence tables when a table is opened (we don't need to open sequence tables if the main table is only used with SELECT). - Create_and_open_temporary_table() can now also open all internal sequence tables. - Added option MYSQL_LOCK_USE_MALLOC to mysql_lock_tables() to force memory allocation to be used with malloc instead of memroot. - Added flag to MYSQL_LOCK to remember if allocation was done with malloc or memroot (makes code simpler and safer). - init_one_table_for_prelocking() now takes argument for what lock to use instead of it's a routine or something else. - Renamed prelocking placeholders to make them more understandable as they are now used in more code. - Changed test in check_lock_and_start_stmt() if found table has correct locks. The old test didn't work for tables that has lock TL_WRITE_ALLOW_WRITE, which is what sequence tables are using. - Added VCOL_NOT_VIRTUAL option to ensure that sequence functions can't be used with virtual columns - More sequence tests
* | | | | SQL: Backup_query_start_time RAIIAleksey Midenkov2018-01-091-5/+2
| | | | |
* | | | | small cleanup: backup_query_start_time()Sergei Golubchik2018-01-091-2/+2
| | | | |
* | | | | System Versioning 1.0 pre3Aleksey Midenkov2017-12-111-53/+95
|\ \ \ \ \ | |/ / / / | | | | | | | | | | Merge branch '10.3' into trunk
| * | | | MDEV-7773: Aggregate stored functionsVarun Gupta2017-12-041-4/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements aggregate stored functions. The basic idea behind the feature is: * Implement a special instruction FETCH GROUP NEXT ROW that will pause the execution of the stored function. When the instruction is reached, execution of the initial query resumes "as if" the function returned. This gives the server the opportunity to advance to the next row in the result set. * Stored aggregates behave like regular aggregate functions. The implementation of thus resides in the class Item_sum_sp. Because it is an aggregate function, for each new row in the group, the Item_sum_sp::add() method will be called. This is when execution resumes and the function does another iteration to "add" one extra element to the final result. * When the end of group is reached, val_xxx() method will be called for the item. This case is handled by another execute step for the stored function, only with a special flag to force a call to the return handler. See Item_sum_sp::execute() for details. To allow this pause and resume semantic, we must preserve the function context across executions. This is stored in Item_sp::sp_query_arena only for aggregate stored functions, but has no impact for regular functions. We also enforce aggregate functions to include the "FETCH GROUP NEXT ROW" instruction. Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
| * | | | Refactor parts of Item_func_sp into Item_spVarun Gupta2017-12-041-28/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for implementing custom aggregate functions, refactor the common code between regular stored functions and aggregate stored functions. This includes: * initialising SP result field * executing a SP * access checks In addition, refactor sp_head::execute_function to take two extra parameters, a function rcontext and a Query_arena. These two paremeters were initially initialised and destroyed within sp_head::execute_function, but for aggregate stored functions we will require control over their lifetime. The owner of these objects now becomes Item_sp. Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
| * | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-11-301-21/+25
| |\ \ \ \ | | |/ / /
| | * | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-11-291-19/+23
| | |\ \ \ | | | |/ /
| | | * | Merge branch '10.1' into 10.2Sergei Golubchik2017-11-211-19/+23
| | | |\ \ | | | | |/
| | | | * MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loopsOleksandr Byelkin2017-11-141-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Repeat reworked solution of procedures for all posible Sp (functions & triggers).
| | * | | MDEV-14415 Add Oracle-style FOR loop to sql_mode=DEFAULTAlexander Barkov2017-11-161-2/+2
| | | | |
* | | | | System Versioning pre1.0Aleksey Midenkov2017-11-131-2/+0
|\ \ \ \ \ | |/ / / / | | | | | | | | | | Merge branch '10.3' into trunk
| * | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-11-101-2/+0
| |\ \ \ \ | | |/ / /
| | * | | Add more execution stages (commit, rollback, etc)Monty2017-11-051-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done to get more information about where time is spent. Now we can get proper timing for time spent in commit, rollback, binlog write etc. Following stages was added: - Commit - Commit_implicit - Rollback - Rollback implicit - Binlog write - Init for update - This is used instead of "Init" for insert, update and delete. - Staring cleanup Following stages where changed: - "Unlocking tables" stage reset stage to previous stage at end - "binlog write" stage resets stage to previous stage at end - "end" -> "end of update loop" - "cleaning up" -> "Reset for next command" - Added stage_searching_rows_for_update when searching for rows to be deleted. Other things: - Renamed all stages to start with big letter (before there was no consitency) - Increased performance_schema_max_stage_classes from 150 to 160. - Most of the test changes in performance schema comes from renaming of stages. - Removed duplicate output of variables and inital state in a lot of performance schema tests. This was done to make it easier to change a default value for a performance variable without affecting all tests. - Added start_server_variables.test to check configuration - Removed some duplicate "closing tables" stages - Updated position for "stage_init_update" and "stage_updating" for delete, insert and update to be just before update loop (for more exact timing). - Don't set "Checking permissions" twice in a row. - Remove stage_end stage from creating views (not done for create table either). - Updated default performance history size from 10 to 20 because of new stages - Ensure that ps_enabled is correct (to be used in a later patch)
* | | | | System Versioning pre0.12Aleksey Midenkov2017-11-071-0/+1
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | Merge remote-tracking branch 'origin/archive/2017-10-17' into 10.3
| * | | | SQL: invalidate current SP at archive substitution [closes #127]Aleksey Midenkov2017-09-291-9/+1
| | | | | | | | | | | | | | | | | | | | Related to #125
| * | | | IB: 0.2 part IVAleksey Midenkov2017-05-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * BEGIN_TS(), COMMIT_TS() SQL functions; * VTQ instead of packed stores secs + usecs like my_timestamp_to_binary() does; * versioned SELECT to IB is translated with COMMIT_TS(); * SQL fixes: - FOR_SYSTEM_TIME_UNSPECIFIED condition compares to TIMESTAMP_MAX_VALUE; - segfault fix #36: multiple execute of prepared stmt; - different tables to same stored procedure fix (#39) * Fixes of previous parts: ON DUPLICATE KEY, other misc fixes.
* | | | | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2017-10-301-14/+18
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | TODO: enable MDEV-13049 optimization for 10.3
| * | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-10-301-1/+9
| |\ \ \ \ | | | |/ / | | |/| |
| | * | | Merge branch '10.1' into 10.2Sergei Golubchik2017-10-241-3/+9
| | |\ \ \ | | | | |/ | | | |/|
| | | * | Merge branch '10.0' into 10.1Sergei Golubchik2017-10-221-3/+9
| | | |\ \
| | | | * \ Merge branch '5.5' into 10.0Sergei Golubchik2017-10-181-2/+0
| | | | |\ \
| | | | | * | MDEV-13459 Warnings, when compiling with gcc-7.xSergei Golubchik2017-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | mostly caused by -Wimplicit-fallthrough
| | | | * | | MDEV-13676: Field "create Procedure" is NULL, even if the the user has role ↵Vicențiu Ciorbaru2017-10-111-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which is the definer. (SHOW CREATE PROCEDURE) During show create procedure we ommited to check the current role, if it is the actual definer of the procedure. In addition, we should support indirectly granted roles to the current role. Implemented a recursive lookup to search the tree of grants if the rolename is present. SQL Standard 2016, Part 5 Section 53 View I_S.ROUTINES selects ROUTINE_BODY and its WHERE clause says that the GRANTEE must be either PUBLIC, or CURRENT_USER or in the ENABLED_ROLES.
| | | | * | | Silence bogus GCC 7 warnings -Wimplicit-fallthroughMarko Mäkelä2017-05-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not silence uncertain cases, or fix any bugs. The only functional change should be that ha_federated::extra() is not calling DBUG_PRINT to report an unhandled case for HA_EXTRA_PREPARE_FOR_DROP.
| * | | | | | MDEV-14212 Add Field_row for SP ROW variablesAlexander Barkov2017-10-301-2/+6
| | | | | | |
| * | | | | | sp_rcontext::sp cleanupAlexander Barkov2017-10-191-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Renaming sp_rcontext::sp to sp_rcontext:m_sp for consistency with other sp_rcontext_members, and for consistency with the same purpose member Item_sp_variable::m_sp. - Passing a "const sp_head*" pointer to sp_rcontext::sp_rcontext() and to sp_rcontext::create(). Initializing sp_rcontext::m_sp right in the constructor instead of having a separate initialization after "new sp_rcontext" or sp_rcontext::create(). - Adding the "const" qualifier to sp_rcontext::m_sp and Item_sp_variable::m_sp
| * | | | | | MDEV-14013 : sql_mode=EMPTY_STRING_IS_NULLhalfspawn2017-10-141-1/+1
| | | | | | |
* | | | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-10-041-18/+18
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Fix compiler error on Win64 - do not truncate pointer in DBUGVladislav Vaintroub2017-10-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix truncation warning on Windows, in a populart header, with a cast.