summaryrefslogtreecommitdiff
path: root/sql/field.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2017-10-301-7/+55
|\ | | | | | | TODO: enable MDEV-13049 optimization for 10.3
| * MDEV-14212 Add Field_row for SP ROW variablesAlexander Barkov2017-10-301-5/+27
| |
| * MDEV-14139 Anchored data types for variablesAlexander Barkov2017-10-271-1/+27
| |
| * Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-10-181-2/+2
| |\
| | * MDEV-14038 ALTER TABLE does not exit on error with InnoDB + bad default functionAlexander Barkov2017-10-111-2/+2
| | | | | | | | | | | | | | | | | | Changing Field::set_default from void to int. It now uses the same return value notation with Field::store*() and Item::save_in_field().
* | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-10-041-3/+4
|\ \ \ | |/ /
| * | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-10-021-3/+4
| |\ \ | | |/
| | * MDEV-13384 - misc Windows warnings fixedVladislav Vaintroub2017-09-281-2/+2
| | |
* | | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2017-09-281-0/+4
|\ \ \ | |/ /
| * | A cleanup for MDEV-13919 sql_mode=ORACLE: Derive length of VARCHAR SP param...Alexander Barkov2017-09-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The intent of this patch is to avoid copying arguments from a pair "Item **args, uint arg_count" to List<Item> in sp_head::execute_function(). If the number of a stored function parameters is huge, such copying can affect performance. Change: 1. Adding a new method Row_definition_list::adjust_formal_params_to_actual_params, which accepts a pair of "Item **, uint". 2. Modifying the code to use the new method: - the calls for sp_rcontext::retrieve_field_definitions() and Row_definition_list::adjust_formal_params_to_actual_params() have been moved from sp_rcontext::create() to sp_head::rcontext_create(), to handle different argument notations easier (Item** vs List<Item>). - sp_rcontext::create() now assumes that the passed Row_definition_list is already adjusted to the actual SP parameters, and all "TYPE OF" and "ROWTYPE OF" references are resolved. 3. Removing creation of List<Item> in sp_head::execute_procedure(), using the code with "Item**, uint" notation instead. 4. Improvement of the code for MDEV-10577: As a good side effect, this patch gets rid of double security context switch inside sp_head::execute_trigger(): sp_rcontext is created when the context is already switched, so the second context switch inside sp_head::rcontext_create() was redundant. This is solved by adding a "bool switch_secutiry_ctx" parameter to rcontext_create(), so now execute_function() and execute_procedure() pass "true", while execute_trigger() passes "false".
| * | A cleanup for MDEV-10577 and MDEV-13919: moving a few sp_rcontext methodsAlexander Barkov2017-09-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moving a few methods from sp_rcontext to different classes: - Table_ident::resolve_table_rowtype_ref - Qualified_column_ident::resolve_type_ref - Row_definition_list::resolve_table_rowtype_ref - Row_definition_list::adjust_formal_params_to_actual_params It easier to reuse these methods this way in the future.
* | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-09-251-12/+30
|\ \ \ | |/ /
| * | Merge branch '10.2' into bb-10.2-extSergei Golubchik2017-09-231-2/+6
| |\ \ | | |/
| | * bugfix: copy timestamps correctly in INSERT...SELECTSergei Golubchik2017-09-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implement Field_timestamp::save_in_field(timestamp_field) that stores timestamp values without converting them to MYSQL_TIME and back, because this conversion is lossy around DST change time. This fixes main.old-mode test. This is 10.2 version of f8a800bec81
| | * bugfix: ALTER TABLE and TIMESTAMPs around DST change timeSergei Golubchik2017-09-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement a special Copy_func function for timestamps, that copies timestamps without converting them to MYSQL_TIME (the conversion is lossy around DST change time). This fixes ALTER TABLE part of main.old-mode test. This is 10.2 version of f4f48e06215
| | * MDEV-13868 cannot insert 1288481126 in a timestamp column in Europe/MoscowSergei Golubchik2017-09-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make insert NULL into a timestamp mark the field as having an explicit value. So that the field won't be assigned the value again in TABLE::update_default_field() make Item_func_now_local::save_in_field(timestamp_field) not to go through MYSQL_TIME - this conversion is lossy around DST change times. This fixes inserting a default value into a timestamp field.
| * | Fixing a few -Wconversion warningsAlexander Barkov2017-09-231-10/+24
| | |
* | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-09-181-1/+2
|\ \ \ | |/ /
| * | Merge 10.2 into bb-10.2-extMarko Mäkelä2017-09-171-1/+1
| |\ \ | | |/
| | * Field_varstring: Declare get_data() and get_length() as publicMarko Mäkelä2017-09-151-1/+1
| | | | | | | | | | | | | | | The underlying data members are declared public, so there is no point in hiding these const accessors.
* | | MDEV-11371 - column compressionSergey Vojtovich2017-08-311-17/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Storage engine independent support for column compression. TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB, TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT, VARCHAR and VARBINARY columns can be compressed. New COMPRESSED column attribute added: COMPRESSED[=<compression_method>] System variables added: column_compression_threshold column_compression_zlib_level column_compression_zlib_strategy column_compression_zlib_wrap Status variables added: Column_compressions Column_decompressions Limitations: - the only supported method currently is zlib - CSV storage engine stores data uncompressed on-disk even if COMPRESSED attribute is present - it is not possible to create indexes over compressed columns.
* | | Get rid of Field::do_save_field_metadata()Sergey Vojtovich2017-08-311-25/+25
|/ / | | | | | | It doesn't serve any purpose, but generates extra virtual function call.
* | MDEV-13414 Fix the SP code to avoid excessive use of strlenAlexander Barkov2017-07-311-0/+15
| |
* | MDEV-13298 Change sp_head::m_chistics from a pointer to a structureAlexander Barkov2017-07-121-0/+2
| |
* | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-07-071-1/+1
|\ \ | |/
| * cleanup: move Virtual_column_info::print out of Virtual_column_infoSergei Golubchik2017-07-051-1/+1
| |
* | Adding "const" qualifier to Column_definition::make_field()Alexander Barkov2017-07-031-1/+1
| |
* | MDEV-12833 Split Column_definition::create_length_to_internal_length() to ↵Alexander Barkov2017-05-171-1/+10
| | | | | | | | virtual methods in Type_handler
* | MDEV-9397 Split field.cc:calc_pack_length() into virtual methods in Type_handlerAlexander Barkov2017-05-171-6/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | - Adding new virtual methods in Type_handler: * Column_definition_prepare_stage1() * Column_definition_prepare_stage2() * calc_pack_length() - Using new methods to remove type specific code in: * Global function calc_pack_length() * Column_definition::prepare_create_field() * The loop body mysql_prepare_create_table() * Column_definition::sp_prepare_create_field()
* | MDEV-9188 Split Column_definition::check() into virtual methods in Type_handlerAlexander Barkov2017-05-161-0/+8
| |
* | MDEV-12772 Add Field::get_typelib() and Item::get_typelib()Alexander Barkov2017-05-101-0/+2
| |
* | MDEV-12717 Change Item_equal to operate Type_handler rather than Item_resultAlexander Barkov2017-05-071-2/+4
| |
* | MDEV-12716 Change Value_source::Context to operate Type_handler rather than ↵Alexander Barkov2017-05-061-8/+10
| | | | | | | | Item_result
* | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-05-051-3/+24
|\ \ | |/
| * MDEV-11117 CHECK constraint fails on intermediate step of ALTERbb-10.2-MDEV-11117Jacob Mathew2017-04-171-3/+24
| | | | | | | | | | | | | | | | Fixed the bug by failing the statement with an error message that explains that an auto-increment column may not be used in an expression for a check constraint. Added a test case in check_constraint.test. Updated existing tests and results.
* | MDEV-12695 Add Column_definition::type_handler()Alexander Barkov2017-05-051-33/+10
| |
* | MDEV-9395 Add Type_handler::Item_decimal_scale() and ↵Alexander Barkov2017-04-291-21/+0
| | | | | | | | Item_divisor_precision_increment()
* | MDEV-12588 Add Type_handler::type_handler_for_tmp_table() and ↵Alexander Barkov2017-04-271-32/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Type_handler::type_handler_for_union() 1. Implementing the task according to the description: a. Adding Type_handler::type_handler_for_tmp_table(). b. Adding Type_handler::type_handler_for_union_table. c. Adding helper methods Type_handler::varstring_type_handler(const Item*), Type_handler::blob_type_handler(const Item*) d. Removing Item::make_string_field() and Item_func_group_concat::make_string_field(). They are not needed any more. e. Simplifying Item::tmp_table_field_from_field_type() to just two lines. f. Renaming Item_type_holder::make_field_by_type() and implementing virtual Item_type_holder::create_tmp_field() instead. The new implementation is also as simple as two lines. g. Adding a new virtual method Type_all_attributes::get_typelib(), to access to TYPELIB definitions for ENUM and SET columns. h. Simplifying the code branch for TIME_RESULT, DECIMAL_RESULT, STRING_RESULT in Item::create_tmp_field(). It's now just one line. i. Implementing Type_handler_enum::make_table_field() and Type_handler_set::make_table_field(). 2. Code simplification in Field_str constructor calls. a. Changing the "CHARSET_INFO *cs" argument in constuctors for Field_str and its descendants to "const DTCollation &collation". This is to avoid two step initialization: - setting Field_str::derivation and Field_str::repertoire to the default values first - then resetting them using: set_derivation(item->derivation, item->repertoire). b. Removing Field::set_derivation() c. Adding a new constructor DTCollation(CHARSET_INFO *cs), for the old code compatibility. 3. Changes in test results As a side effect some test results have changed, because in the old version Item::make_string_field() converted TINYBLOB to VARCHAR(255). Now TINYBLOB is preserved. a. sp-row.result This query: CREATE TABLE t1 AS SELECT tinyblob_sp_variable; Now preserves TINYBLOB as the data type. Before the patch a VARCHAR(255) was created. b. gis-debug.result This is a debug test, to make sure that + and - operators are commutative and non-commutative correspondingly. The exact data type is not really important. (But anyway, it now chooses a better data type that fits the result)
* | Fixing compilation failure on Windows: moving references to type_handler_xxx ↵Alexander Barkov2017-04-261-9/+1
| | | | | | | | from field.h to field.cc
* | MDEV-12426 Add Field::type_handler() + MDEV-12432Alexander Barkov2017-04-251-55/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a joint patch for: - MDEV-12426 Add Field::type_handler() - MDEV-12432 Range optimizer for ENUM and SET does not return "Impossible WHERE" in some case With the new type handler approach being added to Field, it was easier to fix MDEV-12432 rather than to reproduce the old ENUM/SET behavior. The patch does the following: 1. Adds Field::type_handler(), according to the task description. 2. Fixes the asymmetry between Fields and Items of ENUM and SET field types. Field_enum::cmp_type() returned INT_RESULT Item*::cmp_type() returned STRING_RESULT for ENUM and SET expressions This asymmetry was originally done for easier coding in the optimizer sources. However, in 10.1 we moved a lot of code to methods of the class Field: - test_if_equality_guarantees_uniqueness() - can_be_substituted_to_equal_item() - get_equal_const_item() - can_optimize_keypart_ref() - can_optimize_hash_join() - can_optimize_group_min_max() - can_optimize_range() - can_optimize_outer_join_table_elimination() As of 10.2 only a few lines of the code in opt_range.cc, field.cc and field.h still relayed on the fact that Field_enum::cmp_type() returns INT_RESULT: - Some asserts in field.cc - Field_year::get_copy_func() - Item_func_like::get_mm_leaf() - Item_bool_func::get_mm_leaf() These lines have been fixed. 3. Item_bool_func::get_mm_leaf() did not work well for ENUM/SET, see MDEV-12432. So the ENUM/SET code was rewritten, and the relevant code in Field_enum::store() and Field_set::store() was fixed to properly return errors to the caller. 4. The result of Field_decimal::result_type() was changed from REAL_RESULT to DECIMAL_RESULT. Data type aggregation (e.g. in COALESCE()) is now more precise for old DECIMAL, because Item::decimal_precision() now goes through the DECIMAL_RESULT branch. Earlier it went through the REAL_RESULT branch.
* | MDEV-9217 Split Item::tmp_table_field_from_field_type() into virtual methods ↵Alexander Barkov2017-04-241-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in Type_handler - Adding Type_handler::make_table_field() and moving pieces of the code from Item::tmp_table_field_from_field_type() to virtual implementations for various type handlers. - Adding a new Type_all_attributes, to access to Item's extended attributes, such as decimal_precision() and geometry_type(). - Adding a new class Record_addr, to pass record related information to Type_handler methods (ptr, null_ptr and null_bit) as a single structure. Note, later it will possibly be extended for BIT-alike field purposes, by adding new members (bit_ptr_arg, bit_ofs_arg). - Moving the code from Field_new_decimal::create_from_item() to Type_handler_newdecimal::make_table_field(). - Removing Field_new_decimal() and Field_geom() helper constructor variants that were used for temporary field creation. - Adding Item_field::type_handler(), Field::type_handler() and Field_blob::type_handler() to return correct type handlers for blob variants, according to Field_blob::packlength. - Adding Type_handler_blob_common, as a common parent for Type_handler_tiny_blob, Type_handler_blob, Type_handler_medium_blob and Type_handler_long_blob. - Implementing Type_handler_blob_common::Item_hybrid_func_fix_attributes(). It's needed for cases when TEXT variants of different character sets are mixed in LEAST, GREATEST, CASE and its abreviations (IF, IFNULL, COALESCE), e.g.: CREATE TABLE t1 ( a TINYTEXT CHARACTER SET latin1, b TINYTEXT CHARACTER SET utf8 ); CREATE TABLE t2 AS SELECT COALESCE(a,b) FROM t1; Type handler aggregation returns TINYTEXT as a common data type for the two columns. But as conversion from latin1 to utf8 happens for "a", the maximum possible length of "a" grows from 255 to 255*3. Type_handler_blob_common::Item_hybrid_func_fix_attributes() makes sure to update the blob type handler according to max_length. - Adding Type_handler::blob_type_handler(uint max_octet_length). - Adding a few m_type_aggregator_for_result.add() pairs, because now Item_xxx::type_handler() can return pointers to type_handler_tiny_blob, type_handler_blob, type_handler_medium_blob, type_handler_long_blob. Before the patch only type_handler_blob was possible result of type_handler(). - Making type_handler_tiny_blob, type_handler_blob, type_handler_medium_blob, type_handler_long_blob public. - Removing the condition in Item_sum_avg::create_tmp_field() checking Item_sum_avg::result_type() against DECIMAL_RESULT. Now both REAL_RESULT and DECIMAL_RESULT are symmetrically handled by tmp_table_field_from_field_type(). - Removing Item_geometry_func::create_field_for_create_select(), as the inherited version perfectly works. - Fixing Item_func_as_wkb::field_type() to return MYSQL_TYPE_LONG_BLOB rather than MYSQL_TYPE_BLOB. It's needed to make sure that tmp_table_field_from_field_type() creates a LONGBLOB field for AsWKB(). - Fixing Item_func_as_wkt::fix_length_and_dec() to set max_length to UINT32_MAX rather than MAX_BLOB_WIDTH, to make sure that tmp_table_field_from_field_type() creates a LONGTEXT field for AsWKT(). - Removing Item_func_set_user_var::create_field_for_create_select(), as the inherited version works fine. - Adding Item_func_get_user_var::create_field_for_create_select() to make sure that "CREATE TABLE t1 AS SELECT @string_user variable" always creates a field of LONGTEXT/LONGBLOB type. - Item_func_ifnull::create_field_for_create_select() behavior has changed. Before the patch it passed set_blob_packflag=false, which meant to create LONGBLOB for all blob variants. Now it takes into account max_length, which gives better column data types for: CREATE TABLE t2 AS SELECT IFNULL(blob_column1, blob_column2) FROM t1; - Fixing Item_func_nullif::fix_length_and_dec() to use set_handler(args[2]->type_handler()) instead of set_handler_by_field_type(args[2]->field_type()). This is needed to distinguish between BLOB variants. - Implementing Item_blob::type_handler(), to make sure to create proper BLOB field variant, according to max_length, for queries like: CREATE TABLE t1 AS SELECT some_blob_field FROM INFORMATION_SCHEMA.SOME_TABLE; - Fixing Item_field::real_type_handler() to make sure that the code aggregating fields for UNION gets a proper BLOB variant type handler from fields. - Adding a special code into Item_type_holder::make_field_by_type(), to make sure that after aggregating field types it also properly takes into account max_length when mixing TEXT variants of different character sets and chooses a proper TEXT variant: CREATE TABLE t1 ( a TINYTEXT CHARACTER SET latin1, b TINYTEXT CHARACTER SET utf8 ); CREATE TABLE t2 AS SELECT a FROM t1 UNION SELECT b FROM t1; - Adding tests, for better coverage of IFNULL, NULLIF, UNION. - The fact that tmp_table_field_from_field_type() now takes into account BLOB variants (instead of always creating LONGBLOB), tests results for WEIGHT_STRING() and NULLIF() and UNION have become more precise.
* | Changing field::field_name and Item::name to LEX_CSTRINGMonty2017-04-231-90/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benefits of this patch: - Removed a lot of calls to strlen(), especially for field_string - Strings generated by parser are now const strings, less chance of accidently changing a string - Removed a lot of calls with LEX_STRING as parameter (changed to pointer) - More uniform code - Item::name_length was not kept up to date. Now fixed - Several bugs found and fixed (Access to null pointers, access of freed memory, wrong arguments to printf like functions) - Removed a lot of casts from (const char*) to (char*) Changes: - This caused some ABI changes - lex_string_set now uses LEX_CSTRING - Some fucntions are now taking const char* instead of char* - Create_field::change and after changed to LEX_CSTRING - handler::connect_string, comment and engine_name() changed to LEX_CSTRING - Checked printf() related calls to find bugs. Found and fixed several errors in old code. - A lot of changes from LEX_STRING to LEX_CSTRING, especially related to parsing and events. - Some changes from LEX_STRING and LEX_STRING & to LEX_CSTRING* - Some changes for char* to const char* - Added printf argument checking for my_snprintf() - Introduced null_clex_str, star_clex_string, temp_lex_str to simplify code - Added item_empty_name and item_used_name to be able to distingush between items that was given an empty name and items that was not given a name This is used in sql_yacc.yy to know when to give an item a name. - select table_name."*' is not anymore same as table_name.* - removed not used function Item::rename() - Added comparision of item->name_length before some calls to my_strcasecmp() to speed up comparison - Moved Item_sp_variable::make_field() from item.h to item.cc - Some minimal code changes to avoid copying to const char * - Fixed wrong error message in wsrep_mysql_parse() - Fixed wrong code in find_field_in_natural_join() where real_item() was set when it shouldn't - ER_ERROR_ON_RENAME was used with extra arguments. - Removed some (wrong) ER_OUTOFMEMORY, as alloc_root will already give the error. TODO: - Check possible unsafe casts in plugin/auth_examples/qa_auth_interface.c - Change code to not modify LEX_CSTRING for database name (as part of lower_case_table_names)
* | A cleanup patch for MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable ↵Alexander Barkov2017-04-051-19/+5
| | | | | | | | | | | | declarations Addressing Monty's review suggestions
* | Uninitialized Column_definition::pack_flag for ROW-type SP variables and ↵Alexander Barkov2017-04-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | their fields Fixed that the Column_definition::pack_flag member corresponding to ROW-type SP variables and their fields was not properly initialized. This lead to sporadic test failures. Valgrind complained about jumps depending on uninitialized value in VALGRIND builds. This patch makes sure that sp_head::fill_spvar_definition() is always called for ROW variables and their fields. Additionally, fixed that a function with a scalar parameter erroneously acceptes ROWs with one fields. Now an error is returned.
* | MDEV-12291 Allow ROW variables as SELECT INTO targetsAlexander Barkov2017-04-051-0/+6
| |
* | MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarationsAlexander Barkov2017-04-051-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarationsAlexander Barkov2017-04-051-0/+18
| |
* | MDEV-12007 Allow ROW variables as a cursor FETCH targetAlexander Barkov2017-04-051-0/+6
| |
* | MDEV-10914 ROW data type for stored routine variablesAlexander Barkov2017-04-051-1/+69
| |
* | MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarationsAlexander Barkov2017-04-051-1/+38
| |