summaryrefslogtreecommitdiff
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* 5.3 mergeSergei Golubchik2012-01-13127-1248/+2461
|\
| * multi-delete should ignore semi-join internal temp tables,Sergei Golubchik2012-01-131-1/+1
| | | | | | | | when looking for tables to delete from
| * lp:893522 more problems found by PVS StudioSergei Golubchik2012-01-121-1/+1
| |\
| * | Fix the comment.unknown2012-01-111-4/+2
| | |
| * | Fix for LP BUG#908269 Wrong result with subquery in select list, EXISTS, ↵unknown2012-01-102-14/+35
| | | | | | | | | | | | | | | | | | | | | | | | constant MyISAM/Aria table. Problem: When building the condition for JOIN::outer_ref_cond the optimizer forgot to take into account that this condition could depend on constant tables as well.
| * | BUG#912510: Crash in do_copy_not_null with semijoin=ON, firstmatch=ON, ↵Sergey Petrunya2012-01-082-1/+31
| | | | | | | | | | | | | | | | | | | | | aggregate ... - Create/use do_copy_nullable_row_to_notnull() function for ref access, which is used when copying from not-NULL field in table that can be NULL-complemented to not-NULL field.
| * | Fixed LP bug #910083.Igor Babaev2012-01-021-2/+1
| | | | | | | | | | | | | | | | | | The patch for bug 685411 erroneously removed a call of engine->set_thd() from Item_subselect::fix_fields().
| * | MergeSergey Petrunya2011-12-281-0/+1
| |\ \
| | * | BUG#906357: Incorrect result with outer join and full text matchSergey Petrunya2011-12-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - The problem was that const-table-reading code would try to evaluate MATCH() before init_ftfuncs() was called. - Fixed by making MATCH function "expensive" so that nobody tries to evaluate it at optimization phase.
| * | | Back-ported the patch of the mysql-5.6 code line thatIgor Babaev2011-12-242-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixed several defects in the greedy optimization: 1) The greedy optimizer calculated the 'compare-cost' (CPU-cost) for iterating over the partial plan result at each level in the query plan as 'record_count / (double) TIME_FOR_COMPARE' This cost was only used locally for 'best' calculation at each level, and *not* accumulated into the total cost for the query plan. This fix added the 'CPU-cost' of processing 'current_record_count' records at each level to 'current_read_time' *before* it is used as 'accumulated cost' argument to recursive best_extension_by_limited_search() calls. This ensured that the cost of a huge join-fanout early in the QEP was correctly reflected in the cost of the final QEP. To get identical cost for a 'best' optimized query and a straight_join with the same join order, the same change was also applied to optimize_straight_join() and get_partial_join_cost() 2) Furthermore to get equal cost for 'best' optimized query and a straight_join the new code substrcated the same '0.001' in optimize_straight_join() as it had been already done in best_extension_by_limited_search() 3) When best_extension_by_limited_search() aggregated the 'best' plan a plan was 'best' by the check : 'if ((search_depth == 1) || (current_read_time < join->best_read))' The term '(search_depth == 1' incorrectly caused a new best plan to be collected whenever the specified 'search_depth' was reached - even if this partial query plan was more expensive than what we had already found.
| * | | Backport of WL#5953 from MySQL 5.6unknown2011-12-192-1/+84
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch differs from the original MySQL patch as follows: - All test case differences have been reviewed one by one, and care has been taken to restore the original plan so that each test case executes the code path it was designed for. - A bug was found and fixed in MariaDB 5.3 in Item_allany_subselect::cleanup(). - ORDER BY is not removed because we are unsure of all effects, and it would prevent enabling ORDER BY ... LIMIT subqueries. - ref_pointer_array.m_size is not adjusted because we don't do array bounds checking, and because it looks risky. Original comment by Jorgen Loland: ------------------------------------------------------------- WL#5953 - Optimize away useless subquery clauses For IN/ALL/ANY/SOME/EXISTS subqueries, the following clauses are meaningless: * ORDER BY (since we don't support LIMIT in these subqueries) * DISTINCT * GROUP BY if there is no HAVING clause and no aggregate functions This WL detects and optimizes away these useless parts of the query during JOIN::prepare()
| * | BUG#906385: EXPLAIN EXTENDED crashes in TABLE_LIST::print with limited ↵Sergey Petrunya2011-12-191-1/+10
| | | | | | | | | | | | | | | | | | max_join_size - Take into account that subquery's optimization can fail because of @@max_join_size error.
| * | BUG#904432: Wrong result with LEFT JOIN, constant table, ↵Sergey Petrunya2011-12-191-2/+32
| | | | | | | | | | | | | | | | | | semijoin=ON,materialization=ON - Correct handling for SJ-Materialization + outer joins (details in the comments in the code)
| * | Remove garbage commentsSergey Petrunya2011-12-191-2/+0
| | |
| * | Fixed LP bug #904832.Igor Babaev2011-12-184-0/+17
| | | | | | | | | | | | | | | Do not perform index condition pushdown for conditions containing subqueries and stored functions.
| * | GIS issues fixed.Alexey Botchkov2011-12-162-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Failures on SUN Solaris. Buggy compiler there required some extra initialization for variables. Then the 02 optimization leads to bugs when values set through the pointer are not always taken into account. Finally, the (long long) / (long) crashes there, the explicit typeconverstion added. Failing innodb_plunin.innodb_gis.test fixed. per-file comments: mysql-test/suite/innodb_plugin/t/innodb_gis.test GIS issues fixed. sql/gcalc_slicescan.cc GIS issues fixed. sql/gcalc_tools.cc GIS issues fixed.
| * | MergeIgor Babaev2011-12-152-4/+6
| |\ \
| | * \ Merge.Igor Babaev2011-12-152-4/+6
| | |\ \
| | | * | Made join_cache_level == 2 by default.Igor Babaev2011-12-151-1/+1
| | | | |
| | | * | Made the optimizer switch flags 'outer_join_with_cache', 'semijoin_with_cache'Igor Babaev2011-12-152-3/+5
| | | | | | | | | | | | | | | | | | | | set to 'on' by default.
| * | | | MergeSergey Petrunya2011-12-162-10/+34
| |\ \ \ \ | | |/ / / | |/| | |
| | * | | BUG#901399: Wrong result (extra row) with semijoin=ON, materialization=OFF, ↵Sergey Petrunya2011-12-162-10/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | optimizer_prune_level=0 - Correctly handle plan refinement stage for LooseScan plans: run create_ref_for_key() if LooseScan plan includes a ref access, and if we don't have any fixed key components, switch to a full index scan.
| * | | | MergeSergey Petrunya2011-12-151-0/+1
| |\ \ \ \ | | |/ / /
| | * | | Make MyISAM's version of create_internal_tmp_table set Sergey Petrunya2011-12-151-0/+1
| | |/ / | | | | | | | | | | | | | | | | QPLAN_TMP_DISK, like Aria version does (otherwise slow query log would show Tmp_table_on_disk=No when it should have said Yes)
| * | | Fix trivial merge errorSergey Petrunya2011-12-151-3/+2
| | | |
| * | | MergeMichael Widenius2011-12-142-9/+1
| |\ \ \ | | |/ / | |/| |
| | * | Merge with 5.2Michael Widenius2011-12-141-9/+0
| | |\ \
| | | * \ Merge with 5.1Michael Widenius2011-12-132-11/+0
| | | |\ \ | | | | | | | | | | | | | | | | | | Updated version number in configure
| | | | * | Fixed valgrind problem: reference on deleted memory of temporary table name.unknown2011-12-112-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | Removed previous patch of this problem.
| | * | | | Fixed failure with query_cache.test for embedded serverMichael Widenius2011-12-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/set_var.cc: Moved query_cache_strip_comments from EMBEDDED_LIBRARY to HAVE_QUERY_CACHE
| * | | | | MergeSergey Petrunya2011-12-144-122/+300
| |\ \ \ \ \
| | * | | | | BUG#901506: Crash in TABLE_LIST::print on EXPLAIN EXTENDEDSergey Petrunya2011-12-144-122/+300
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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".
| * | | | | | MergeIgor Babaev2011-12-131-3/+4
| |\ \ \ \ \ \
| | * | | | | | Fixed LP bug #902356.Igor Babaev2011-12-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A memory overwrite in the function test_if_skip_sort_order() could cause a crash for some queries with subqueries.
| * | | | | | | BUG#902632: Crash or invalid read at st_join_table::cleanup, ↵Sergey Petrunya2011-12-141-0/+6
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | st_table::disable_keyread - Do a "more thorough" cleanup of SJ-Materialization join tab in JOIN_TAB::cleanup. The bug was due to the fact that JOIN_TAB::cleanup() may be called multiple times for the same tab if the join has grouping.
| * | | | | | The variable query_cache_strip_comments allowed in embedded server.unknown2011-12-131-2/+2
| | |/ / / / | |/| | | |
| * | | | | Automatic mergeMichael Widenius2011-12-134-26/+41
| |\ \ \ \ \
| | * | | | | Fixed valgrind error when storing db_name_length in query_cache.Michael Widenius2011-12-134-26/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Changed storage to be 2 bytes instead of sizeof(size_t) (simple optimization) - Fixed bug when using query_cache_strip_comments and query that started with '(' - Fixed DBUG_PRINT() that used wrong (not initialized) variables. mysql-test/mysql-test-run.pl: Added some space to make output more readable. mysql-test/r/query_cache.result: Updated test results mysql-test/t/query_cache.test: Added test with query_cache_strip_comments sql/mysql_priv.h: Added QUERY_CACHE_DB_LENGTH_SIZE sql/sql_cache.cc: Fixed bug when using query_cache_strip_comments and query that started with '(' Store db length in 2 characters instead of size_t. Get db length from correct position (earlier we had an error when query started with ' ') Fixed DBUG_PRINT() that used wrong (not initialized) variables.
| * | | | | | 5.2->5.3 mergeSergei Golubchik2011-12-122-1/+4
| |\ \ \ \ \ \ | | |/ / / / / | |/| | / / / | | | |/ / / | | |/| | |
| | * | | | Fixed bug lp:900375unknown2011-12-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The range optimizer incorrectly chose a loose scan for group by when there is a correlated WHERE condition. This range access method cannot be executed for correlated conditions also with the "range checked for each record" because generally the range access method can change for each outer record. Loose scan destructively changes the query plan and removes the GROUP operation, which will result in wrong query plans if another range access is chosen dynamically.
| | * | | | Fixed bug lp:888456unknown2011-12-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: The class member QUICK_GROUP_MIN_MAX_SELECT::seen_first_key was not reset between subquery re-executions. Thus each subsequent execution continued from the group that was reached by the previous subquery execution. As a result loose scan reached end of file much earlier, and returned empty result where it shouldn't. Solution: Reset seen_first_key before each re-execution of the loose scan.
| | * | | | 1. add --plugin-dir and --default-auth to mysqltest.Sergei Golubchik2011-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2. dialog plugin now always returns mysql->password if non-empty and the first question is of password type 3. split get_tty_password into get_tty_password_buff and strdup. 4. dialog plugin now uses get_tty_password by default 5. dialog.test 6. moved small tests of individual plugins into a dedicated suite
| * | | | | Fixed LP bug #901709.Igor Babaev2011-12-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cause of the reported assertion failure was a division of a double value by 0.
| * | | | | MergeIgor Babaev2011-12-113-16/+30
| |\ \ \ \ \
| | * | | | | Fixed LP bug #901478.Igor Babaev2011-12-113-16/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the duplicate elimination strategy is used for a semi-join and potentially one of the block-based join algorithms can be employed to join the inner tables of the semi-join then sorting of the head (first non-constant) table for a query with ORDER BY / GROUP BY cannot be used.
| * | | | | | Merge with 5.1 & fixes to IGNORE handlingMichael Widenius2011-12-11165-978/+2298
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| | * | | | | Rewrite IGNORE handling:Michael Widenius2011-12-1110-106/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Instead of supressing all errors, only suppress safe ones like: ER_DUP_KEY, ER_BAD_NULL_ERROR, ER_SUBQUERY_NO_1_ROW, ER_ROW_IS_REFERENCED_2
| | * | | | | Merge with 5.2.Michael Widenius2011-12-11165-878/+2238
| | |\ \ \ \ \ | | | |/ / / / | | | | | | | | | | | | | | no_error handling for select (used by INSERT ... SELECT) still needs to be fixed, but I will do that in a separate commit
| | | * | | | Merge with 5.1Michael Widenius2011-11-307-15/+43
| | | |\ \ \ \ | | | | | |/ / | | | | |/| |
| | | | * | | Fixed compiler warnings and other bugs found by buildbot.Michael Widenius2011-11-303-11/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | client/mysqltest.cc: Free mutex after usage (fixes valgrind warnings in embedded server) mysql-test/include/gis_keys.inc: Fixed failure in innodb.gis_test mysql-test/r/gis.result: Updated result mysql-test/suite/innodb/r/innodb_gis.result: Updated results mysql-test/suite/innodb/t/innodb_bug38231.test: Added handling of timeouts (happend on some servers in buildbot) mysql-test/suite/innodb_plugin/r/innodb_gis.result: Updated results mysql-test/suite/innodb_plugin/t/innodb.test: Use error names instead of numbers mysql-test/suite/innodb_plugin/t/innodb_misc1.test: This test requires utf8 mysql-test/suite/innodb_plugin/t/innodb_mysql.test: This test requires Xtradb sql/sql_base.cc: Don't print table names for placeholders. sql/sql_show.cc: Temporary fix: Save and restore db and table_name in mysqld_show_create (to get rid of valgrind warning) A better solution that needs to be investgated is to not change these fields in mysql_derived_prepare() sql/sql_view.cc: Fixed valgrind warning storage/xtradb/handler/ha_innodb.cc: Don't access THD directly