Commit graph

63683 commits

Author SHA1 Message Date
Georgi Kodinov
f027f94b51 null weave merge mysql-5.0-security->mysql-5.1-security 2011-02-10 12:10:28 +02:00
Georgi Kodinov
f643db7b76 merge 5.1->5.1-security 2011-02-10 12:08:54 +02:00
Georgi Kodinov
e2b44930cc merge 5.0->5.0-security 2011-02-10 12:07:16 +02:00
Joerg Bruehe
944e845535 Merge bugfix 56581 into main. 2011-02-09 14:37:27 +01:00
Dmitry Shulga
784e74235a Follow up fix for bug#57450.
batch_readline_init() was modified - make check for 
type of file for input stream unless target platform
is WINDOWS since on this platform S_IFBLK is undefined.
2011-02-09 17:13:17 +06:00
John H. Embretsen
9a611223c3 Null merge from mysql-5.0 2011-02-09 11:13:23 +01:00
John H. Embretsen
bdb4df0f26 Backport to 5.0: Fix for Bug#52060 - test udf fails on Snow Leopard.
Reverse DNS lookup of "localhost" returns "broadcasthost" on Snow Leopard (Mac), and NULL on most others.
Simply ignore the output, as this is not an essential part of UDF testing.
2011-02-09 10:50:09 +01:00
Georgi Kodinov
21d53f5280 empty weave merge of 5.0-security->5.1-security 2011-02-09 10:52:37 +02:00
Georgi Kodinov
e458739471 weave merge mysql-5.1->mysql-5.1-security 2011-02-09 10:30:44 +02:00
Georgi Kodinov
3e897beab3 merge 5.0->5.0-security 2011-02-09 10:16:32 +02:00
Dmitry Shulga
107b46070d Follow up fix for bug#57450.
batch_readline_init() was modified - return an error
if the input source is a directory or a block device.

This follow-up is necessary because on some platforms,
such as Solaris, call to read() from directory may be
successful.
2011-02-09 12:46:12 +06:00
Vasil Dimov
de90b6dcb4 Merge mysql-5.1-innodb -> mysql-5.1 2011-02-08 19:26:42 +02:00
Georgi Kodinov
94097ecd56 weave merge of mysql-5.0 to mysql-5.1. 2011-02-08 17:02:04 +02:00
Jonathan Perkin
01f57bc98e Merge from mysql-5.0.92-release 2011-02-08 14:43:27 +01:00
karen.langford@oracle.com
c85029f83b Merge from mysql-5.1.55-release 2011-02-08 12:52:33 +01:00
John H. Embretsen
aa672f5401 Fix for Bug#59837 - mysqlhotcopy fails with wrong error (11) on specific platforms:
Test failed on a certain Linux platform in automated environment. It turns out that this platform has an old version of Perl modules DBI and DBD::mysql installed, as well as the OS itself being relatively old.
Allowing error code 11 to be returned from mysqlhotcopy on expected error seems harmless and will make the test pass also with older libraries.
2011-02-08 10:51:09 +01:00
Anitha Gopi
bfc1e4436f Removed the collections for mysql-5.1-bugteam. Removed 1st from weekly. This is part of default suites 2011-02-08 12:18:11 +05:30
Anitha Gopi
7c838e296c Removed the collections for mysql-5.1-bugteam. Removed 1st from weekly. This is part of default suites 2011-02-08 11:30:35 +05:30
Bjorn Munch
1e7fac2d54 merge 47141,59979 2011-02-08 00:02:45 +01:00
Vasil Dimov
b7cc4aa0e6 Backport the fix for Bug#59875 Valgrind warning in buf0buddy.c from 5.5
This warning also happens in 5.1 with a slightly different codepath.
2011-02-07 16:45:37 +02:00
Dmitry Lenev
03e27ac161 Merged fix for bug #36544 "DROP USER does not remove stored
function privileges" into 5.5 tree. Did after-merge fixes.
2011-02-07 15:06:22 +03:00
Bjorn Munch
3cde3f303f Bug #59979 Add mtr option to run debug server, but without turning on debug
Added --debug-server and use $opt_debug_server where appropriate
Let --debug imply --debug-server
When merging to 5.5, must adapt fix for 59148
Oops, set debug => debug-server too late, fixed
2011-02-07 12:42:21 +01:00
Dmitry Lenev
e960abc7cf Fix for bug#36544 "DROP USER does not remove stored function
privileges".

The first problem was that DROP USER didn't properly remove privileges 
on stored functions from in-memory structures. So the dropped user
could have called stored functions on which he had privileges before
being dropped while his connection was still around.
Even worse if a new user with the same name was created he would
inherit privileges on stored functions from the dropped user.
Similar thing happened with old user name and function privileges
during RENAME USER.

This problem stemmed from the fact that the handle_grant_data() function
which handled DROP/RENAME USER didn't take any measures to update
in-memory hash with information about function privileges after
updating them on disk.

This patch solves this problem by adding code doing just that.

The second problem was that RENAME USER didn't properly update in-memory
structures describing table-level privileges and privileges on stored 
procedures. As result such privileges could have been lost after a rename
(i.e. not associated with the new name of user) and inherited by a new
user with the same name as the old name of the original user.

This problem was caused by code handling RENAME USER in
handle_grant_struct() which [sic!]:
a) tried to update wrong (tables) hash when updating stored procedure
   privileges for new user name.
b) passed wrong arguments to function performing the hash update and
   didn't take into account the way in which such update could have
   changed the order of the hash elements.

This patch solves this problem by ensuring that a) the correct hash
is updated, b) correct arguments are used for the hash_update()
function and c) we take into account possible changes in the order
of hash elements.
2011-02-07 14:01:19 +03:00
Ole John Aske
3e533efa81 Fix for bug#59308: Incorrect result for SELECT DISTINCT <col>... ORDER BY <col> DESC.
Also fix bug#59110: Memory leak of QUICK_SELECT_I allocated memory.
Includes Jørgen Lølands review comments.
      
Root cause of these bugs are that test_if_skip_sort_order() decided to
revert the 'skip_sort_order' descision (and use filesort) after the
query plan has been updated to reflect a 'skip' of the sort order.
      
This might happen in 'check_reverse_order:' if we have a 
select->quick which could not be made descending by appending 
a QUICK_SELECT_DESC. ().
      
The original 'save_quick' was then restored after the QEP has been modified,
which caused:
      
  - An incorrect 'precomputed_group_by= TRUE' may have been set, 
    and not reverted, as part of the already modifified QEP (Bug#59308)
  - A 'select->quick' might have been created which we fail to delete (bug#59110).
      
This fix is a refactorication of test_if_skip_sort_order() where all logic
related to modification of QEP (controlled by argument 'bool no_changes'), is
moved to the end of test_if_skip_sort_order(), and done after *all* 'test_if_skip'
checks has been performed - including the 'check_reverse_order:' checks.
      
The refactorication above contains now intentional changes to the logic which 
has been moved to the end of the function.
      
Furthermore, a smaller part of the fix address the handling of the 
select->quick objects which may already exists when we call 
'test_if_skip_sort_order()' (save_quick) -and
new select->quick's created during test_if_skip_sort_order():
      
  - Before new select->quick may be created by calling ::test_quick_select(), we
    set 'select->quick= 0' to avoid that ::test_quick_select() prematurely
    delete the save_quick's. (After this call we may have both a 'save_quick' 
    and 'select->quick')
      
  - All returns from ::test_if_skip_sort_order() where we may have both a
    'save_quick' and a 'select->quick' has been changed to goto's to the
    exit points 'skiped_sort_order:' or 'need_filesort:' where we
    decide which of the QUICK_SELECT's to keep, and delete the other.
2011-02-07 10:36:21 +01:00
Vasil Dimov
098a2ee85d Use fun:* instead of obj:*/libz.so* because when the bundled zlib is
used (--with-zlib-dir=bundled) then there is no libz.so involved.
2011-02-07 11:13:54 +02:00
Vinay Fisrekar
4a20a60348 Bug#59955 - engines/funcs/ps_string_not_null test needs better cleanup
Correcting clean up command at the start of test.
2011-02-07 11:10:35 +05:30
Dmitry Shulga
2f0ba4c3f8 Fixed bug#57450 - mysql client enter in an infinite loop
if the standard input is a directory.

The problem is that mysql monitor try to read from stdin without
checking input source type.

The solution is to stop reading data from standard input if a call
to read(2) failed.

A new test case was added into mysql.test.
2011-02-05 11:02:00 +06:00
Luis Soares
2dfb4c5ed3 BUG#59147: Automerged bzr bundle form bug report into mysql-5.1 . 2011-02-04 14:57:51 +00:00
Bjorn Munch
88bdb86884 merge from 5.1 main 2011-02-04 12:37:01 +01:00
Bjorn Munch
3287379eb1 Bug #47141 "mysqltest" breaks because it tries to act on a debug option which is disabled
Replace --debug with --loose-debug to prevent failure exit
Update: added workaround for 50627, skip all debugging of mysqlbinlog
2011-02-04 12:33:45 +01:00
Vasil Dimov
96ca537ca4 Fix Bug#59874 Valgrind warning in InnoDB compression code
Add suppressions for a bogus valgrind warnings.
2011-02-04 12:46:47 +02:00
Dmitry Shulga
6c777a6220 Fixed bug#58026 - massive recursion and crash in regular expression
handling.

The problem was that parsing of nested regular expression involved
recursive calls. Such recursion didn't take into account the amount of
available stack space, which ended up leading to stack overflow crashes.
2011-02-04 10:47:46 +06:00
Joerg Bruehe
796672c44b Fix Bug #56581 RPM scripts use hardcoded datadir location
When fixing the 27072 bug, the shell snippets running before/after
a RPM upgrade got expanded to look at files in the data directory
and at the PID file.
In this expansion, the standard locations were used.

There are users who configure their installations to use non-standard
locations for the data directory, the PID file, and other objects.
For these users, the fix of 27072 did not work.
As a result, the fact that a server was running at upgrade start was
not noticed, and the new server was not started after the upgrade.

With this patch, the shell snippets now try to get these locations
from "my_print_defaults" before falling back to the defaults.
Now, the fact that the old server is running is again noticed (even
with non-standard locations), and the new server is started.

Also, the upgrade log is written to the correct data directory.
2011-02-03 18:16:22 +01:00
Luis Soares
64b0591d76 BUG#59147: rpl_circular_for_4_hosts fails sporadically
There is one part of the test case that needs to break
and re-establish the circular topology. For this the test
stops the slave threads on a couple of servers and restarts
them with START SLAVE. However, no check is done on the
status of the IO or SQL threads before proceeding with
the subsequent commands.
      
Because rpl_only_running_threads is set to 1 this can lead
to silently not syncing all slave threads as expected, 
ultimately resulting in unexpected results (and consequently
on a failing test run).
      
We fix this by replacing the START SLAVE instructions with
calls to --source include/start_slave.inc, which will wait
for the slave threads to be running (show 'Yes' in 
Slave_IO|SQL_Running fields of SHOW SLAVE STATUS) before 
proceeding. Additionally, we change rpl_sync.inc to make the
IO thread report that it is running when its running status
is any other than 'No'.
2011-02-03 16:09:33 +00:00
Georgi Kodinov
63a40fe65c merge 2011-02-02 20:13:11 +02:00
Georgi Kodinov
6954b67255 Bug #52315 part 2 addendum : reset back the timestamp 2011-02-02 20:10:57 +02:00
Georgi Kodinov
ac3243c8c8 merge to 5.1. 2011-02-02 19:05:28 +02:00
Georgi Kodinov
59f68983ff Fixes for Bug #55755 and Bug #52315 part 2
Bug #55755 : Date STD variable signness breaks server on FreeBSD and OpenBSD

* Added a check to configure on the size of time_t
* Created a macro to check for a valid time_t that is safe to use with datetime 
  functions and store in TIMESTAMP columns.
* Used the macro consistently instead of the ad-hoc checks introduced by 52315
* Fixed compliation warnings on platforms where the size of time_t is smaller than
  the size of a long (e.g. OpenBSD 4.8 64 amd64).

Bug #52315: utc_date() crashes when system time > year 2037

* Added a correct check for the timestamp range instead of just variable size check to
SET TIMESTAMP.
* Added overflow checking before converting to time_t. 
* Using a correct localized error message in this case instead of the generic error.
* Added a test suite.
* fixed the checks so that they check for unsigned time_t as well. Used the checks 
  consistently across the source code.
* fixed the original test case to expect the new error code.
2011-02-02 18:51:35 +02:00
Marko Mäkelä
e67169ee06 Bug #55284 diagnostics: Introduce UNIV_BLOB_LIGHT_DEBUG, enabled by UNIV_DEBUG
btr_rec_get_field_ref_offs(), btr_rec_get_field_ref(): New functions.
Get the pointer to an externally stored field.

btr_cur_set_ownership_of_extern_field(): Assert that the BLOB has not
already been disowned.

btr_store_big_rec_extern_fields(): Rename to
btr_store_big_rec_extern_fields_func() and add the debug parameter
update_in_place. All pointers to externally stored columns in the
record must either be zero or they must be pointers to inherited
columns, owned by this record or an earlier record version. For any
BLOB that is stored, the BLOB pointer must previously have been
zero. When the function completes, all BLOB pointers must be nonzero
and owned by the record.

rb://549 approved by Jimmy Yang
2011-02-02 15:51:08 +02:00
Dmitry Lenev
3473329d3b Fix for bug #58650 "Failing assertion: primary_key_no == -1 ||
primary_key_no == 0".

Attempt to create InnoDB table with non-nullable column of
geometry type having an unique key with length 12 on it and
with some other candidate key led to server crash due to
assertion failure in both non-debug and debug builds.

The problem was that such a non-candidate key could have
been sorted as the first key in table/.FRM, before any legit
candidate keys. This resulted in assertion failure in InnoDB
engine which assumes that primary key should either be the
first key in table/.FRM or should not exist at all.

The reason behind such an incorrect sorting was an wrong
value of Create_field::key_length member for geometry field
(which was set to its pack_length == 12) which confused code
in mysql_prepare_create_table(), so it would skip marking
such key as a key with partial segments.

This patch fixes the problem by ensuring that this member
gets the same value of Create_field::key_length member as 
for other blob fields (from which geometry field class is
inherited), and as result unique keys on geometry fields
are correctly marked as having partial segments.
2011-02-02 16:17:48 +03:00
Marko Mäkelä
5dce2df4c2 Non-functional changes (cleanup) made while narrowing down Bug #55284:
row_purge(): Change the return type to void. (The return value always
was DB_SUCCESS.) Remove some local variables.

row_undo_mod_remove_clust_low(): Remove some local variables.

rb://547 approved by Jimmy Yang
2011-02-02 14:12:49 +02:00
Marko Mäkelä
03d42acca2 Bug #55284 diagnostics: When UNIV_DEBUG, do not tolerate garbage in
Antelope files in btr_check_blob_fil_page_type(). Unfortunately, we
must keep the check in production builds, because InnoDB wrote
uninitialized garbage to FIL_PAGE_TYPE until fairly recently (5.1.x).

rb://546 approved by Jimmy Yang
2011-02-02 14:10:12 +02:00
Marko Mäkelä
0dfcfd112a Bug #55284 diagnostics: Enable UNIV_DEBUG_FILE_ACCESSES by UNIV_DEBUG
It was the enabling of UNIV_DEBUG_FILE_ACCESSES that caught Bug #55284
in the first place. This is a very light piece of of debug code, and
there really is no reason why it is not enabled in all debug builds.

rb://551 approved by Jimmy Yang
2011-02-02 14:05:12 +02:00
Ole John Aske
c8de3bba8e Fix for bug#57030: ('BETWEEN' evaluation is incorrect')
Root cause for this bug is that the optimizer try to detect&
optimize the special case:
      
'<field>  BETWEEN c1 AND c1' and handle this as the condition '<field>  = c1'
            
This was implemented inside add_key_field(.. *field, *value[]...)
which assumed field to refer key Field, and value[] to refer a [low...high]
constant pair. value[0] and value[1] was then compared for equality.
            
In a 'normal' BETWEEN condition of the form '<field>  BETWEEN val1 and val2' the
BETWEEN operation is represented with an argementlist containing the
values [<field>, val1, val2] - add_key_field() is then called with
parameters field=<field>, *value=val1.
            
However, if the BETWEEN predicate specified:
            
 1)  '<const1>  BETWEEN<const2>  AND<field>
            
the 'field' and 'value' arguments to add_key_field() had to be swapped.
This was implemented by trying to cheat add_key_field() to handle it like:
            
 2) '<const1>  GE<const2>  AND<const1>  LE<field>'
            
As we didn't really replace the BETWEEN operation with 'ge' and 'le',
add_key_field() still handled it as a 'BETWEEN' and compared the (swapped)
arguments<const1>  and<const2>  for equality. If they was equal, the
condition 1) was incorrectly 'optimized' to:
            
 3) '<field>  EQ <const1>'
            
This fix moves this optimization of '<field>  BETWEEN c1 AND c1' into
add_key_fields() which then calls add_key_equal_fields() to collect 
key equality / comparison for the key fields in the BETWEEN condition.
2011-02-01 13:20:16 +01:00
Alfranio Correia
b6b7be691c Post-fix for BUG#59338. 2011-01-31 14:31:33 +00:00
Alfranio Correia
cb52e82ea7 merge mysql-5.1 (local) --> mysql-5.1 2011-01-31 10:11:01 +00:00
Alfranio Correia
631f5d0ef3 merge mysql-5.1 (local) --> mysql-5.1 2011-01-31 10:08:58 +00:00
Marko Mäkelä
fbb1eeebf4 Bug#59230 assert 0 row_upd_changes_ord_field_binary() in post-crash
trx rollback or purge

This patch does not relax the failing debug assertion during purge.
That will be revisited once we have managed to repeat the assertion failure.

row_upd_changes_ord_field_binary_func(): Renamed from
row_upd_changes_ord_field_binary(). Add the parameter que_thr_t* in
UNIV_DEBUG builds. When the off-page column cannot be retrieved,
assert that the current transaction is a recovered one and that it is
the one that is currently being rolled back.

row_upd_changes_ord_field_binary(): A wrapper macro for
row_upd_changes_ord_field_binary_func() that discards the que_thr_t*
parameter unless UNIV_DEBUG is defined.

row_purge_upd_exist_or_extern_func(): Renamed from
row_purge_upd_exist_or_extern(). Add the parameter que_thr_t* in
UNIV_DEBUG builds.

row_purge_upd_exist_or_extern(): A wrapper macro for
row_purge_upd_exist_or_extern_func() that discards the que_thr_t*
parameter unless UNIV_DEBUG is defined.

Make trx_roll_crash_recv_trx const. If there were a 'do not
dereference' attribute, it would be appropriate as well.

rb://588 approved by Jimmy Yang
2011-01-31 09:56:51 +02:00
Sandeep Doddaballapur
2fc1c66b1b automerge 2011-01-31 11:21:30 +05:30
Vasil Dimov
1a61a8b41f Merge mysql-5.1 -> mysql-5.1-innodb 2011-01-30 19:15:52 +02:00