summaryrefslogtreecommitdiff
path: root/sql/sql_tvc.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/10.3' into 10.4Alexander Barkov2020-05-191-1/+2
|\
| * MDEV-21995 Server crashes in Item_field::real_type_handler with table value ↵Alexander Barkov2020-05-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | constructor 1. Code simplification: Item_default_value handled all these values: a. DEFAULT(field) b. DEFAULT c. IGNORE and had various conditions to distinguish (a) from (b) and from (c). Introducing a new abstract class Item_contextually_typed_value_specification, to handle (b) and (c), so the hierarchy now looks as follows: Item Item_result_field Item_ident Item_field Item_default_value - DEFAULT(field) Item_contextually_typed_value_specification Item_default_specification - DEFAULT Item_ignore_specification - IGNORE 2. Introducing a new virtual method is_evaluable_expression() to determine if an Item is: - a normal expression, so its val_xxx()/get_date() methods can be called - or a just an expression substitute, whose value methods cannot be called. 3. Disallowing Items that are not evalualble expressions in table value constructors.
* | Merge 10.3 into 10.4Marko Mäkelä2020-05-161-1/+8
|\ \ | |/
| * MDEV-22560 Crash on a table value constructor with an SP variableAlexander Barkov2020-05-151-1/+8
| | | | | | | | | | fix_fields_for_tvc() could call fix_fields() for Items that have already been fixed before. Changing fix_fields() to fix_fields_if_needed().
* | Merge 10.3 into 10.4Marko Mäkelä2019-12-131-1/+55
|\ \ | |/ | | | | | | We disable the MDEV-21189 test galera.galera_partition because it times out.
| * MDEV-20900: IN predicate to IN subquery conversion causes performance regressionVarun Gupta2019-12-101-1/+55
| | | | | | | | | | Disable the IN predicate to IN subquery conversion when the types on the left and right hand side of the IN predicate are not of comparable type.
* | MDEV-19956 Queries with subqueries containing UNION are not parsedIgor Babaev2019-09-231-2/+2
| | | | | | | | | | | | | | | | Shift-Reduce conflicts prevented parsing some queries with subqueries that used set operations when the subqueries occurred in expressions or in IN predicands. The grammar rules for query expression were transformed in order to avoid these conflicts. New grammar rules employ an idea taken from MySQL 8.0.
* | Merge branch '10.3' into 10.4Sergei Golubchik2019-09-061-1/+2
|\ \ | |/
| * MDEV-16871 in_predicate_conversion_threshold cannot be set in my.cnfSergei Golubchik2019-09-041-1/+2
| |
* | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-33/+199
|\ \ | |/
| * MDEV-17894 Assertion `(thd->lex)->current_select' failed in MYSQLparse(),Igor Babaev2019-05-081-33/+199
| | | | | | | | | | | | | | | | | | | | query with VALUES() A table value constructor can be used in all contexts where a select can be used. In particular an ORDER BY clause or a LIMIT clause or both of them can be attached to a table value constructor to produce a new query. Unfortunately execution of such queries was not supported. This patch fixes the problem.
* | Merge 10.3 into 10.4Marko Mäkelä2019-03-201-7/+7
|\ \ | |/ | | | | | | | | | | | | | | | | The MDEV-17262 commit 26432e49d37a37d09b862bb49a021e44bdf4789c was skipped. In Galera 4, the implementation would seem to require changes to the streaming replication. In the tests archive.rnd_pos main.profiling, disable_ps_protocol for SHOW STATUS and SHOW PROFILE commands until MDEV-18974 has been fixed.
| * post-merge: --ps-protocol fixesSergei Golubchik2019-03-171-7/+7
| |
* | Merge 10.3 into 10.4Marko Mäkelä2018-10-171-2/+17
|\ \ | |/
| * MDEV-17222 Reproducible server crash in String_list::append_str orIgor Babaev2018-10-141-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in Field_iterator_table::create_item When IN predicate is converted to IN subquery we have to ensure that any item from the select list of the subquery has some name and this name is unique across the select list. This was not guaranteed by the code before the patch for MDEV-17222. If the name of an item of the select list was not set, and this happened for binary constants, then the server crashed. If the first row in the IN list contained the same constant in two different positions then the server returned an error message. This was fixed by providing all constants in the first row of the IN list with generated names.
* | MDEV-11953: support of brackets in UNION/EXCEPT/INTERSECT operationsOleksandr Byelkin2018-07-041-4/+4
| |
* | MDEV-16388 Replace member Item::fixed to virtual method is_fixed()Alexander Barkov2018-06-051-2/+1
|/
* Add likely/unlikely to speed up executionMonty2018-05-071-1/+1
| | | | | | | | | Added to: - if (error) - Lex - sql_yacc.yy and sql_yacc_ora.yy - In header files to alloc() calls - Added thd argument to thd_net_is_killed()
* MDEV-16038 Assertion `map->n_bits > 0' failed (my_bitmap.c:386: ↵Igor Babaev2018-04-261-0/+6
| | | | | | | bitmap_is_clear_all) Rows with no elements are not allowed in a table value constructor unless it is used in an INSERT statement.
* MDEV-14835 Server crashes in Field_iterator_table::create_item when number ofGalina Shalygina2018-02-201-1/+1
| | | | | | | | | | | elements of BIGINT or YEAR type in the IN list reaches in_predicate_conversion_threshold The bug appears at the prepare stage when IN-predicate with the long list of values is converted into IN-subquery. It happens because values in the right operand of the IN-predicate that have BIGINT or YEAR types are converted into the Item_int_with_ref. To fix it in the procedure Item_func_in::create_value_list_for_tvc real_item() is taken for each value in the right operand of the IN-predicate.
* Bug fixGalina Shalygina2018-01-251-2/+2
| | | | Wrong conversion
* System Versioning 1.0pre2Aleksey Midenkov2017-11-231-2/+6
|\ | | | | | | Merge branch '10.3' into trunk
| * Handle failures from mallocMichael Widenius2017-11-171-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most "new" failures fixed in the following files: - sql_select.cc - item.cc - item_func.cc - opt_subselect.cc Other things: - Allocate udf_handler strings in mem_root - Required changes in sql_string.h - Add mem_root as argument to some new [] calls - Mark udf_handler strings as thread specific - Removed some comment blocks with code
* | SQL: VIEW of UNION [fixes #293]Aleksey Midenkov2017-11-131-1/+1
|/
* Fixed mdev-14281 Wrong result from query with NOT IN predicate in WHEREIgor Babaev2017-11-051-4/+10
| | | | | | | Conversion of NOT IN predicates into NOT IN subqueries did not work correctly: the predicates actually were converted into IN subqueries. As a result if the conversion was applied for the query with a NOT IN predicate the query could return a wrong result set.
* Remove a type castMarko Mäkelä2017-11-021-2/+2
|
* Fixed compilation failuresMonty2017-11-021-2/+17
| | | | - Also added missing copyright notices
* Merge remote-tracking branch 'shagalla/10.3-mdev12172' into 10.3Igor Babaev2017-11-011-24/+27
| | | | | | | As a result of this merge the code for the following tasks appears in 10.3: - MDEV-12172 Implement tables specified by table value constructors - MDEV-12176 Transform [NOT] IN predicate with long list of values INTO [NOT] IN subquery.
* Mistakes corrected.Galina Shalygina2017-10-281-0/+97
| | | | | TVC can be used in IN subquery and in PARTITION BY struct now. Special variable to control working of optimization added.
* New tests on errors added. Comments corrected. Some procedures corrected.Galina Shalygina2017-09-041-81/+142
|
* Post review changes for the optimization of IN predicates into IN subqueries.Galina Shalygina2017-09-021-119/+170
|
* Memory allocation corrected. New tests added.Galina Shalygina2017-09-011-88/+68
|
* Mistakes corrected. Now all tests in opt_tvc.test file work correctlyGalina Shalygina2017-08-291-1/+0
|
* Mistakes corrected, new error messages addedGalina Shalygina2017-08-291-2/+9
|
* Summarized results of two previous commits (26 July, 25 August)Galina Shalygina2017-08-291-31/+539
|
* New structure Table Value Constructor added in grammar.Galina Shalygina2017-06-291-0/+128
TVC can be used in UNION-statement, in view and in subquery. Files where TVC is defined and its methods are stored added. Methods exec and prepare for TVC added. Tests for TVC added.