summaryrefslogtreecommitdiff
path: root/sql/opt_subselect.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.0' into 10.1Sergei Golubchik2015-09-031-3/+10
|\ | | | | | | | | referenced_by_foreign_key2(), needed for InnoDB to compile, was taken from 10.0-galera
| * MDEV-8289: Semijoin inflates number of rows in query resultSergei Petrunia2015-08-181-3/+10
| | | | | | | | | | | | | | | | | | | | - Make semi-join optimizer not to choose LooseScan when 1) the index is not covered and 2) full index scan will be required. - Make sure that the code in make_join_select() that may change full index scan into a range scan is not invoked when the table uses full scan.
* | MDEV-6152: Remove calls to current_thd while creating ItemMonty2015-08-271-6/+7
|/ | | | | | | | | | | | | - Part 4: Removing calls to sql_alloc() and sql_calloc() Other things: - Added current_thd in some places to make it clear that it's called (easier to remove later) - Move memory allocation from Item_func_case::fix_length_and_dec() to Item_func_case::fix_fields() - Added mem_root to some new calls - Fixed some wrong UNINIT_VAR() calls - Fixed a bug in generate_partition_syntax() in case of errors - Added mem_root to argument to new thread_info - Simplified my_parse_error() call in sql_yacc.yy
* Merge branch '5.5' into 10.0Sergei Golubchik2015-05-041-2/+2
|\
| * MDEV-7474: Semi-Join's DuplicateWeedout strategy skipped ...Sergei Petrunia2015-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | JOIN::cur_dups_producing_tables was not maintained correctly in the cases of greedy optimization (search_depth < n_tables). Moved it to POSITION structure where it will be maintained automatically. Removed POSITION::prefix_dups_producing_tables since its value can now be calculated.
* | 10.0-base mergeSergei Golubchik2014-02-261-1/+1
|\ \
| * \ 5.5 mergeSergei Golubchik2014-02-251-1/+1
| |\ \ | | |/
| | * Merge 5.3->5.5Igor Babaev2014-02-101-1/+1
| | |\
| | | * MDEV-5582: Plugin 'MEMORY' has ref_count=1 after shutdown with ↵Sergey Petrunya2014-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | materialization+semijoin - Let cleanup_empty_jtbm_semi_joins() walk into semi-join nests.
* | | | MDEV-5314 - Compiling fails on OSX using clangSergey Vojtovich2014-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is port of fix for MySQL BUG#17647863. revno: 5572 revision-id: jon.hauglid@oracle.com-20131030232243-b0pw98oy72uka2sj committer: Jon Olav Hauglid <jon.hauglid@oracle.com> timestamp: Thu 2013-10-31 00:22:43 +0100 message: Bug#17647863: MYSQL DOES NOT COMPILE ON OSX 10.9 GM Rename test() macro to MY_TEST() to avoid conflict with libc++.
* | | | merge 10.0-base -> 10.0unknown2013-09-261-1/+1
|\ \ \ \ | |/ / /
| * | | merge 5.5 -> 10.0-baseunknown2013-09-251-1/+1
| |\ \ \ | | |/ /
| | * | MDEV-5037: Server crash on a JOIN on a derived table with join_cache_level > 2Sergey Petrunya2013-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The crash was caused because the optimizer called handler->multi_range_read_info() on a derived temporary table. That table has been created, but not opened yet. Because of that, handler::table was NULL, which caused crash. Fixed by changing DS-MRR methods to use handler::table_share instead. handler::table_share is set in handler ctor, so this should be safe.
* | | | 10.0-base merge.Sergei Golubchik2013-09-211-0/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | Partitioning/InnoDB changes are *not* merged (they'll come from 5.6) TokuDB does not compile (not updated to 10.0 SE API)
| * | | 5.5 merge and fixes for compiler/test errorsSergei Golubchik2013-09-181-0/+1
| |\ \ \ | | |/ /
| | * | Merge 5.3 -> 5.5Sergey Petrunya2013-09-121-0/+1
| | |\ \ | | | |/
| | | * MDEV-5011: ERROR Plugin 'MEMORY' has ref_count=1 after shutdown for SJM queriesSergey Petrunya2013-09-121-0/+1
| | | | | | | | | | | | | | | | | | | | - Provide a special execution path for cleanup of degenerate non-merged semi-join children of degenerate selects.
* | | | Merge 10.0-base -> 10.0Igor Babaev2013-04-171-0/+1
|\ \ \ \ | |/ / /
| * | | The pilot patch for mwl#253.Igor Babaev2013-03-111-0/+1
| |/ /
* | | fixes for test failuresSergei Golubchik2012-09-271-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and small collateral changes mysql-test/lib/My/Test.pm: somehow with "print" we get truncated writes sometimes mysql-test/suite/perfschema/r/digest_table_full.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/perfschema/r/dml_handler.result: host table is not ported over yet mysql-test/suite/perfschema/r/information_schema.result: host table is not ported over yet mysql-test/suite/perfschema/r/nesting.result: this differs, because we don't rewrite general log queries, and multi-statement packets are logged as a one entry. this result file is identical to what mysql-5.6.5 produces with the --log-raw option. mysql-test/suite/perfschema/r/relaylog.result: MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB. mysql-test/suite/perfschema/r/server_init.result: MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup. mysql-test/suite/perfschema/r/stage_mdl_global.result: this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not do that, and this causes useless mutex locks and waits. mysql-test/suite/perfschema/r/statement_digest.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/perfschema/r/statement_digest_consumers.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/perfschema/r/statement_digest_long_query.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result: will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result: will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
* | 5.3 mergeSergei Golubchik2012-05-041-1/+3
|\ \ | |/
| * BUG#978479: Wrong result (extra rows) with ↵Sergey Petrunya2012-04-191-1/+3
| | | | | | | | | | | | | | | | derived_with_keys+loosescan+semijoin=ON, materialization=OFF - Part#2: Don't try to construct a LooseScan access on indexes that do not guarantee index-ordered reads.
* | fix the include guards and add missing gplv2 headersSergei Golubchik2012-02-171-0/+16
| |
* | Various fixes for Solaris compiler.Vladislav Vaintroub2012-02-031-1/+1
| | | | | | | | | | | | | | Also, restrict symbol visibility in statically built plugins, to minimize the chance for symbol name clashes with dynamic plugins.
* | 5.3 mergeSergei Golubchik2012-01-131-11/+11
|\ \ | |/
| * BUG#901506: Crash in TABLE_LIST::print on EXPLAIN EXTENDEDSergey Petrunya2011-12-141-0/+2
| | | | | | | | | | | | - Let JTBM optimization code handle the case where the subquery is degenerate and doesn't have a join query plan. Regular materialization would fall back to IN->EXISTS for such cases. Semi-Join materialization does not have such option, instead we introduce and use "constant JTBM join tabs".
| * Subquery code cleanups:Sergey Petrunya2011-11-251-5/+5
| | | | | | | | | | | | - Make functions that operate on SJ_TMP_TABLE be member functions - Make Loose_scan_opt data members private
| * MergeSergey Petrunya2011-11-251-6/+4
| |\
| | * Semi-join optimizations code cleanup part 2:Sergey Petrunya2011-11-251-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Make EXPLAIN display "Start temporary" at the start of the fanout (it used to display at the first table whose rowid gets into temp. table which is not that useful for the user) - Updated test results (all checked)
| | * Semi-join optimizations code cleanup:Sergey Petrunya2011-11-231-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Break down POSITION/advance_sj_state() into four classes representing potential semi-join strategies. - Treat all strategies uniformly (before, DuplicateWeedout was special as it was the catch-all strategy. Now, we're still relying on it to be the catch-all, but are able to function,e.g. with firstmatch=on,duplicate_weedout=off. - Update test results (checked)
* | | 5.3->5.5 mergeSergei Golubchik2011-11-271-1/+1
|\ \ \ | |/ /
| * | Fixed LP bug #887496.Igor Babaev2011-11-211-1/+1
| |/ | | | | | | | | | | | | This bug in the function Loose_scan_opt::check_ref_access_part1 could lead to choosing an invalid execution plan employing a loose scan access to a semi-join table even in the cases when such access could not be used at all. This could result in wrong answers for some queries with IN subqueries.
* | merge with 5.3Sergei Golubchik2011-10-191-3/+14
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | sql/sql_insert.cc: CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. ****** CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. sql/sql_table.cc: small cleanup ****** small cleanup
| * Make semi-joins work with outer joins part #1:Sergey Petrunya2011-06-221-1/+3
| | | | | | | | | | - Make make_outerjoin_info() correctly process semi-join nests - Make make_join_select() attach conditions to the right places.
| * MWL#90: Subqueries: Inside-out execution for materialized non-sj subqueriesSergey Petrunya2010-12-091-1/+9
| |\ | | | | | | | | | - Merge into 5.3-main
| | * MWL#90: Subqueries: Inside-out execution for materialized non-sj subqueriespsergey2010-07-111-1/+9
| | |\ | | | | | | | | | | | | - Merge with MariaDB 5.3 -main
| | | * MWL#90: code cleanuppsergey2010-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Remove deadcode - Improve comments - Do small several small TODOs
| | | * MWL#90, code movearound to unify merged and non-merged semi-join ↵Sergey Petrunya2010-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | materialization processing - First code, needs cleanup.
| | | * Subqueries: Inside-out execution for non-semijoin materialized subqueries ↵Sergey Petrunya2010-05-231-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | that are AND-parts of the WHERE - Code cleanup - Query plan change is due to s/ha_rows JOIN_TAB::read_time/double JOIN_TAB::read_time/
| | | * Subquery optimizations:Sergey Petrunya2010-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Better comments - Use more appropriate return types for functions - Provide handling where it was missing.
| | | * Code cleanup in subquery optimizationsSergey Petrunya2010-04-251-1/+7
| | | |
| * | | Fixed some compiler warnings found when compiling for windows.Michael Widenius2010-11-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed rows_read and rows_sent status variables to be longlong (to avoid compiler warnings) sql/item_func.cc: Fixed wrong usage of alias sql/item_subselect.cc: Changed buffer size to ulonglong to be able detect buffers bigger than size_t sql/item_subselect.h: Changed buffer size to ulonglong to be able detect buffers bigger than size_t sql/multi_range_read.cc: Fixed compiler warning by using correct type for function argument sql/mysqld.cc: Changed rows_read and rows_sent status variables to be longlong sql/opt_subselect.h: Fixed compiler warning by using correct type for function argument sql/sql_class.cc: Changed rows_read and rows_sent status variables to be longlong sql/sql_class.h: Changed rows_read and rows_sent status variables to be longlong Changed max_nulls_in_row to uint as this is number of columns in row. This fixed some compiler warnings. sql/sql_select.cc: Added casts to avoid compiler warnings storage/heap/ha_heap.cc: Initilize different types separate storage/oqgraph/ha_oqgraph.cc: Fixed argument to store(longlong) to avoid compiler warnings
* | | | lots of post-merge changesSergei Golubchik2011-04-251-2/+2
|/ / /
* | | 5.2 mergeSergei Golubchik2010-10-281-1/+1
|/ /
* | MariaDB 5.2 -> MariaDB 5.3 merge Sergey Petrunya2010-06-261-1/+1
|/
* Subquery optimization backport:Sergey Petrunya2010-02-161-0/+368
- Factor out subquery code into sql/opt_subselect.{h,cc} - Stop using the term "confluent" (was used due to misreading the dictionary)