Commit graph

59103 commits

Author SHA1 Message Date
7e2078c995 Bug #49137 Replication failure on SBR/MBR + multi-table DROP TEMPORARY TABLE
Fixed valgrind failure on PB2.
2010-01-06 10:44:14 +08:00
cae9c79772 Bug #49137 Replication failure on SBR/MBR + multi-table DROP TEMPORARY TABLE
Fixed valgrind failure on PB2.
2010-01-06 10:36:29 +08:00
Luis Soares
4923b4157c BUG#50018: binlog corruption when table has many columns
For tables with metadata sizes ranging from 251 to 255 the size
of the event data (m_data_size) was being improperly calculated
in the Table_map_log_event constructor. This was due to the fact
that when writing the Table_map_log_event body (in
Table_map_log_event::write_data_body) a call to net_store_length
is made for packing the m_field_metadata_size. It happens that
net_store_length uses *one* byte for storing
m_field_metadata_size when it is smaller than 251 but *three*
bytes when it exceeds that value. BUG 42749 had already
pinpointed and fix this fact, but the fix was incomplete, as the
calculation in the Table_map_log_event constructor considers 255
instead of 251 as the threshold to increment m_data_size by
three. Thence, the window for having a mismatch between the
number of bytes written and the number of bytes accounted in the
event length (m_data_size) was left open for
m_field_metadata_size values between 251 and 255.

We fix this by changing the condition in the Table_map_log_event
constructor to match the one in the net_store_length, ie,
increment one byte if m_field_metadata_size < 251 and three if it
exceeds this value.
2010-01-06 00:44:31 +00:00
He Zhenxing
28fbf9c549 Bug#48776 row based replication breaks with spatial / geometry types, cause crashes!
This bug is the same problem as Bug 49836 for 5.1 versions.
2010-01-05 14:25:29 +08:00
dbe02e6d4a Bug #49137 Replication failure on SBR/MBR + multi-table DROP TEMPORARY TABLE
In statement-based or mixed-mode replication, use DROP TEMPORARY TABLE
to drop multiple tables causes different errors on master and slave, 
when one or more of these tables do not exist. Because when executed
on slave, it would automatically add IF EXISTS to the query to ignore
all ER_BAD_TABLE_ERROR errors.

To fix the problem, do not add IF EXISTS when executing DROP TEMPORARY
TABLE on the slave, and clear the ER_BAD_TABLE_ERROR error after
execution if the query does not expect any errors.
2009-12-31 12:04:19 +08:00
ccc3a46856 Bug #49137 Replication failure on SBR/MBR + multi-table DROP TEMPORARY TABLE
In statement-based or mixed-mode replication, use DROP TEMPORARY TABLE
to drop multiple tables causes different errors on master and slave, 
when one or more of these tables do not exist. Because when executed
on slave, it would automatically add IF EXISTS to the query to ignore
all ER_BAD_TABLE_ERROR errors.

To fix the problem, do not add IF EXISTS when executing DROP TEMPORARY
TABLE on the slave, and clear the ER_BAD_TABLE_ERROR error after
execution if the query does not expect any errors.
2009-12-31 11:33:10 +08:00
Kent Boortz
5f60e1ef7b Merge 2009-12-30 23:26:49 +01:00
Kent Boortz
d64f049351 Removed unwanted Perl DBI dependency 2009-12-30 23:06:14 +01:00
Ramil Kalimullin
176a4172e7 Auto-merge. 2009-12-26 15:25:56 +04:00
Ramil Kalimullin
6c16fb6d4e Auto-merge. 2009-12-26 14:59:56 +04:00
Luis Soares
b367b03bcb BUG#48738: null merge mysql-5.0-bugteam into mysql-5.1-bugteam latest. 2009-12-24 15:26:15 +00:00
Luis Soares
6d96d334fa BUG#48738: post-push fix. Multi-platform test improvements, mainly
to make the test run gracefully on windows.

There was also a syntax error in windows part of the test.
2009-12-24 15:20:58 +00:00
Georgi Kodinov
c968fd4818 Bug #49512 : subquery with aggregate function crash
subselect_single_select_engine::exec()

When a subquery doesn't need to be evaluated because
it returns only aggregate functions and these aggregates
can be calculated from the metadata about the table it
was not updating all the relevant members of the JOIN 
structure to reflect that this is a constant query.
This caused problems to the enclosing subquery 
('<> SOME' in the test case above) trying to read some
data about the tables.

Fixed by setting const_tables to the number of tables 
when the SELECT is optimized away.
2009-12-23 17:11:22 +02:00
Georgi Kodinov
f79e182a9c revert of the fix for bug #45989: pushed by mistake. 2010-01-19 14:48:41 +02:00
Mattias Jonsson
c26551e15d merge 2010-01-19 12:18:48 +01:00
Georgi Kodinov
409f0ed83a merge 2010-01-19 12:45:34 +02:00
Sergey Glukhov
baacdf1dae Bug#49501 Inefficient information_schema check (system collation)
added check_length optimization for I_S_NAME comparison
2010-01-19 13:03:40 +04:00
Mattias Jonsson
b1987bdcbf Bug#47343: InnoDB fails to clean-up after lock wait timeout on
REORGANIZE PARTITION

There were several problems which lead to this this,
all related to bad error handling.

1) There was several bugs preventing the ddl-log to be used for
   cleaning up created files on error.

2) The error handling after the copy partition rows did not close
   and unlock the tables, resulting in deletion of partitions
   which were in use, which lead InnoDB to put the partition to
   drop in a background queue.
2010-01-18 17:49:18 +01:00
Georgi Kodinov
a3b4065d90 Bug #45989 take 2 : memory leak after explain encounters an
error in the query.

Fixes a leak after materializing a GROUP BY subquery to a 
temp table when the subquery has a blob column in the SELECT
list.
Fixed by correctly destructing temporary buffers after doing
the conversion.
2010-01-18 17:50:46 +02:00
Georgi Kodinov
24ab16096b Bug #39022: Mysql randomly crashing in lock_sec_rec_cons_read_sees
flush_cached_records() was not correctly checking for errors after calling
Item::val_xxx() methods. The expressions may contain subqueries
or stored procedures that cause errors that should stop the statement.
Fixed by correctly checking for errors and propagating them up the call stack.
2009-12-23 12:45:18 +02:00
Sergey Glukhov
271f418ca7 Bug#47736 killing a select from a view when the view is processing a function, asserts
hide_view_error() does not take into account that thread query may be killed.
Added a check for thd->killed.
Addon: backported bug32140 fix from 6.0
2010-02-05 13:39:46 +04:00
31348b438d Bug #50061 Test "rpl_loaddata_symlink" uses a Unix-specific "run-slave" script
Bug #49984  	Test 'rpl_loaddata_symlink' fails with "Could not find target log"

Sometimes the symbolic link is available on Windows if
you have some Unix (emulation) layer installed like
Cygwin, MKS or other. But symbolic link is not always
available. It depends on versions, file volume and
system environment of Windows. And the symbolic link
is not typically used on Windows, at least not in the
degree and style they are used on Unix. We can not 
change the test case to do without symbolic link,
because the test case is used to test that if the
symbolic link works fine.

To fix the problem, skip the test on windows.
2010-02-05 14:49:01 +08:00
Joerg Bruehe
a08fb1fe5a Automerge from main tree. 2010-02-04 20:32:25 +01:00
Kent Boortz
3429b198b2 LT_INIT and LT_PREREQ was added in libtool 2.2 2008, a bit too
recent, switched back to the older AC_PROG_LIBTOOL
2010-02-04 19:27:09 +01:00
Georgi Kodinov
c9df74c802 Addendum to the fix for bug #45989
Need to make sure the tmp join doesn't point to the structure already 
freed by the cleanup() for the "base" join, as this can lead to 
double free, because sometimes both tmp_join and join point to the 
same tmp_table_params.copy_field array.
2010-02-04 18:51:55 +02:00
Georgi Kodinov
8ceefc7d75 merge 2010-02-04 17:38:49 +02:00
Georgi Kodinov
d89dbfa176 merge 2010-02-04 17:24:58 +02:00
hery.ramilison@sun.com
1c9ab8d6ee Raise version number after cloning 5.1.44 2010-02-04 12:23:33 +01:00
Georgi Kodinov
3e699a7972 merge 2010-02-04 12:14:44 +02:00
Georgi Kodinov
21dbe024cd tree name change 2010-02-04 12:13:29 +02:00
Georgi Kodinov
ea992477af merge 2010-02-03 17:27:55 +02:00
Georgi Kodinov
38f8869703 merge 2010-02-03 17:25:29 +02:00
Kent Boortz
21a6569952 Adjuster the parsing of "configure.in" version number line 2010-02-03 14:52:11 +01:00
Luis Soares
90f7cfa6ac automerge mysql-5.1-bugteam bug clone --> mysql-5.1-bugteam latest. 2010-02-03 12:12:51 +00:00
Georgi Kodinov
0569a827ea Bug #45989 take 2 : memory leak after explain encounters an
error in the query.

Fixes a leak after materializing a GROUP BY subquery to a 
temp table when the subquery has a blob column in the SELECT
list.
Fixed by correctly destructing temporary buffers for re-usable
queries
2010-02-02 18:30:23 +02:00
Staale Smedseng
e3c1c83a16 Recommit of Bug#49447. 2010-02-04 13:39:42 +01:00
Luis Soares
d8bd11e5b1 BUG#47639: The rpl_binlog_corruption test fails on Windows
The test case rpl_binlog_corruption fails on windows because when
adding a line to the binary log index file it gets terminated
with a CR+LF (which btw, is the normal case in windows, but not on
Unixes - LF). This causes mismatch between the relay log names,
causing mysqld to report that it cannot find the log file.

We fix this by creating the instrumented index file through
mysql, ie, using SELECT ... INTO DUMPFILE ..., as opposed on
relying on ultimatly OS commands like: -- echo "..." >
index. These changes go into the file and make the procedure
platform independent:

  include/setup_fake_relay_log.inc

Side note: when using SELECT ... INTO DUMPFILE ..., one needs to
check if mysqld is running with secure_file_priv. If it is, we do
it in two steps: 1. create the file on the allowed location;
2. move it to the datadir. If it is not, then we just create the
file directly on the datadir (so previous step 2. is not needed).
2010-02-02 15:16:47 +00:00
karen.langford@sun.com
35960b6137 Raise version number after cloning 5.1.43 2010-01-15 18:03:48 +01:00
Mattias Jonsson
94709df7cc Bug#49742: Partition Pruning not working correctly for RANGE
Problem was when calculating the range of partitions for
pruning.

Solution was to get the calculation correct. I also simplified
it a bit for easier understanding.
2009-12-22 18:59:37 +01:00
Georgi Kodinov
ef22a7bfb9 Bug #49734: Crash on EXPLAIN EXTENDED UNION ... ORDER BY <any non-const-function>
Several problems fixed : 
1. Non constant expressions in UNION ... ORDER BY were not correctly cleaned up
in st_select_lex_unit::cleanup() causing crashes in EXPLAIN EXTENDED because of
fields quoted by these expressions pointing to the already freed temporary table
used to calculate the UNION.
Fixed by correctly cleaning up expressions of any depth.

2. Subqueries in the order by part of UNION ... ORDER BY ... caused a crash in 
EXPLAIN EXTENDED because of a transformation attempt made during EXPLAIN EXTENDED
execution. Fixed by not doing the transformation when in EXPLAIN.

3. Fulltext functions caused crash when in the ORDER BY part of an un-parenthesized
UNION that gets "promoted" to be valid for the whole union, e.g. 
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY MATCHES (a) AGAINST ('abc' IN BOOLEAN MODE).
This is a case that demonstrates a more general problem of parts of the query being
moved to another level. When doing such transformation late in the optimization run
when most of the flags about the contents of the query are already aggregated it's possible 
to "split" the flags so that they correctly reflect the new queries after the transformation.
In specific the ST_SELECT_LEX::ftfunc_list is holding all the free text function for all the 
parts of the second SELECT in the UNION and we don't know what part of that is in the ORDER BY
that we're to move to the UNION level and what part is about the other parts of the second SELECT.
Fixed by throwing and error when such statements are about to be processed by adding a check 
for the presence of MATCH() inside the ORDER BY clause that's going to get promoted to UNION.
To workaround this new limitation one must parenthesize the UNION SELECTs and provide a real 
global ORDER BY for the UNION outside of the parenthesis.
2009-12-22 17:52:15 +02:00
Georgi Kodinov
b90ecd4bae merge 2009-12-24 11:00:04 +02:00
Satya B
51d54db7b7 merge to mysql-5.1-bugteam 2009-12-22 18:34:13 +05:30
Satya B
3cab11960a Removing rpl.rpl_trigger from experimental list as it is Fixed by BUG#46656 2009-12-22 18:33:39 +05:30
Sergey Glukhov
6fed2148c2 5.0-bugteam->5.1-bugteam merge 2009-12-22 14:38:33 +04:00
Sergey Glukhov
c3114506bb Bug#47371 reference by same column name
At the end of execution top level join execution
we cleanup this join with true argument.
It leads to underlying join cleanup(subquery) with true argument too
and to tmp_table_param->field array cleanup which is required later.
The problem is that Item_func_set_user_var does not set
result_filed which leads to unnecessary repeated excution of subquery
on final stage.
The fix is to set result_field for Item_func_set_user_var.
2009-12-22 13:52:23 +04:00
Ramil Kalimullin
ee403cc1a2 Fix for bug#49570: Assertion failed: !(order->used & map)
on re-execution of prepared statement

Problem: some (see eq_ref_table()) ORDER BY/GROUP BY optimization
is called before each PS execution. However, we don't properly 
initialize its stucture every time before the call.

Fix: properly initialize the sturture used.
2009-12-22 10:39:29 +04:00
Mattias Jonsson
e10752e011 merge 2009-12-22 00:06:36 +01:00
Serge Kozlov
27c0939846 Bug#8693, Bug#45521. 2009-12-21 14:40:08 +03:00
He Zhenxing
d332a18952 Bug#47638 The rpl_killed_ddl test fails on Windows
When the $diff_statement variable for diff_master_slave.inc was
put in multiple lines, the rear part of the statement would be 
missing when being executed on Windows systems.

Fixed the problem by always putting the value for $diff_statement
in one line.
2009-12-21 14:14:45 +08:00
Staale Smedseng
ff6c429612 Bug#43397 mysql headers redefine pthread_mutex_init
unnecessarily

Changing an instance of the define that was missed
in the original commit due to the fact that it was
misspelled.
2009-12-20 19:02:15 +01:00