Commit graph

31650 commits

Author SHA1 Message Date
unknown
a5731b27b7 MDEV-342: Do not mark old binlog file as cleanly closed during rotate until
the new file is fully synced to disk and binlog index. This fixes a window
where a crash would leave next server restart unable to detect that a crash
occured, causing recovery to fail.
2012-06-21 21:17:34 +02:00
unknown
e7362d457a MDEV-359: Fix another case where switch-off semisync could cause a race that ended with server crash.
This one was when the code releases and reaquires the lock with pthread_cond_wait() - and semisync is switched off meanwhile.
2012-06-21 19:02:53 +02:00
Sergei Golubchik
14b756c739 Use the portable form of INSTALL PLUGIN in rpl_mdev359.test 2012-06-21 17:39:21 +02:00
Sergei Golubchik
c2ca301cd8 fixing the order of includes in the rpl_mdev359.test 2012-06-21 14:00:19 +02:00
unknown
5e13093df1 MDEV-359: Server crash when SET GLOBAL rpl_semi_sync_master_enabled = OFF
The semisync code does a fast-but-unsafe check for enabled or not without lock,
followed by a slow-but-safe check under lock. However, if the slow check failed,
the code still referenced not valid data (in an assert() expression), causing a
crash.

Fixed by not running the incorrect assert when semisync is disabled.
2012-06-21 11:52:54 +02:00
Sergey Petrunya
8c762965d3 Merge 5.3 -> 5.5 2012-06-20 15:01:28 +04:00
Sergey Petrunya
584d923c32 Post-merge fixes:
- put back the result encoding in func_in.result (messed up by kdiff3)
- update .result for other tests (checked)
2012-06-20 13:41:31 +04:00
unknown
0b93b444b6 Merged the fix for bug lp:944706, mdev-193 2012-06-19 15:06:45 +03:00
Daniel Bartholomew
37f8094652 fixed some urls that the previous update missed 2012-06-18 17:29:05 -04:00
Sergey Petrunya
90fbd8b22b Merge 5.2->5.3 2012-06-18 22:38:11 +04:00
Sergey Petrunya
28f2c5641d 5.3->5.5 merge 2012-06-18 16:50:16 +04:00
Sergei Golubchik
b8153269f1 fix an overly agressive optimization in Item_func_conv_charset 2012-06-17 16:09:16 +02:00
Sergei Golubchik
6cf8672f43 fix innodb_bug12902967 to pass when aio check on /dev/shm fails 2012-06-16 14:58:00 +02:00
Sergei Golubchik
bf5df8ccbf merge 2012-06-16 09:03:07 +02:00
Sergei Golubchik
a247b12fe6 MDEV-316 lp:1009085 Assertion failed: warn_item, file item_cmpfunc.cc, line 3613
make sure that find_date_time_item() is called before agg_arg_charsets_for_comparison().
optimize Item_func_conv_charset to avoid conversion if no string result is needed
2012-06-15 17:22:49 +02:00
Sergei Golubchik
37f5632212 merged with XtraDB 1.1.8-26.0 2012-06-15 14:54:23 +02:00
Michael Widenius
8ad377aad9 Automatic merge 2012-06-15 13:39:07 +03:00
Michael Widenius
4a23bb9074 Removed one variable from the test output that was depending on timing.
mysql-test/suite/sphinx/sphinx.result:
  Removed sphinx_time, as it was depending on timing.
mysql-test/suite/sphinx/sphinx.test:
  Removed sphinx_time, as it was depending on timing.
2012-06-15 13:36:34 +03:00
Michael Widenius
7cd1dc5de2 Fix for: lp:1013432 and MySQL#64800:
mysqldump with --include-master-host-port putting quotes around port number
Patch from Stewart Smith

client/mysqldump.c:
  Remove quotes from MASTER_PORT
2012-06-15 13:08:10 +03:00
unknown
db6dbadb5a Fix bug lp:1008686
Analysis:
The fix for bug lp:985667 implements the method Item_subselect::no_rows_in_result()
for all main kinds of subqueries. The purpose of this method is to be called from
return_zero_rows() and set Items to some default value in the case when a query
returns no rows. Aggregates and subqueries require special treatment in this case.

Every implementation of Item_subselect::no_rows_in_result() called
Item_subselect::make_const() to set the subquery predicate to its default value
irrespective of where the predicate was located in the query. Once the predicate
was set to a constant it was never executed.

At the same time, the JOIN object of the fake select for UNIONs (the one used for
the final result of the UNION), was set after all subqueries in the union were
executed. Since we set the subquery as constant, it was never executed, and the
corresponding JOIN was never created.

In order to decide whether the result of NOT IN is NULL or FALSE, Item_in_optimizer
needs to check if the subquery result was empty or not. This is where we got the
crash, because subselect_union_engine::no_rows() checks for
unit->fake_select_lex->join->send_records, and the join object was NULL.

Solution:
If a subquery is in the HAVING clause it must be evaluated in order to know its
result, so that we can properly filter the result records. Once subqueries in the
HAVING clause are executed even in the case of no result rows, this specific
crash will be solved, because the UNION will be executed, and its JOIN will be
constructed. Therefore the fix for this crash is to narrow the fix for lp:985667,
and to apply Item_subselect::no_rows_in_result() only when the subquery predicate
is in the SELECT clause.
2012-06-15 11:33:24 +03:00
Igor Babaev
1d74ae6b42 Fixed LP bug #1002157.
The class Item_func missed an implementation of the virtual 
function update_null_value.
Back-ported the fix for bug 62125 from mysql 5.6 code line.
The test case was also back-ported.
2012-06-15 00:01:20 -07:00
unknown
cf3a499f54 Merge the fix for lp:944706, mdev-193 2012-06-14 23:55:22 +03:00
Sergei Golubchik
0522307ed1 mysql-5.5 merge 2012-06-14 20:05:31 +02:00
unknown
88d3d853f4 Fix bug lp:1008773
Analysis:
Queries with implicit grouping (there is aggregate, but no group by)
follow some non-obvious semantics in the case of empty result set.
Aggregate functions produce some special "natural" value depending on
the function. For instance MIN/MAX return NULL, COUNT returns 0.

The complexity comes from non-aggregate expressions in the select list.
If the non-aggregate expression is a constant, it can be computed, so
we should return its value, however if the expression is non-constant,
and depends on columns from the empty result set, then the only meaningful
value is NULL.

The cause of the wrong result was that for subqueries the optimizer didn't
make a difference between constant and non-constant ones in the case of
empty result for implicit grouping.

Solution:
In all implementations of Item_subselect::no_rows_in_result() check if the
subquery predicate is constant. If it is constant, do not set it to the
default value for implicit grouping, instead let it be evaluated.
2012-06-14 17:03:09 +03:00
Igor Babaev
28b4aba40a Merge. 2012-06-13 16:28:47 -07:00
Igor Babaev
64aa1fcb13 Adjusted results in pbxt.negation_elimination after the fix for lp bug 992380. 2012-06-12 10:06:26 -07:00
Sergey Petrunya
9892ace475 Merge BUG#1010351 from 5.2 to 5.5 2012-06-10 14:12:50 +04:00
Sergey Petrunya
af1909fc0e Merge 2012-06-10 14:06:11 +04:00
Sergey Petrunya
ae51b5b698 Merge 2012-06-10 14:04:21 +04:00
Sergey Petrunya
b038ad856e Merge BUG#1010351 from 5.1 to 5.2 2012-06-10 13:53:06 +04:00
Sergey Petrunya
a7229e8c20 BUG#1010351: New "via" keyword in 5.2+ can't be used as identifier anymore
- Add the VIA_SYM token into keyword_sp list, which makes it allowed for
  use as keyword and SP label.
2012-06-10 13:50:21 +04:00
Igor Babaev
10f42e2c33 Fixed LP bug #1010729.
The bug prevented acceptance of UNION queries whose non-first select 
clauses contained join expressions with degenerated single-table nests
as valid queries.
The bug was introduced into mysql-5.5 code line by the patch for
bug 33204.
2012-06-08 22:15:49 -07:00
Michael Widenius
438e9eca68 Changed last_insert_id() to be unsigned.
Fixed MDEV-331: last_insert_id() returns a signed number

mysql-test/r/auto_increment.result:
  Added test case
mysql-test/t/auto_increment.test:
  Added test case
sql/item_func.h:
  Changed last_insert_id() to be unsigned.
2012-06-08 22:12:44 +03:00
Sergei Golubchik
d2ca6d2e7f apply mysql fix for bug#58421 to XtraDB 2012-06-08 14:50:50 +02:00
unknown
e326a3893f Fixed pbxt test case not run by default. 2012-06-06 23:02:21 +03:00
unknown
c2677de7ac Merge the fix for lp:944706, mdev-193 2012-06-06 22:26:40 +03:00
Sergei Golubchik
1838938671 fixes for bintar mtr failures:
look for plugins in the correct path.
skip --plugin-load if it has the empty soname part, not only if the whole argument is empty.
2012-06-06 16:41:13 +02:00
unknown
8efc63ba5d Merge 2012-06-06 16:19:48 +03:00
Sergei Golubchik
7eaf0975ac merge 2012-06-06 14:06:13 +02:00
unknown
f1ab00891a Fixed bug lp:1000649
Analysis:

When the method JOIN::choose_subquery_plan() decided to apply
the IN-TO-EXISTS strategy, it set the unit and select_lex
uncacheable flag to UNCACHEABLE_DEPENDENT_INJECTED unconditionally.
As result, even if IN-TO-EXISTS injected non-correlated predicates,
the subquery was still treated as correlated.

Solution:
Set the subquery as correlated only if the injected predicate(s) depend
on the outer query.
2012-06-05 17:25:10 +03:00
Sergei Golubchik
265d5aaa2e MDEV-308 lp:1008516 - Failing assertion: templ->mysql_col_len == len
remove the offending assert.
take the test case from mysql Bug#58015
2012-06-04 23:22:03 +02:00
Sergei Golubchik
4361c8645b MDEV-136 Non-blocking "set read_only"
backport dmitry.shulga@oracle.com-20120209125742-w7hdxv0103ymb8ko from mysql-trunk:

  Patch for bug#11764747 (formerly known as 57612): SET GLOBAL READ_ONLY=1 cannot
  progress when a table is locked with LOCK TABLES.
  
  The reason for the bug was that mysql server makes a flush of all open tables
  during handling of statement 'SET GLOBAL READ_ONLY=1'. Therefore if some of
  these tables were locked by "LOCK TABLE ... READ" from a different connection,
  then execution of statement 'SET GLOBAL READ_ONLY=1' would be waiting for
  the lock for such table even if the table was locked in a compatible read mode.
  
  Flushing of all open tables before setting of read_only system variable
  is inherited from 5.1 implementation since this was the only possible approach
  to ensure that there isn't any pending write operations on open tables.
  
  Start from version 5.5 and above such behaviour is guaranteed by the fact
  that we acquire global_read_lock before setting read_only flag. Since
  acquiring of global_read_lock is successful only when there isn't any 
  active write operation then we can remove flushing of open tables from
  processing of SET GLOBAL READ_ONLY=1.
  
  This modification changes the server behavior so that read locks held
  by other connections (LOCK TABLE ... READ) no longer will block attempts
  to enable read_only.
2012-06-04 17:39:28 +02:00
Sergei Golubchik
3e3606d21d merge with 5.3.
Take only test cases from MDEV-136 Non-blocking "set read_only"
2012-06-04 17:26:11 +02:00
unknown
ca5473f1db Fix bug lp:1008487
Analysis:
The crash is a result of Item_cache_temporal::example not being set
(it is NULL). It turns out that the value of Item_cache_temporal
may be set directly by calling Item_cache_temporal::store_packed
without ever setting the "example" of this Item_cache. Therefore
the failing assertion is too narrow.

Solution:
Remove the assert.
In principle we could overwrite this method for Item_cache_temporal,
but it doesn't make sense just for this assert.
2012-06-04 18:06:00 +03:00
Sergey Petrunya
25ada13db0 Merge 2012-06-02 16:13:05 +04:00
Sergey Petrunya
c17216eed8 BUG#1006164: Multi-table DELETE that uses innodb + index_merge/intersect may fail to delete rows
- Set index columns to be read when using index_merge, even if TABLE->no_keyread is 
  set for the table (happens for multi-table UPDATEs)
2012-06-02 03:25:56 +04:00
Sergei Golubchik
41d860ef53 5.1 merge 2012-06-01 23:45:54 +02:00
Sergei Golubchik
34f2f8ea41 MDEV-256 lp:995501 - mysqltest attempts to parse Perl code inside a block
with false condition, gets confused and throws wrong errors
2012-06-01 17:53:59 +02:00
unknown
7ddd5418d0 Fixed bug MDEV-288
CHEAP SQ: Valgrind warnings "Memory lost" with IN and EXISTS nested subquery, materialization+semijoin

Analysis:
The memory leak was a result of the interaction of semi-join optimization
with early optimization of constant subqueries. The function:
setup_jtbm_semi_joins() created a dummy temporary table "dummy_table"
in order to make some JOIN_TAB objects complete. Normally, such temporary
tables are freed inside JOIN_TAB::cleanup.

However, the inner-most subquery is pre-optimized, which allows the
optimization fo the MAX subquery to determine that its WHERE is TRUE,
and thus to compute the result of the MAX during optimization. This
ultimately allows the optimize phase of the outer query to find that
it WHERE clause is FALSE. Once JOIN::optimize finds that the result
set is empty, it sets zero_result_cause, and returns *before* it ever
reached make_join_statistics(). As a result the query plan has no
JOIN_TABs at all. Since the temporary table is supposed to be cleanup
via JOIN_TAB::cleanup, this never happens because there is no JOIN_TAB
for this table. Hence we get a memory leak.

Solution:
Whenever there are no JOIN_TABs, iterate over all table reference in
JOIN::join_list, and free the ones that contain semi-join temporary
tables.
2012-06-01 14:10:15 +03:00
unknown
66dfceb11f Fix for bug lp:1006231
Analysis:

When a subquery that needs a temp table is executed during
the prepare or optimize phase of the outer query, at the end
of the subquery execution all the JOIN_TABs of the subquery
are replaced by a new JOIN_TAB that selects from the temp table.
However that temp table has no corresponding TABLE_LIST.
Once EXPLAIN execution reaches its last phase, it tries to print
the names of the subquery tables through its TABLE_LISTs, but in
the case of this bug there is no such TABLE_LIST (it is NULL),
hence a crash.

Solution:
The fix is to block subquery evaluation inside
Item_func_like::fix_fields and Item_func_like::select_optimize()
using the Item::is_expensive() test.
2012-05-30 19:10:18 +03:00