Commit graph

70526 commits

Author SHA1 Message Date
Marko Mäkelä
26ed79ec14 Fix a mistake in the Bug#12861864 fix.
row_drop_table_for_mysql(): Really flag the indexes unavailable before
starting to drop the table.
2012-02-28 21:41:55 +02:00
Karen Langford
bacd6ad2ed AIX builds fail for comments using // 2012-02-28 17:20:30 +01:00
Manish Kumar
9b2a3e6352 BUG#13333431 - INCORRECT DEFAULT PORT IN 'SHOW SLAVE HOSTS' OUTPUT
This is a post commit patch for failing test on windows.
2012-02-28 19:43:09 +05:30
Marko Mäkelä
0664bb7cd0 Bug#12861864 RACE CONDITION IN BTR_GET_SIZE() AND DROP INDEX/TABLE/DATABASE
also filed as Bug#13146269, Bug#13713178

btr_get_size(): Add mtr_t parameter. Require that the caller S-latches
index->lock. If index->page==FIL_NULL or the index is to be dropped,
return ULINT_UNDEFINED to indicate that the statistics are
unavailable.

dict_update_statistics(): If btr_get_size() returns ULINT_UNDEFINED,
fake the index cardinality statistics.

dict_index_set_page(): Unused function, remove.

row_drop_table_for_mysql(): Before starting to drop the table, mark
the indexes unavailable in the data dictionary cache while holding
index->lock X-latch.

ha_innobase::prepare_drop_index(), ha_innobase::final_drop_index():
When setting index->to_be_dropped, acquire the index->lock X-latch.

rb:960 approved by Jimmy Yang
2012-02-28 14:00:00 +02:00
Joerg Bruehe
454388a4e5 Upmerge the copyright year change, from 5.1 to 5.5. 2012-02-28 12:50:23 +01:00
Joerg Bruehe
7fecce51d9 Upmerge the copyright year change, from 5.0 to 5.1. 2012-02-28 12:44:21 +01:00
Joerg Bruehe
b6174b9285 The current year is 2012, and nobody noticed ...
Update the year in the copyright notice, file "README".
2012-02-28 12:42:02 +01:00
Manish Kumar
ee1ea1990e BUG#13333431 - INCORRECT DEFAULT PORT IN 'SHOW SLAVE HOSTS' OUTPUT
This is a post commit patch for failing test on windows.
2012-02-28 16:25:13 +05:30
Praveenkumar Hulakund
a0238152c7 Merge from 5.1 to 5.5 2012-02-29 14:15:15 +05:30
Manish Kumar
be866add06 BUG#13333431 - INCORRECT DEFAULT PORT IN 'SHOW SLAVE HOSTS' OUTPUT
Problem - The default port number shown in SHOW SLAVE HOSTS is always 3306 
          though the slave is actually listening on a different port number.
          This is a problem as the user can not be sure whether this port 
          value can be trusted and so client trying to read replication 
          topology can get confused.

Fix - 3306 ceases to be the default value of report-port. Moreover report-port
      does not have a static default any longer.
      Instead we initialize report-port to 0 as the new default value and change
      it based on two checks :

      1) If report_port is not set, the slave reports the port number its listening 
         on. (i.e. if report-port is not set we get the actual value of the slave's 
         port number).

      2) If report-port is set, we show the value report-port is set to, as the slave's
         port number.
2012-02-28 14:02:27 +05:30
Marko Mäkelä
91bd28c260 Merge mysql-5.1 to mysql-5.5. 2012-02-28 21:43:08 +02:00
Marko Mäkelä
29e12caee8 Merge mysql-5.1 to mysql-5.5. 2012-02-28 14:04:21 +02:00
Marko Mäkelä
f2799062e8 Merge mysql-5.1 to mysql-5.5. 2012-02-27 23:24:36 +02:00
Marko Mäkelä
a910b47a8c Remove a bogus BLOB debug assertion that was added in Bug#13721257 fix. 2012-02-27 23:19:14 +02:00
Annamalai Gurusami
152bb4c17d Bug#13635833: MULTIPLE CRASHES IN FOREIGN KEY CODE WITH CONCURRENT DDL/DML
There are two threads.  In one thread, dml operation is going on 
involving cascaded update operation.  In another thread, alter 
table add foreign key constraint is happening.  Under these 
circumstances, it is possible for the dml thread to access a 
dict_foreign_t object that has been freed by the ddl thread.  
The debug sync test case provides the sequence of operations.  
Without fix, the test case will crash the server (because of 
newly added assert).  With fix, the alter table stmt will return 
an error message.  
      
rb:947
approved by Jimmy Yang
2012-02-27 17:23:56 +05:30
Luis Soares
419236ed00 BUG#13693012
Automerged approved cset.
2012-02-24 16:32:46 +00:00
Luis Soares
02f44fe92b Bug#13693012: SLAVE CRASHING ON INSERT STATEMENT WITH MERGE TABLE
PROBLEM: After WL 4144, when using MyISAM Merge tables, the routine
open_and_lock_tables will append to the list of tables to lock, the
base tables that make up the MERGE table. This has two side-effects in
replication: 

  1. On the master side, we log additional table maps for the base
     tables, since they appear in the list of locked tables, even
     though we don't really use them at the slave.

  2. On the slave side, when opening a MERGE table while applying a
     ROW event, additional tables are appended to the list of tables
     to lock.

Side-effect #1 is not harmful. It's just that when using MyISAM Merge
tables a few table maps more may be logged.

Side-effect #2, is harmful, because the list rli->tables_to_lock is an
extended structure from TABLE_LIST in which the extra fields are
filled from the table maps that are processed. Since
open_and_lock_tables appends tables to the list after all table map
events have been processed we end up with entries without
replication/table map data on them. Thus when trying to access that
info for these extra tables, the server will crash.

SOLUTION: We fix side-effect #2 by making sure that we access the
replication part of the structure for those in the list that were
accounted for when processing the correspondent table map events. All
in all, we never go beyond rli->tables_to_lock_count.

We also deploy an assertion when clearing rli->tables_to_lock, making
sure that the base tables are not in the list anymore (were closed in
close_thread_tables).
2012-02-24 16:07:43 +00:00
Jimmy Yang
32df28595e Fix Bug #64432 Port bug fix #54330 from mysql-5.1 to mysql-5.5 2012-02-24 21:21:07 +08:00
Chaithra Gopalareddy
5e8eb57168 Merge from 5.1 to 5.5 2012-02-24 11:55:28 +05:30
Chaithra Gopalareddy
df8827d0e6 Bug#13012483:EXPLAIN EXTENDED, PREPARED STATEMENT, CRASH IN
CHECK_SIMPLE_EQUALITY

PROBLEM:
Crash in "check_simple_equality" when using a subquery with "IN" and
"ALL" in prepare.

ANALYSIS:
Crash can be reproduced using a simplified query like this one:
prepare s from "select 1 from g1 where 1 < all (
                select @:=(1 in (select 1 from g1)) from g1)";

This bug is currently present only on 5.5.and 5.1. Its fixed as part
of work log(#1110) in 5.6. We are taking one change to fix this
in 5.5 and 5.1.

Problem seems to be present because we are trying to evaluate "is_null"
on an argument which is part of a subquery
(In Item_is_not_null_test::update_used_tables()).
But the condition to evaluate is only when we do not have a sub query
present, which means to say that "with_subselect" is not set.
With respect to the above query, we create an object of type
"Item_in_optimizer" which by definition is always associated with a
subquery. While in 5.6 we set "with_subselect" to true for
"Item_in_optimizer" object, we do not do the same in 5.5. This results in
the evaluation for "is_null" resulting in a coredump.
So, we are now setting "with_subselect" to true for "Item_in_optimizer"
in 5.1 and 5.5.
2012-02-24 11:53:36 +05:30
Mattias Jonsson
42282c10ce Bug#13694811: THE OPTIMIZER WRONGLY USES THE FIRST INNODB
PARTITION STATISTICS

Problem was the fix for bug#11756867; It always used the first
partitions, and stopped after it checked 10 [sub]partitions.
(or until it found a partition which would contain a match).

This results in bad statistics for tables where the first 10 partitions
don't represent the majority of the data (like when the first 10
partitions only contained a few rows in total).

The solution was to take statisics from the partitions containing
the most rows instead:

Added an array of partition ids which is sorted by number of records
in descending order.

this array is used in records_in_range to cover as many records as
possible in as few calls as possible.

Also changed the limit of how many partitions to use for the statistics
from a static max of 10 partitions, into a dynamic model:
Maximum number of partitions is now log2(total number of partitions)
taken from the ordered array.
It will continue calling partitions records_in_range until it has 
checked:
(total rows in matching partitions) * (maximum number of partitions)
/ (number of used partitions)

Also reverted the changes for ha_partition::scan_time() and
ha_partition::estimate_rows_upper_bound() to before
the fix of  bug#11756867. Since they are not as slow as
records_in_range.
2012-02-22 23:13:36 +01:00
Tatjana Azundris Nuernberg
9663bc3743 auto-merge 2012-02-22 16:33:07 +01:00
Tatjana Azundris Nuernberg
5de32ed043 auto-merge 2012-02-22 16:30:24 +01:00
Tatjana Azundris Nuernberg
eca61722b0 auto-merge 2012-02-22 16:18:12 +01:00
Tor Didriksen
309d428872 Merge 5.1-security => 5.5-security 2012-02-22 11:20:52 +01:00
Tor Didriksen
067f83e642 Bug#13519724 63793: CRASH IN DTCOLLATION::SET(DTCOLLATION &SET)
Backport of fix for:
Bug#53236 Segfault in DTCollation::set(DTCollation&)
2012-02-22 11:17:50 +01:00
Vasil Dimov
916e58fdab Merge mysql-5.1 -> mysql-5.5 2012-02-21 18:20:12 +02:00
Vasil Dimov
a66f29c30c Fix Bug#13639142 64128: INNODB ERROR IN SERVER LOG OF INNODB_BUG34300
Suppress innodb_bug34300 from failing if InnoDB prints:

  120221 11:05:03  InnoDB: ERROR: the age of the last checkpoint is 9439048,
  InnoDB: which exceeds the log group capacity 9433498.

by default the log capacity is 2 log files, 5 MB each.
2012-02-21 17:57:07 +02:00
Georgi Kodinov
f5f0608b3f null-merge of the version bump to mysql-5.5 2012-02-21 14:17:01 +02:00
Georgi Kodinov
712e16e558 merged and updated the version in mysql-5.1 2012-02-21 14:14:52 +02:00
Georgi Kodinov
03f48bc650 bumped up the version of the main tree to match the security tree 2012-02-21 14:13:31 +02:00
Tatjana Azundris Nuernberg
a0acd65e3f auto-merge 2012-02-21 12:30:29 +01:00
Georgi Kodinov
d502cc7169 merge mysql-5.1-security->mysql-5.5-security 2012-02-21 11:09:12 +02:00
Georgi Kodinov
ad35745d88 merge 5.0-security->5.1-security 2012-02-21 11:06:08 +02:00
Mattias Jonsson
7e21bee031 Bug#11761296: 53775: QUERY ON PARTITIONED TABLE RETURNS CACHED
RESULT FROM PREVIOUS TRANSACTION

The current Query Cache API is not fully compatible with
the partitioning engine.

There is no good way to implement support for QC due to:
1) a static callback for ha_partition would need to have access
to all partition names and call the underlying callback for each
[sub]partition with the correct name.
2) pruning would be impossible, even if one used the ulonglong
engine_data due to if engine_data is changed, the table is
invalidated by the QC.

So the only viable solution to avoid incorrect data is to not allow
caching of queries using partitioned tables.

(There are some extra changes, due to removal of \r as line break)
2012-02-20 22:59:11 +01:00
Karen Langford
74cf0d02c1 Raise version number after cloning 5.1.62 2012-02-20 17:03:24 +01:00
Hery Ramilison
a7b4360086 cloning 5.5.22 2012-02-20 16:56:59 +01:00
Hery Ramilison
b8a675b758 cloning 5.5.22 2012-02-20 16:54:54 +01:00
Vasil Dimov
923bf1462d Adjust .result files of mysqld--help-notwin and mysqld--help-win
mtr tests.

This is a followup to vasil.dimov@oracle.com-20120217130947-03319op732dsf4m2
which added a deprecation notice to ignore-builtin-innodb
2012-02-20 13:25:37 +02:00
Sunanda Menon
c16b64c5b9 Raise version number after cloning 5.0.96 2012-02-20 06:19:12 +01:00
Tatjana Azundris Nuernberg
d660787e20 auto merge 2012-02-19 09:09:44 +00:00
Tatjana Azundris Nuernberg
9965af5c6a BUG#13431369 - MAIN.VARIABLES-NOTEMBEDDED CRASHES THE SERVER SPORADICALLY ON WINDOWS
On shutdown(), Windows can drop traffic still queued for sending even if that
wasn't specifically requested. As a result, fatal errors (those after
signaling which the server will drop the connection) were sometimes only
seen as "connection lost" on the client side, because the server-side
shutdown() erraneously discarded the correct error message before sending
it.

If on Windows, we now use the Windows API to access the (non-broken) equivalent
of shutdown().

Backport from trunk
2012-02-19 09:00:52 +00:00
Tatjana Azundris Nuernberg
108445549b BUG#13431369 - MAIN.VARIABLES-NOTEMBEDDED CRASHES THE SERVER SPORADICALLY ON WINDOWS
On shutdown(), Windows can drop traffic still queued for sending even if that
wasn't specifically requested. As a result, fatal errors (those after
signaling which the server will drop the connection) were sometimes only
seen as "connection lost" on the client side, because the server-side
shutdown() erraneously discarded the correct error message before sending
it.

If on Windows, we now use the Windows API to access the (non-broken) equivalent
of shutdown().

Backport from trunk
2012-02-19 08:57:11 +00:00
Georgi Kodinov
b932b7f954 addendum to the --builtin-innodb depreacation bug. Fixing test suite output. 2012-02-19 09:33:55 +02:00
Tatjana Azundris Nuernberg
c07e905a07 NULL merge 2012-02-19 04:11:08 +00:00
Tatjana Azundris Nuernberg
1c1bcb1c80 BUG 13454045 - 63524: BUG #35396 "ABNORMAL/IMPOSSIBLE/LARGE QUERY_TIME AND LOCK_TIME" HAPPENS A
If a query's end time is before before its start time, the system clock has been turn back
(daylight savings time etc.). When the system clock is changed, we can't tell for certain a
given query was actually slow. We did not protect against logging such a query with a bogus
execution time (resulting from end_time - start_time being negative), and possibly logging it
even though it did not really take long to run.

We now have a sanity check in place.
2012-02-19 03:18:49 +00:00
Georgi Kodinov
df22635337 Addendum to BUG#13586262 : fixed a wrong test suite output 2012-02-18 11:10:42 +02:00
Georgi Kodinov
0641851c9c empty weave merge mysql-5.1-security->mysql-5.5-security 2012-02-18 11:03:11 +02:00
Georgi Kodinov
e2221c3f41 merge mysql-5.5->mysql-5.5-security 2012-02-18 10:58:31 +02:00
Georgi Kodinov
d2549def1c merge mysql-5.1->mysql-5.1-security 2012-02-18 10:58:19 +02:00