Commit graph

68207 commits

Author SHA1 Message Date
Sergei Golubchik
557f0d3ad0 5.2->5.3 merge 2011-11-12 18:08:12 +01:00
Alexey Botchkov
7c7269d372 merging. 2011-11-12 19:56:29 +04: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
Marko Mäkelä
8c886b3bc0 Bug #12842206 INNODB LOCKING REGRESSION FOR INSERT IGNORE: Add a test case.
The bug was accidentally fixed by fixing
Bug#11759688 52020: InnoDB can still deadlock on just INSERT...ON DUPLICATE KEY
a.k.a. the reintroduction of
Bug#7975 deadlock without any locking, simple select and update
2011-11-10 16:45:47 +02:00
Marko Mäkelä
a0a51251e4 Bug#11759688 52020: InnoDB can still deadlock on just INSERT...ON DUPLICATE KEY
a.k.a. Bug#7975 deadlock without any locking, simple select and update

Bug#7975 was reintroduced when the storage engine API was made
pluggable in MySQL 5.1. Instead of looking at thd->lex directly, we
rely on handler::extra(). But, we were looking at the wrong extra()
flag, and we were ignoring the TRX_DUP_REPLACE flag in places where we
should obey it.

innodb_replace.test: Add tests for hopefully all affected statement
types, so that bug should never ever resurface. This kind of tests
should have been added when fixing Bug#7975 in MySQL 5.0.3 in the
first place.

rb:806 approved by Sunny Bains
2011-11-10 12:49:31 +02:00
unknown
32d230d67b Fixed PBXT test cases. 2011-11-09 21:29:01 +02:00
unknown
30b396ad4c - Removed a comment that is not true any more.
- Consistent use of the SUBS_NOT_TRANSFORMED constant for in_strategy.
2011-11-09 16:46:08 +02:00
unknown
511459bd14 Enable subquery materialization=ON by default. 2011-11-09 15:36:25 +02: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
Marko Mäkelä
77eb01b827 Bug#13358468 ASSERTION FAILURE IN BTR_PCUR_GET_BLOCK
btr_pcur_restore_position_func(): When the cursor was positioned at
the tree infimum or supremum, initialize pos_state and latch_mode. The
assertion failed, because pos_state was BTR_PCUR_WAS_POSITIONED.  In
the test failure of WL#5874, the purge thread attempted to restore the
cursor position on the infimum record (the clustered index was empty).

btr_pcur_detach(), btr_pcur_is_detached(): Unused functions, remove.

rb:804 approved by Inaam Rana
2011-11-08 14:15:22 +02: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
Marko Mäkelä
b003b6294c Add debug assertions to catch Bug#13345378 earlier.
In all callers of row_sel_convert_mysql_key_to_innobase(), assert
that the converted key is empty or nonempty when it should be.
2011-11-07 13:37:19 +02: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
Tor Didriksen
0e2af2cdd3 Bug#12406055 post-push fix: unused variable 'num_chars' in optimized build.
Also fixed possibly uninitialized use of need_copy_table_res.
2011-11-01 07:50:54 +01: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
Tor Didriksen
2e7dd62646 Bug#12406055 post-push fix: unused variable 'num_chars' in optimized build. 2011-10-31 10:10:04 +01:00
Igor Babaev
0efacfcfb2 Fixed a compilation error. 2011-10-31 01:36:28 -07:00
Igor Babaev
3a7169572c Backported the test case for bug 59843 from the mysql-5.6 code line.
(Failed to reproduce the bug in mariadb-5.3).
2011-10-31 01:13:12 -07:00