Commit graph

59197 commits

Author SHA1 Message Date
Sven Sandberg
94946c6807 BUG#49222: Mark RAND() as unsafe
Problem: When RAND() is binlogged in statement mode, the seed is
binlogged too, so the replication slave generates the same
sequence of random numbers. This makes replication work in many
cases, but not in all cases: the order of rows is not guaranteed
for, e.g., UPDATE or INSERT...SELECT statements, so the row data
will be different if master and slave retrieve the rows in
different orders.
Fix: Mark RAND() as unsafe. It will generate a warning if
binlog_format=STATEMENT and switch to row-logging if
binlog_format=ROW.
2010-01-13 10:00:03 +01:00
Ramil Kalimullin
5622b586d9 Fix for bug#50227: Pre-auth buffer-overflow in mySQL through yaSSL
Problem: copying issuer's (or subject's) name tags into an internal
buffer from incoming stream we didn't check the buffer overflow. 
That may lead to memory overrun, crash etc.

Fix: ensure we don't overrun the buffer.

Note: there's no simple test case (exploit needed).
2010-01-13 09:20:45 +04:00
Gleb Shchepa
30212033ed Bug #50096: CONCAT_WS inside procedure returning wrong data
Selecting of the CONCAT_WS(...<PS parameter>...) result into
a user variable may return wrong data.

Item_func_concat_ws::val_str contains a number of memory
allocation-saving optimization tricks. After the fix
for bug 46815 the control flow has been changed to a
branch that is commented as "This is quite uncommon!":
one of places where we are trying to concatenate
strings inplace. However, that "uncommon" place
didn't care about PS parameters, that have another
trick in Item_sp_variable::val_str(): they use the
intermediate Item_sp_variable::str_value field,
where they may store a reference to an external
argument's buffer.

The Item_func_concat_ws::val_str function has been
modified to take into account val_str functions
(such as Item_sp_variable::val_str) that return a
pointer to an internal Item member variable that
may reference to a buffer provided.
2010-01-13 08:16:36 +04:00
Martin Hansson
e57ea46d5a Bug#48157: crash in Item_field::used_tables
MySQL handles the join syntax "JOIN ... USING( field1,
... )" and natural joins by building the same parse tree as
a corresponding join with an "ON t1.field1 = t2.field1 ..."
expression would produce. This parse tree was not cleaned up
properly in the following scenario. If a thread tries to
lock some tables and finds that the tables were dropped and
re-created while waiting for the lock, it cleans up column
references in the statement by means a per-statement free
list. But if the statement was part of a stored procedure,
column references on the stored procedure's free list weren't
cleaned up and thus contained pointers to freed objects.

Fixed by adding a call to clean up the current prepared
statement's free list.
2010-01-12 15:16:26 +01:00
Joerg Bruehe
b0dad6edf4 Upmerge the changes for RPM versioning/naming from 5.0 to 5.1.
This includes "MYSQL_U_SCORE_VERSION" in "configure.in".
2010-01-12 12:57:51 +01:00
Joerg Bruehe
789352e87b Implement the change of RPM versioning and file naming:
- "release" starts from 1
- "level" ("m2", "rc", ...) is included in the RPM version.
2010-01-12 12:41:18 +01:00
Joerg Bruehe
685166a5e1 Merge from main tree,
but don't take the "tree name" change.
2010-01-12 12:12:42 +01:00
Joerg Bruehe
684405a5d3 Implement the change of RPM versioning and file naming:
- "release" starts from 1
- "level" ("m2", "rc", ...) is included in the RPM version.
2010-01-11 19:23:36 +01:00
Gleb Shchepa
ff55967d42 manual merge 5.0-bugteam --> 5.1-bugteam (bug 49955) 2010-01-11 18:31:06 +04:00
Gleb Shchepa
94acd48041 Bug #49955: ld error message: undefined reference to `strmov_overlapp'
32bit builds with the --enable-assembler flag (enabled by default)
fail with an error message: undefined reference to `strmov_overlapp'.

Since the fix for bug 48866 we use a home-grown strmov function
instead of the ctpcpy function, but the source file for this
function was missed in the Makefile.am.

The strings/Makefile.am file has been modified to include strmov.c
file into ASSEMBLER_x86 and ASSEMBLER_sparc32 sections.
2010-01-11 18:21:22 +04:00
2ae528aaae Postfix
Recover the right contents of the index file at the end of the test case.
2010-01-08 23:32:40 +08:00
8c677779ff BUG #28421 Infinite loop on slave relay logs
Manually deleteing one or more entries from 'master-bin.index', will
cause master infinitely loop to send one binlog file. 

When starting a dump session, master opens index file and search the binlog file
which is being requested by the slave. The position of the binlog file in the
index file is recorded. it will be used to find the next binlog file when current
binlog file has dumped completely. As only the position is used, it may
not get the correct file if some entries has been removed manually from the index file.
the master will reopen the current binlog file which has been dump completely
and redump it if it can not get the next binlog file's name from index file.
It obviously is a logical error.


Even though it is allowed to manually change index file,
but it is not recommended. so after this patch, master
sends a fatal error to slave and close the dump session if a new binlog file
has been generated and master can not get it from the index file.
2010-01-08 13:42:23 +08:00
Luis Soares
4c4c7b0908 BUG#50018: binlog corruption when table has many columns
Some improvements on the test case as suggested during review.
2010-01-07 17:45:54 +00:00
Bjorn Munch
be128c547f backport some changes from WL 4378 2010-01-07 13:17:54 +01:00
Luis Soares
0597dc7c9c merge: 5.1-bugteam bug branch --> 5.1 bugteam latest. 2010-01-07 10:34:27 +00:00
Bjorn Munch
9ab9c73a87 Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Undid amendment allowing pending reap after switching connections
Moved check for pending reap earlier; failed if running with ps-protocol
2010-01-07 11:22:45 +01:00
Bjorn Munch
570ee4c5e8 Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Small amendment: ignore pending reap when switching connection, add test
2010-01-06 12:56:22 +01:00
Georgi Kodinov
870a8cde9c Addendum to Bug #49734 : fixed an unstable test case. 2010-01-06 12:24:51 +02:00
Bjorn Munch
fcb43b2956 merge 49345 2010-01-06 09:54:43 +01:00
Bjorn Munch
dc3a76b2da merge 49672 2010-01-06 09:52:55 +01:00
Bjorn Munch
385f3f87c9 Bug #49761 mysqltest.test does not have any tests for send/reap
Added them
NB the 6th case is adapted to Bug no. 49269, gives wrong output without it
2010-01-06 09:47:25 +01:00
Bjorn Munch
583f77011b Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Set a flag after send to trap the case
2010-01-06 09:45:28 +01:00
Bjorn Munch
2ec01d90d8 Bug #48863 mysql test: enable and disable case insensitive compare mode
Implemented --lowercase_result which lower cases next result
2010-01-06 09:42:21 +01:00
917024b2e9 Bug #49137 Replication failure on SBR/MBR + multi-table DROP TEMPORARY TABLE
Fixed valgrind failure on PB2.
2010-01-06 13:28:06 +08:00
fd931d7bf7 Bug #49137 Replication failure on SBR/MBR + multi-table DROP TEMPORARY TABLE
Fixed valgrind failure on PB2.
2010-01-06 13:12:40 +08:00
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
Bjorn Munch
1ae30d113d Bug #49345 re-introduce gprof to mysql-test-run.pl
Was available in v1
Porting to v2 required some rewriting
Updated after review comments
2010-01-05 21:35:50 +01:00
Bjorn Munch
eec8deed8b Bug #49166 mtr --combination is broken after restrictions of combination names
Combinations beginning with -- not allowed
Allow them...
2010-01-05 13:31:38 +01: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