summaryrefslogtreecommitdiff
path: root/sql/opt_subselect.cc
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | Merge 10.0 into 10.1Marko Mäkelä2018-04-241-0/+1
| | |\ \ \ | | | |/ /
| | | * | Merge branch '5.5' into 10.0Sergei Golubchik2018-04-201-0/+1
| | | |\ \ | | | | |/
| | | | * MDEV-14515 ifnull result depends on number of rows in joined tableIgor Babaev2018-04-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Any expensive WHERE condition for a table-less query with implicit aggregation was lost. As a result the used aggregate functions were calculated over a non-empty set of rows even in the case when the condition was false.
* | | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-03-281-1/+7
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.1' into 10.2Sergei Golubchik2018-03-251-0/+4
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.0' into 10.1Sergei Golubchik2018-03-231-0/+4
| | |\ \ \ | | | |/ /
| | | * | Merge branch '5.5' into 10.0Sergei Golubchik2018-03-231-0/+4
| | | |\ \ | | | | |/
| | | | * MDEV-14779: using left join causes incorrect results with materialization ↵Varun Gupta2018-03-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and derived tables Conversion of a subquery to a semi-join is blocked when we have an IN subquery predicate in the on_expr of an outer join. Currently this scenario is handled but the cases when an IN subquery predicate is wrapped inside a Item_in_optimizer item then this blocking is not done.
| * | | | Merge remote-tracking branch 'origin/10.1' into 10.2Vicențiu Ciorbaru2018-03-161-1/+3
| |\ \ \ \ | | |/ / /
| | * | | Merge remote-tracking branch '10.0' into 10.1Vicențiu Ciorbaru2018-03-151-1/+3
| | |\ \ \ | | | |/ /
| | | * | Merge branch '5.5' into 10.0Vicențiu Ciorbaru2018-03-141-1/+3
| | | |\ \ | | | | |/
| | | | * MDEV-15235: Assertion `length > 0' failed in create_ref_for_keyVarun Gupta2018-03-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The issue is that we are creating a materialised table with key of length 0 which is incorrect, we should disable materialisation for such a case.
* | | | | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2018-02-041-1/+2
|\ \ \ \ \
| * | | | | Added name to MEM_ROOT for esier debuggingMonty2018-02-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+3
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extMonty2018-01-271-3/+3
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | Conflicts: sql/table.cc
| | * | | | Fixed compiler warningsMonty2018-01-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Only warnings, should not have caused any bugs in old code
* | | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-111-16/+48
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.2 into bb-10.2-extMarko Mäkelä2018-01-111-16/+48
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.1 into 10.2Marko Mäkelä2018-01-111-16/+48
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge 10.0 into 10.1Marko Mäkelä2018-01-111-16/+48
| | | |\ \ \ | | | | |/ /
| | | | * | Merge 5.5 into 10.0Marko Mäkelä2018-01-111-16/+48
| | | | |\ \ | | | | | |/
| | | | | * MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_inOleksandr Byelkin2018-01-101-16/+48
| | | | | | | | | | | | | | | | | | | | | | | | Roll back to most general duplicate removing strategi in case of different stratagies for one position.
* | | | | | This is a full cost-based implementation of the optimization that employsIgor Babaev2017-12-301-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | splitting technique for equi-joins of materialized derived tables/views/CTEs. (see mdev-13369 and mdev-13389).
* | | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-11-301-1/+1
|\ \ \ \ \ \ | |/ / / / /
| * | | | | MDEV-14517 Cleanup for Item::with_subselect and Item::has_subquery()Alexander Barkov2017-11-281-1/+1
| | | | | |
* | | | | | Handle failures from mallocMichael Widenius2017-11-171-38/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-11-101-4/+5
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extMonty2017-11-091-4/+5
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mysql-test/r/cte_recursive.result mysql-test/r/derived_cond_pushdown.result mysql-test/t/cte_recursive.test mysql-test/t/derived_cond_pushdown.test sql/datadict.cc sql/handler.cc
| | * | | | Merge remote-tracking branch 'origin/10.1' into 10.2Alexander Barkov2017-11-091-4/+5
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge remote-tracking branch 'origin/10.0' into 10.1Alexander Barkov2017-11-091-4/+5
| | | |\ \ \ | | | | |/ /
| | | | * | MDEV-14164: Unknown column error when adding aggregate to function in oracle ↵Oleksandr Byelkin2017-11-091-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | style procedure FOR loop Make differentiation between pullout for merge and pulout of outer field during exists2in transformation. In last case the field was outer and so we can safely start from name resolution context of the SELECT where it was pulled. Old behavior lead to inconsistence between list of tables and outer name resolution context (which skips one SELECT for merge purposes) which creates problem vor name resolution.
* | | | | | Merge remote-tracking branch 'shagalla/10.3-mdev12172' into 10.3Igor Babaev2017-11-011-0/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | Post review changes for the optimization of IN predicates into IN subqueries.Galina Shalygina2017-09-021-1/+1
| | | | | | |
| * | | | | | Summarized results of two previous commits (26 July, 25 August)Galina Shalygina2017-08-291-0/+2
| | | | | | |
* | | | | | | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2017-10-301-9/+47
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | | | | | | | | | | TODO: enable MDEV-13049 optimization for 10.3
| * | | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-10-301-9/+47
| |\ \ \ \ \ \ | | | |/ / / / | | |/| | | |
| | * | | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-10-241-9/+47
| | |\ \ \ \ \ | | | | |/ / / | | | |/| | |
| | | * | | | Merge branch '10.0' into 10.1Sergei Golubchik2017-10-221-9/+47
| | | |\ \ \ \ | | | | | |/ / | | | | |/| |
| | | | * | | Merge branch '5.5' into 10.0Sergei Golubchik2017-10-181-8/+47
| | | | |\ \ \ | | | | | | |/ | | | | | |/|
| | | | | * | MDEV-9619: Assertion `null_ref_table' failed in virtual table_map ↵Oleksandr Byelkin2017-10-131-8/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Item_direct_view_ref::used_tables() const on 2nd execution of PS Refer left expression indirectly in case it changes from execution to execution.
* | | | | | | simplify READ_RECORD usage NFCEugene Kosov2017-08-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | READ_RECORD read_record; ... // this // read_record.read_record(&read_record); // becomes just read_record.read_record();
* | | | | | | Changed KEY names to use LEX_CSTRINGMichael Widenius2017-08-241-2/+2
| | | | | | |
* | | | | | | Enusure that my_global.h is included firstMichael Widenius2017-08-241-1/+1
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added sql/mariadb.h file that should be included first by files in sql directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables that must be done before my_global.h is included) - Removed a lot of include my_global.h from include files - Removed include's of some files that my_global.h automatically includes - Removed duplicated include's of my_sys.h - Replaced include my_config.h with my_global.h
* | | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-07-071-0/+4
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-07-051-0/+4
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge remote-tracking branch '10.0' into 10.1Vicențiu Ciorbaru2017-06-211-0/+4
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge remote-tracking branch '5.5' into 10.0Vicențiu Ciorbaru2017-06-201-0/+4
| | | |\ \ \ | | | | |/ /
| | | | * | Fixed the bug mdev-12838.Igor Babaev2017-06-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the optimizer chose an execution plan where a semi-join nest were materialized and the result of materialization was scanned to access other tables by ref access it could build a key over columns of the tables from the nest that were actually inaccessible. The patch performs a proper check whether a key that uses columns of the tables from a materialized semi-join nest can be employed to access outer tables.