summaryrefslogtreecommitdiff
path: root/sql/sql_select.h
Commit message (Collapse)AuthorAgeFilesLines
* 5.5.39 mergeSergei Golubchik2014-08-071-1/+3
|\
| * MDEV-6289 : Unexpected results when querying information_schemaSergey Petrunya2014-07-231-1/+3
| | | | | | | | | | | | - When traversing JOIN_TABs with first_linear_tab/next_linear_tab(), don't forget to enter the semi-join nest when it is the first table in the join order. Failure to do so could cause e.g. I_S tables not to be filled.
* | cleanup: remove special case from store_key::store_key(), add ↵Sergei Golubchik2014-06-091-15/+2
| | | | | | | | | | | | Field_blob::new_key_field (prep for MDEV-6065)
* | revert the fix for MDEV-5898, restore the fix for MDEV-5549.Sergei Golubchik2014-06-051-0/+7
| | | | | | | | simplify test case for MDEV-5898
* | MDEV-5898 FOUND_ROWS() return incorrect value when using DISTINCTSergei Golubchik2014-03-191-7/+0
| | | | | | | | | | revert the fix for MDEV-5549, use a different approach.
* | Merge.Igor Babaev2014-03-191-1/+1
|\ \
| * | Fixed bug mdev-5191.Igor Babaev2014-03-181-2/+1
| | | | | | | | | | | | | | | Corrected cost estimates when a join buffer is used and the optimizer is requested to use condition selectivities.
* | | 10.0-base mergeSergei Golubchik2014-02-261-1/+2
|\ \ \
| * \ \ 5.5 mergeSergei Golubchik2014-02-251-1/+2
| |\ \ \ | | |/ / | |/| / | | |/
| | * 5.3 mergeSergei Golubchik2014-02-221-1/+2
| | |\
| | | * MDEV-5581: Server crashes in in JOIN::prepare on 2nd execution of PS with ↵Sergey Petrunya2014-02-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | materialization+semijoin - The problem was that JOIN::prepare() tried to set TABLE::maybe_null for a table in join. Non-merged semi-join tables 1) are present as join's base tables on second EXECUTE, but 2) do not yet have a TABLE object. Worked around the problem by putting mixed_implicit_grouping into JOIN object, and then passing it to JTBM tables in setup_jtbm_semi_joins().
* | | | MDEV-5314 - Compiling fails on OSX using clangSergey Vojtovich2014-02-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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++.
* | | | MDEV-5549 Wrong row counter in found_rows() resultSergei Golubchik2014-02-011-0/+7
| | | | | | | | | | | | | | | | only let filesort() count rows for SQL_CALC_ROWS if it's using priority queue
* | | | merge 10.0-base -> 10.0unknown2013-10-291-2/+2
|\ \ \ \ | |/ / /
| * | | merge 5.5->10.0-baseunknown2013-10-291-2/+2
| |\ \ \ | | |/ /
| | * | Merge 5.3->5.5unknown2013-10-291-2/+2
| | |\ \ | | | |/
| | | * MDEV-5104 crash in Item_field::used_tables with broken order bytimour@askmonty.org2013-10-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: st_select_lex_unit::prepare() computes can_skip_order_by as TRUE. As a result join->prepare() gets called with order == NULL, and doesn't do name resolution for the inner ORDER clause. Due to this the prepare phase doesn't detect that the query references non-exiting function and field. Later join->optimize() calls update_used_tables() for a non-resolved Item_field, which understandably has no Field object. This call results in a crash. Solution: Resolve unnecessary ORDER BY clauses to detect if they reference non-exising objects. Then remove such clauses from the JOIN object.
* | | | 10.0-base merge (roles)Sergei Golubchik2013-10-291-0/+1
|\ \ \ \ | |/ / /
| * | | MDEV-5123 Remove duplicated conditions pushed both to join_tab->select_cond ↵timour@askmonty.org2013-10-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and join_tab->cache_select->cond for blocked joins. BNL and BNLH joins pre-filter the records from a joined table via JOIN_TAB::cache_select->cond. There is no need to re-evaluate the same conditions via JOIN_TAB::select_cond. This patch removes the duplicated conditions from the top-level conjuncts of each pushed condition. The added "Using where" in few EXPLAINs is due to taking into account tab->cache_select->cond in addition to tab->select_cond in JOIN::save_explain_data_intern.
* | | | Merge 10.0-base -> 10.0Sergey Petrunya2013-10-161-7/+47
|\ \ \ \ | |/ / /
| * | | MDEV-3798: [SHOW] EXPLAIN UPDATE/DELETESergey Petrunya2013-10-151-7/+47
| |\ \ \ | | | | | | | | | | | | | | | - Merge with 10.0-base
| | * | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-151-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | - eliminate join_save_qpf() function.
| | * | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | - Produce correct #rows for ORDER BY ... LIMIT N queries that take advantage of ordered index read to read only N rows.
| | * | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - if EXPLAIN DELETE prints "Deleting all rows", it should show the expected number of rows in the rows column.
| | * | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | - Add support for EXPLAIN INSERT.
| | * | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | - Address review feedback: rename files
| | * | | MDEV-3798: EXPLAIN UPDATE/DELETESergey Petrunya2013-10-051-5/+11
| | | | | | | | | | | | | | | | | | | | - Address review feedback: rename nearly any name used by the new EXPLAIN code.
| | * | | MDEV-5093, MDEV-5094:Sergey Petrunya2013-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | - Make EXPLAIN {PARTITIONS,EXTENDED} {UPDATE,DELETE} work.
| | * | | Code cleanupSergey Petrunya2013-09-041-1/+0
| | | | |
| | * | | [SHOW] EXPLAIN UPDATE/DELETE, code re-structuringSergey Petrunya2013-08-241-6/+36
| | |\ \ \ | | | | | | | | | | | | | | | | | | - Merge with current 10.0-base
| | | * | | [SHOW] EXPLAIN UPDATE/DELETE, code re-structuringSergey Petrunya2013-06-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make query plan be re-saved after the first join execution (saving it after JOIN::cleanup is too late because EXPLAIN output is currently produced before that) - Handle QPF allocation/deallocation for edge cases, like unsuccessful BINLOG command. - Work around the problem with UNION's direct subselects not being visible. - Update test results ("Using temporary; Using filesort" are now always printed last in the Extra column) - This cset gets rid of memory leaks/crashes. Some result mismatches still remain.
| | | * | | Switching [EXPLAIN] UPDATE/DELETE to rely on query plan footprints.Sergey Petrunya2013-06-201-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This requires that subselect's footprints are saved before it is deleted. Attempt to save select's QPF exposes one to a variety of edge cases: - the select may be a UNION's "fake select" which has no valid id - optimization may fail in the middle (but subsequent JOIN::optimize() calls will succeed, despite the fact that there never was a query plan)
| | | * | | SHOW EXPLAIN UPDATE/DELETESergey Petrunya2013-06-171-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Introduce "Query Plan Footprints" (abbrev. QPFs) QPF is a part of query plan that is 1. sufficient to produce EXPLAIN output, 2. can be used to produce EXPLAIN output even after its subquery/union was executed and deleted 3. is cheap to save so that we can always save query plans - This patch doesn't fully address #2, we make/save strings for a number of EXPLAIN's columns. This will be fixed.
| | | * | | [SHOW] EXPLAIN UPDATE/DELETE - Merge with 10.0-baseSergey Petrunya2013-05-271-0/+22
| | | |\ \ \
| | | | * | | EXPLAIN DELETE for MariaDBSergey Petrunya2013-02-121-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Backported the code to 10.0-base - Removed incorrect assert
* | | | | | | Merge 10.0-base -> 10.0Alexander Barkov2013-10-151-2/+3
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Merge 5.5->10.0-baseIgor Babaev2013-10-131-2/+3
| |\ \ \ \ \ \ | | | |_|_|/ / | | |/| | | |
| | * | | | | Merge 5.3-5.5Igor Babaev2013-10-131-2/+3
| | |\ \ \ \ \ | | | | |_|_|/ | | | |/| | |
| | | * | | | Fixed bug mdev-5028.Igor Babaev2013-10-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently in a general case a short-cut for the distinct optimization is invalid if join buffers are used to join tables after the tables whose values are to selected.
* | | | | | | 10.0-base merge.Sergei Golubchik2013-09-211-1/+9
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | 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-1/+9
| |\ \ \ \ \ \ | | |/ / / / / | | | | / / / | | |_|/ / / | |/| | | |
| | * | | | MDEV-4978 - Server cursor is broken with blobs in the select list,Sergey Vojtovich2013-09-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ORDER BY does not work Use "dynamic" row format (instead of "block") for MARIA internal temporary tables created for cursors. With "block" row format MARIA may shuffle rows, with "dynamic" row format records are inserted sequentially (there are no gaps in data file while we fill temporary tables). This is needed to preserve row order when scanning materialized cursors.
| | * | | | Automatic merge of MDEV-4836 fix into 5.5Sergey Petrunya2013-08-281-0/+2
| | |\ \ \ \
| | | * | | | Fix for MDEV-4836 fix: take into account situation where "notnull_col IS ↵Sergey Petrunya2013-08-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NULL" is not a direct child of the WHERE clause item, but rather is embedded inside Item_cond_and or Item_cond_or.
| | | * | | | MDEV-4836: Wrong result on <not null date column> IS NULL (old documented ↵Sergey Petrunya2013-08-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hack stopped working) - When applying optimization introduced by MDEV-4817, ignore the conditions that have form "datetime_not_null_col IS NULL".
| | * | | | | Merge 5.3->5.5Igor Babaev2013-08-271-0/+5
| | |\ \ \ \ \ | | | |/ / / / | | |/| / / / | | | |/ / /
| | | * | | Fixed bug mdev-4944.Igor Babaev2013-08-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch to fix mdev-4418 turned out to be incorrect. At the substitution of single row tables in make_join_statistics() the used multiple equalities may change and references to the new multiple equalities must be updated. The function remove_eq_conds() takes care of it and it should be called right after the substitution of single row tables. Calling it after the call of make_join_statistics was a mistake.
* | | | | | 10.0-base mergeSergei Golubchik2013-07-181-2/+9
|\ \ \ \ \ \ | |/ / / / /
| * | | | | 5.5 mergeSergei Golubchik2013-07-171-2/+9
| |\ \ \ \ \ | | |/ / / / | | | | / / | | |_|/ / | |/| | |
| | * | | mdev-4173: Wrong result (extra row) with semijoin=on, joins in outer query, ↵Sergey Petrunya2013-07-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LEFT JOIN in the subquery Apply the patch from Patryk Pomykalski: - create_internal_tmp_table_from_heap() will now return information whether the last row that we tried to write was a duplicate row. (mysql-5.6 also has this change)