Commit graph

67712 commits

Author SHA1 Message Date
Igor Babaev
c05e5b9c65 Fixed LP bug #887479.
The function setup_semijoin_dups_elimination erroneously assumed
that if join_cache_level is set to 3 or 4 then the type of the
access to a table cannot be JT_REF or JT_EQ_REF. This could lead
to wrong query result sets.
2011-11-16 06:11:25 -08:00
Igor Babaev
4d358f48c9 Merge. 2011-11-15 14:35:36 -08:00
Igor Babaev
b4b7d941fe Fixed LP bug #889750.
If the optimizer switch 'semijoin_with_cache' is set to 'off' then 
join cache cannot be used to join inner tables of a semijoin.

Also fixed a bug in the function check_join_cache_usage() that led
to wrong output of the EXPLAIN commands for some test cases.
2011-11-15 13:03:00 -08:00
unknown
147721bbb6 Fix bug lp:889744
MariaDB 5.5 merges changes from MySQL 5.5 where all constant
expressions are wrapped into an Item_cache. As a result, constant
single-row subqueries were also wrapped in an Item_cache.
When analyzing the where clause for constant expressions that
can be evaluated during optimization, subqueries wrapped into
an Item_cache did not appear as expensive, and were therefore
evaluated during optimization. Such evaluation is against the
current architecture of MariaDB 5.3 where subquries are executed
during the execute phase.

The patch adds the is_expensive() predicate to Item_cache.
This makes Item_cache consistent with other wrapping Item
classes that need to look at the properties of the wrapped
object.
2011-11-14 19:24:36 +02:00
Sergei Golubchik
c25f472599 5.2->5.3 merge 2011-11-14 00:32:21 +01:00
Sergei Golubchik
b5d41c1c11 5.1->5.2 merge 2011-11-13 18:41:45 +01:00
Sergei Golubchik
ac20f84e7e don't make feedback_plugin_send.test as 'big'
don't assume that the http reply packet will arrive in all in one piece
2011-11-13 13:28:35 +01:00
unknown
f76bfc40ea Fix for LP BUG#824425: Prohibiting subqueries in rows for left part of IN/ALL/ANY
Fix for walk() method of subqueries: always call the method on the subquery.
2011-11-13 12:02:13 +02:00
Sergei Golubchik
3fb60b1df0 5.2->5.3 merge 2011-11-13 09:10:45 +01:00
Sergei Golubchik
0d6a25fcc8 5.1-5.2 merge 2011-11-13 08:30:03 +01:00
Sergei Golubchik
f967575457 increase feedback plugin version 2011-11-12 18:40:51 +01:00
Sergei Golubchik
557f0d3ad0 5.2->5.3 merge 2011-11-12 18:08:12 +01:00
Sergei Golubchik
27095a24f6 5.1 merge 2011-11-12 16:47:14 +01:00
Sergei Golubchik
5c7aa5f2ae feedback plugin:
fix for mem_total on windows
  report the time of the data snapshot
2011-11-12 16:41:00 +01:00
Igor Babaev
db0aed9348 Merge. 2011-11-12 03:57:46 -08:00
Igor Babaev
28b2eaa81a Fixed LP bug #823301.
A bug in the code of the function key_or could lead to a situation
when performing of an OR operation for one index changes the result
the operation for another index. This bug is fixed with this patch.

Also corrected the specification and the code of the function 
or_sel_tree_with_checks.
2011-11-12 02:20:44 -08:00
unknown
7ab789ef33 Remove unused variable detected by GCC 4.6.1. 2011-11-12 12:03:27 +02:00
unknown
1d721d0106 Fix MySQL BUG#12329653
In MariaDB, when running in ONLY_FULL_GROUP_BY mode,
the server produced in incorrect error message that there
is an aggregate function without GROUP BY, for artificially
created MIN/MAX functions during subquery MIN/MAX optimization.

The fix introduces a way to distinguish between artifially
created MIN/MAX functions as a result of a rewrite, and normal
ones present in the query. The test for ONLY_FULL_GROUP_BY violation
now tests in addition if a MIN/MAX function was part of a MIN/MAX
subquery rewrite.

In order to be able to distinguish these MIN/MAX functions, the
patch introduces an additional flag in Item_in_subselect::in_strategy -
SUBS_STRATEGY_CHOSEN. This flag is set when the optimizer makes its
final choice of a subuqery strategy. In order to make the choice
consistent, access to Item_in_subselect::in_strategy is provided
via new class methods.
******
Fix MySQL BUG#12329653

In MariaDB, when running in ONLY_FULL_GROUP_BY mode,
the server produced in incorrect error message that there
is an aggregate function without GROUP BY, for artificially
created MIN/MAX functions during subquery MIN/MAX optimization.

The fix introduces a way to distinguish between artifially
created MIN/MAX functions as a result of a rewrite, and normal
ones present in the query. The test for ONLY_FULL_GROUP_BY violation
now tests in addition if a MIN/MAX function was part of a MIN/MAX
subquery rewrite.

In order to be able to distinguish these MIN/MAX functions, the
patch introduces an additional flag in Item_in_subselect::in_strategy -
SUBS_STRATEGY_CHOSEN. This flag is set when the optimizer makes its
final choice of a subuqery strategy. In order to make the choice
consistent, access to Item_in_subselect::in_strategy is provided
via new class methods.
2011-11-12 11:29:12 +02:00
Igor Babaev
b91a6bd88b Fixed LP bug #879871.
The function add_ref_to_table_cond missed updating the value of
join_tab->pre_idx_push_select_cond after having updated the value
of join_tab->select->pre_idx_push_select_cond.
2011-11-11 14:53:26 -08:00
Igor Babaev
402258ff95 Merge of the maria-5.3-icp tree into the 5.3 tree 2011-11-10 13:28:02 -08:00
Sergei Golubchik
04f3ecf632 typos fixed
(thanks viva64.com)
2011-11-08 23:07:19 +01:00
Igor Babaev
9426530d36 Merge. 2011-11-08 08:04:48 -08:00
Sergey Petrunya
7c7611d728 BUG#887026: Wrong result with ICP, outer join, subquery in maria-5.3-icp
- Do not push index condition if we're using a triggered ref access.
2011-11-07 23:30:03 +04:00
Sergey Petrunya
250bc599bf Make subselect_extra_no_semijoin.test run the tests with semijoin=off,
update test results
2011-11-07 16:39:02 +04:00
Igor Babaev
e0500dbc3a Merge. 2011-11-06 13:44:59 -08:00
Igor Babaev
e0c1b3f242 Fixed LP bug #886145.
The bug happened because in some cases the function JOIN::exec
did not save the value of TABLE::pre_idx_push_select_cond in
TABLE::select->pre_idx_push_select_cond for the sort table.

Noticed and fixed a bug in the function make_cond_remainder
that builds the remainder condition after extraction of an index
pushdown condition from the where condition. The code
erroneously assumed that the function make_cond_for_table left
the value of ICP_COND_USES_INDEX_ONLY in sub-condition markers.
Adjusted many result files from the regression test suite
after this fix .
2011-11-06 01:23:03 -07:00
Igor Babaev
928e94fb98 Fixed LP bug #885168.
The call of the virtual function cancel_pushed_idx_cond in the code of
the function test_if_skip_sort_order was misplaced when backporting the
fix for bug 58816.
2011-11-04 05:39:45 -07:00
unknown
755cd443f9 Merge of gcc 4.6 fixes 2011-11-04 12:41:27 +02:00
Michael Widenius
ff92a3af8b Fixed that test doesn't abort if 'var' points to a deleted directory (common case when using --mem)
Better error message if --log-bin is used without --log-bin-index

mysql-test/lib/v1/mysql-test-run.pl:
  Fixed that test doesn't abort if 'var' points to a deleted directory (common case when using --mem)
sql/mysqld.cc:
  Better error message if --log-bin is used without --log-bin-index
2011-11-04 12:04:12 +02:00
Michael Widenius
5fe4a51cff Fixed lp:884101 "Crash in check_table_is_closed with concurrent workload"
storage/myisam/mi_dbug.c:
  Added mutex to protect open table list while traversing it
2011-11-04 10:14:25 +02:00
Sergei Golubchik
6c27730adb rename binlog_dbug_fsync_sleep -> debug_binlog_fsync_sleep 2011-11-03 13:00:25 +01:00
Sergei Golubchik
fb43946dad cast.test: use exact double, to be independent from compiler optimizations 2011-11-03 12:59:48 +01:00
Sergey Petrunya
178c6eced6 Merge 2011-11-02 22:06:22 +04:00
Sergey Petrunya
9b761df393 BUG#878753: Assertion '0' failed in replace_where_subcondition with derived_merge
- Remove the assert in replace_where_subcondition (the patch has explanation why)
2011-11-02 22:05:08 +04:00
Sergey Petrunya
483fe0ad40 Change the default @@optimizer_switch settings:
- More test result updates (the errors are the same, the difference is that "at row X" became "at row Y" due to
  queries with semi-joins producing select results in different order)
2011-11-02 20:01:50 +04:00
Sergey Petrunya
fd18146d36 Fix "unused variable addr" warning 2011-11-02 19:52:11 +04:00
Sergey Petrunya
41e68e7a74 Merge 2011-11-02 19:37:26 +04:00
Sergey Petrunya
600a03bf53 Change the default @@optimizer_switch settings:
- More test result updates
2011-11-02 19:36:08 +04:00
Sergey Petrunya
64351feaac Merge 2011-11-02 13:51:47 +04:00
Sergey Petrunya
47861a6577 Change the default @@optimizer_switch settings:
- semijoin=on
- firstmatch=on
- loosescan=on
2011-11-02 13:48:41 +04:00
Igor Babaev
c1ebb566b3 Merge. 2011-11-02 01:22:11 -07:00
unknown
e6d01ad3b9 Merge of LP BUG#872775 fix 2011-11-02 10:05:07 +02:00
unknown
6498687325 Fix bug lp:833702
Analysis:
Equality propagation propagated the constant '7' into
args[0] of the Item_in_optimizer that stands for the
"< ANY" predicate. At the same the min/max subquery
rewrite swapped the order of the left and right operands
of the "<" predicate, but used Item_in_subselect::left_expr.

As a result, when the <ANY predicate is executed early in the
execution phase as a contant condition, instead of a constant
right (swapped) argument of the < predicate, there was a field
(t3.a). This field had no data, since the whole predicate is
considered constant, and it is evaluated before any tables are
read. Having junk in the field row buffer produced wrong result

Solution:
Fix create_swap to pick the correct Item_in_optimizer left
argument.
2011-11-01 18:19:19 +02:00
unknown
b40bc2b3e3 Fix of LP BUG#872775.
The problem was that merged views has its own nest_level numbering =>
when we compare nest levels we should take into considiration basis (i.e. 0 level),
if it is different then nest levels are not comparable.
2011-11-01 17:42:52 +02:00
Igor Babaev
a70f7aa5fe Backported the fix and the test case for bug 12822678 from the mysql-5.6 code line.
Fixed a bug in select_describe.
Adjusted results for affected test cases.
2011-11-01 07:00:55 -07:00
unknown
9c5644e6b7 Fix of typo. 2011-11-01 13:22:09 +02:00
Sergey Petrunya
f2b6f4e3df BUG#884184: Wrong result with RIGHT JOIN + derived_merge
- Make eliminate_tables_for_list() take into account that it is not possible
  to eliminate a table if it is used in the upper-side ON expressions. Example:

    xxx JOIN (t1 LEFT JOIN t2 ON cond ) ON func(t2.columns)

  Here it would eliminate t2 which is not possible because of use of t2.columns.
2011-11-01 12:36:43 +04:00
Sergey Petrunya
acb2d4aad8 BUG#884631: Table elimination works 5.3 release builds even if turned off
- Make table elimination to actually switch itself on/off in release builds.
2011-11-01 12:04:11 +04:00
Sergey Petrunya
57b3fefa03 BUG#882994: Crash in QUICK_RANGE_SELECT::reset with derived_with_keys
- The bug was caused by the following scenario:
  = a quick select is created with get_quick_select_for_ref. The quick 
    select refers to temporary (derived) table. It saves table->file, which
    refers to a ha_heap object.
  = When temp table is populated, ha_heap reaches max. size and is converted
    to a ha_myisam.  However, quick->file remains pointing to where ha_heap 
    was. 
  = Attempt to use the quick select causes crash.
- Fixed by introducing QUICK_SELECT_I::replace_handler(). Note that it will 
  not work for index_merge quick selects. Which is fine, because these
  quick selects are never created for derived tables.
2011-10-31 15:07:43 +04:00
Igor Babaev
0efacfcfb2 Fixed a compilation error. 2011-10-31 01:36:28 -07:00