Commit graph

40045 commits

Author SHA1 Message Date
Alexey Kopytov
4ecfe5772c Disabled embedded server for the test case for bug #45236. 2009-06-17 20:10:48 +04:00
Staale Smedseng
30fccdaaae Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.
                  
This bug will be resolved in more than one patch to limit the
size of changesets. This is the second patch, fixing more
of the warnings.
2009-06-17 15:54:01 +02:00
Alexey Kopytov
9c1e2bbcf6 Automerge. 2009-06-17 16:36:45 +04:00
Georgi Kodinov
26f88fa1d7 fixed version 2009-06-16 10:27:53 +02:00
Georgi Kodinov
9a49934a72 automerge 2009-06-15 17:58:23 +02:00
Georgi Kodinov
e008ba642a merged 5.0-main to 5.0-bugteam 2009-06-15 17:29:26 +02:00
Bernt M. Johnsen
f014fa022b Bug#32357 Prepared for push on 5.0-bugteam branch 2009-06-15 17:14:00 +02:00
Georgi Kodinov
b1560b9f2f Bug #44810: index merge and order by with low sort_buffer_size
crashes server!

The problem affects the scenario when index merge is followed by a filesort
and the sort buffer is not big enough for all the sort keys.
In this case the filesort function will read the data to the end through the 
index merge quick access method (and thus closing the cursor etc), 
but will leave the pointer to the quick select method in place.
It will then create a temporary file to hold the results of the filesort and
will add it as a sort output file (in sort.io_cache).
Note that filesort will copy the original 'sort' structure in an automatic
variable and restore it after it's done.
As a result at exiting filesort() we have a sort.io_cache filled in and 
nothing else (as a result of close of the cursors at end of reading data 
through index merge).
Now create_sort_index() will note that there is a select and will clean it up
(as it's been used already by filesort() reading the data in). While doing that
a special case in the index merge destructor will clean up the sort.io_cache,
assuming it's an output of the index merge method and is not needed anymore.
As a result the code that tries to read the data back from the filesort output 
will get no data in both memory and disk and will crash.
      
Fixed similarly to how filesort() does it : by copying the sort.io_cache structure
to a local variable, removing the pointer to the io_cache (so that it's not freed 
by QUICK_INDEX_MERGE_SELECT::~QUICK_INDEX_MERGE_SELECT) and restoring the original 
structure (together with the valid pointer) after the cleanup is done.
This is a safe thing to do because all the structures are already cleaned up by
hitting the end of the index merge's read method (QUICK_INDEX_MERGE_SELECT::get_next()) 
and the cleanup code being written in a way that tolerates repeating cleanups.
2009-06-15 16:38:15 +03:00
Georgi Kodinov
67384e7f36 fixed the build-tags command 2009-06-12 17:06:59 +03:00
Georgi Kodinov
1f2b5b3037 Bug #45386: Wrong query result with MIN function in field list,
WHERE and GROUP BY clause

Loose index scan may use range conditions on the argument of 
the MIN/MAX aggregate functions to find the beginning/end of 
the interval that satisfies the range conditions in a single go.
These range conditions may have open or closed minimum/maximum 
values. When the comparison returns 0 (equal) the code should 
check the type of the min/max values of the current interval 
and accept or reject the row based on whether the limit is 
open or not.
There was a wrong composite condition on checking this and it was
not working in all cases.
Fixed by simplifying the conditions and reversing the logic.
2009-06-12 15:38:55 +03:00
Joerg Bruehe
40385611a4 Merge main 5.0 -> 5.0-build 2009-06-11 16:32:47 +02:00
Joerg.Bruehe@Sun.COM
a84c805e63 Merge back mysql-5.0.74sp1-release, no changes in current files 2009-06-11 13:49:04 +02:00
Alfranio Correia
93598a3a45 BUG#34687 Error in bin-log after shutdown restart binlog was not closed properly
While reading a binary log that is being used by a master or was not properly
closed, most likely due to a crash, the following warning message is being
printed out: "Warning: this binlog was not closed properly. Most probably mysqld
crashed writing it.". This was scaring our users as the message was not taking
into account the possibility of the file is being just used by the master.

To avoid unnecessarily scaring our users, we replace the original message by the
following one: Warning: "this binlog is either is use or was not closed properly.".
2009-06-11 02:08:40 +01:00
Davi Arnaut
425790610d Bug#41190: shared memory connections do not work in Vista, if server started from cmdline
Backport to MySQL 5.0/1 fix by Vladislav Vaintroub:

In Vista and later and also in when using terminal services, when
server is started from  command line, client cannot connect to it
via shared memory protocol.

This is a regression introduced when  Bug#24731 was fixed.  The
reason is that client is trying to attach to shared memory using
global kernel object  namespace (all kernel objects are prefixed
with Global\). However, server started from the command line in
Vista and later will create shared memory and events using current
session namespace. Thus, client is unable to find the server and
connection fails.

The fix for the client is to first try to find server using "local"
names  (omitting Global\  prefix) and only if server is not found,
trying global namespace.
2009-06-10 10:59:59 -03:00
Alexey Kopytov
08410f34dd Bug #45236: large blob inserts from mysqldump fail, possible
memory issue ? 
 
The mysql command line client could misinterpret some character 
sequences as commands under some circumstances. 
 
The upper limit for internal readline buffer was raised to 1 GB 
(the same as for server's max_allowed_packet) so that any input 
line is processed by add_line() as a whole rather than in 
chunks.
2009-06-10 11:24:47 +04:00
Staale Smedseng
dae006c17f Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.
      
This bug will be resolved in more than one patch to limit the
size of changesets. This is the first patch, fixing a number 
of the warnings, predominantly "suggest using parentheses 
around && in ||", and empty for and while bodies.
2009-06-09 18:11:21 +02:00
Tatiana A. Nurnberg
e43d8e584d auto-merge 2009-06-06 18:06:42 +02:00
Davi Arnaut
82d2797d0a Don't mix declarations and code (not widely portable). 2009-06-06 12:26:39 -03:00
Tatiana A. Nurnberg
57c253bcb1 auto-merge 2009-06-05 23:29:37 +02:00
Georgi Kodinov
b311cb83f2 automerge 2009-06-05 19:27:48 +03:00
Georgi Kodinov
c6fdeff0c7 Addendum to Bug #45286 : implement reviewer's remarks. 2009-06-05 19:23:44 +03:00
Georgi Kodinov
5db8276fe3 Bug #45286: compilation warnings on mysql-5.0-bugteam on MacOSX
Implemented a way to circumvent the always true comparison by
having nested macros (as suggested on review).
2009-06-05 18:14:56 +03:00
Georgi Kodinov
7787dee76a Bug #43532 : backport of the 5.1 code to 5.0 mysqltest 2009-06-05 17:59:23 +03:00
Georgi Kodinov
5ec61b304c Bug #45286: compilation warnings on mysql-5.0-bugteam on MacOSX
Fixed the 5.0-bugteam MacOSX warnings.
2009-06-05 15:05:26 +03:00
Tatiana A. Nurnberg
b89d2fce58 Bug#32149: Long semaphore wait for adaptive hash latch
Holding on to the temporary inno hash index latch is an optimization in
many cases, but a pessimization in some others.

Release temporary latches for those corner cases we (or rather, or customers,
thanks!) have identified, that is, when we are about to do something that
might take a really long time, like REPAIR or filesort.
2009-06-05 00:23:08 +02:00
Bernt M. Johnsen
f0ae92f471 Bug#15866 Split of main.sp and main.sp-fib. Merged from 5.0 gca 2009-06-04 16:13:16 +02:00
Bernt M. Johnsen
5068840bd8 Bug#15866 main.sp-fib split from main.sp 2009-06-04 13:38:53 +02:00
Georgi Kodinov
932c7a316c Bug #36995: valgrind error in remove_const during subquery executions
When copying the Item class one must copy its attributes as well.
2009-06-04 12:52:40 +03:00
Sergey Glukhov
1a1ffe7312 Bug#44798 MySQL engine crashes when creating stored procedures with execute_priv=N
The crash happens because of uninitialized
lex->ssl_cipher, lex->x509_subject, lex->x509_issuer variables.
The fix is to add initialization of these variables for
stored procedures&functions.
2009-06-04 10:28:45 +05:00
Sergey Glukhov
83ec6e0592 Bug#45152 crash with round() function on longtext column in a derived table
The crash happens due to wrong max_length value which is set on
Item_func_round::fix_length_and_dec() stage. The value is set to
args[0]->max_length which is too big in case of LONGTEXT(LONGBLOB) fields.
The fix is to set max_length using float_length() function.
2009-06-02 11:38:13 +05:00
Alexey Kopytov
8787989473 Automerge. 2009-06-01 16:42:24 +04:00
He Zhenxing
83bc6db361 post fix of test result 2009-05-31 20:10:59 +08:00
He Zhenxing
d97e568831 Auto merge 2009-05-31 17:16:12 +08:00
He Zhenxing
c0fde0eda7 BUG#43263 BEGIN skipped in some replicate-do-db cases
BEGIN/COMMIT/ROLLBACK was subject to replication db rules, and
caused the boundary of a transaction not recognized correctly 
when these queries were ignored by the rules.

Fixed the problem by skipping replication db rules for these
statements.
2009-05-31 11:26:58 +08:00
Davi Arnaut
0c3439c507 MySQL 5.0 backport of Chad Miller's patch for Bug#34309:
Bug#34309: '_PC' macro redefinition

For reasons that are now a mystery, we had defined a CPP symbol to
help ancient compilers work better (in some way that's lost to history).
This interferes with at least one modern compiler.

Now, don't define the _PC symbol.  Those other underscore-leading
symbols are suspect also, but at least the names aren't inscrutable.
Let's leave them for now.
2009-05-30 12:38:36 -03:00
hery.ramilison@sun.com
8aae58fb73 Raise version number after cloning 5.0.83 2009-05-29 19:45:32 +02:00
Joerg Bruehe
a07ac913b8 Merge main 5.0 into 5.0-build 2009-05-28 21:58:48 +02:00
Sergey Glukhov
14eb98dd8a test case fix 2009-05-28 16:19:49 +05:00
Sergey Glukhov
394f6ba478 Bug#37268 'binary' character set makes CLI-internal commands case sensitive
The fix is to use case insensitive collation
for mysql client command search.
2009-05-28 13:34:30 +05:00
Georgi Kodinov
ab516c5cab changed the version 2009-05-28 10:35:29 +03:00
Georgi Kodinov
73cf0d815c automerge 2009-05-27 17:09:09 +03:00
Sergey Glukhov
cb07978da9 Bug#41212 crash after race condition between merge table and table_cache evictions
On 64-bit Windows: querying MERGE table with keys may cause
server crash.The problem is generic and may affect any statement
accessing MERGE table cardinality values.
When MERGE engine was copying cardinality statistics, it was
using incorrect size of element in cardinality statistics array
(sizeof(ptr)==8 instead of sizeof(ulong)==4), causing access
of memory beyond of the allocated bounds.
2009-05-27 15:34:21 +05:00
Alexey Kopytov
2df531fdc4 Bug #44767: invalid memory reads in password() and
old_password() functions   
The PASSWORD() and OLD_PASSWORD() functions could lead to   
memory reads outside of an internal buffer when used with BLOB   
arguments.   
  
String::c_ptr() assumes there is at least one extra byte  
in the internally allocated buffer when adding the trailing  
'\0'.  This, however, may not be the case when a String object  
was initialized with externally allocated buffer.  
  
The bug was fixed by adding an additional "length" argument to  
make_scrambled_password_323() and make_scrambled_password() in  
order to avoid String::c_ptr() calls for  
PASSWORD()/OLD_PASSWORD().  
  
However, since the make_scrambled_password[_323] functions are  
a part of the client library ABI, the functions with the new  
interfaces were implemented with the 'my_' prefix in their  
names, with the old functions changed to be wrappers around  
the new ones to maintain interface compatibility.
2009-05-27 14:20:57 +04:00
Joerg Bruehe
bb2a2a122d Merge main 5.0 -> 5.0-build
This is the integration of the "community" source extensions
into build calls for Windows and for RPMs.
2009-05-27 09:49:26 +02:00
timothy.smith@sun.com
a87c98b503 Merge from mysql-5.0.82-release 2009-05-27 00:44:58 +02:00
Luis Soares
2b4fcc1dbf BUG#41725: slave crashes when inserting into temporary table after
stop/start slave
      
When stopping and restarting the slave while it is replicating
temporary tables, the server would crash or raise an assertion
failure. This was due to the fact that although temporary tables are
saved between slave threads restart, the reference to the thread in
use (table->in_use) was not being properly updated when the restart
happened (it would still reference the old/invalid thread instead of
the new one).
      
This patch addresses this issue by resetting the reference to the new
slave thread on slave thread restart.
2009-05-23 00:15:21 +01:00
Patrick Crews
321189c72c merge 2009-05-22 11:38:52 -04:00
Patrick Crews
6c31d59bf4 Bug#40465 - mysqldump.test does no checking of dump or restore
Created new .test file - mysqldump_restore that does test restore from mysqldump
output for a limited number of basic cases.
Create new .inc file - mysqldump.inc - renames original table and uses mysqldump
output to recreate the table, then uses diff_tables.inc to compare the two tables.
Backported include/diff_tables.inc to facilitate this testing.
New patch incorporating review feedback prior to push.

mysqldump.test - removed redundant call to include/have_log_bin.inc (was used twice in the test!)
2009-05-22 10:38:17 -04:00
Patrick Crews
2bb44aef97 Bug#40465: mysqldump.test does no checking of dump or restore.
Created new .test file - mysqldump_restore that does this for a limited number
of basic cases.
Created new .inc file - mysqldump.inc - renames original table and uses mysqldump
output to recreate the table, then uses diff_tables.inc to compare the two tables.
Backported include/diff_tables.inc to facilitate this testing.
2009-05-21 16:03:53 -04:00
Alexey Kopytov
17dba81fcb Automerge. 2009-05-21 21:50:58 +04:00