Commit graph

63957 commits

Author SHA1 Message Date
Georgi Kodinov
0e64080177 Fixed a wrong error code in gis.test 2011-03-09 17:21:22 +02:00
Georgi Kodinov
3d7d43665b merge 5.0-security->5.1-security 2011-03-09 16:51:12 +02:00
Georgi Kodinov
5890155e48 merge 5.1->5.1-security 2011-03-09 16:50:06 +02:00
Georgi Kodinov
a29eea3fb1 merge 5.0->5.0-security 2011-03-09 16:46:31 +02:00
Georgi Kodinov
dafbbad7a8 merge mysql-5.0->mysql-5.1 2011-03-09 14:59:34 +02:00
Georgi Kodinov
e1f412bec7 merge mysql-5.0-secrutiy-fixed -> mysql-5.0 2011-03-09 14:48:23 +02:00
Bjorn Munch
0c98f15a08 merge from 5.1 main 2011-03-08 18:52:56 +01:00
joerg.bruehe@oracle.com
2ab3b055e8 Merge from mysql-5.1.56-release 2011-03-03 21:11:47 +01:00
Alexander Barkov
c82f9661f6 Bug 11766519 - 59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED.
Part 2. Function QUOTE() was not multi-byte safe.

  @ mysql-test/r/ctype_ucs.result
  @ mysql-test/t/ctype_ucs.test
  Adding tests

  @ sql/item_strfunc.cc
  Fixing Item_func_quote::val_str to be multi-byte safe.

  @ sql/item_strfunc.h
  Multiple size needed for quote characters to mbmaxlen
2011-03-03 18:39:26 +03:00
Alexander Barkov
5956241859 BUG#11766519 (bug#59648): MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED
Problem: wrong character set pointer was passed to my_strtoll10_mb2,
which led to DBUG_ASSERT failure in some cases.

  @ mysql-test/r/func_encrypt_ucs2.result
  @ mysql-test/t/func_encrypt_ucs2.test
  @ mysql-test/r/ctype_ucs.result
  @ mysql-test/t/ctype_ucs.test
  Adding tests

  @ sql/item_func.cc
  "cs" initialization was wrong (res does not necessarily point to &str_value)

  @ sql/item_strfunc.cc
  Item_func_dec_encrypt::val_str() and Item_func_des_descrypt::val_str()
  did not set character set for tmp_value (the returned value),
  so the old value, which was previously copied from args[1]->val_str(),
  was incorrectly returned with tmp_value.
2011-03-03 15:04:04 +03:00
Sergey Vojtovich
929d13ca49 BUG#11764339 - valgrind errors, random data when returning
ordered data from archive tables

Archive was using wrong memory address to check if field
is NULL (after filesort, when reading record again).
2011-03-03 11:43:07 +03:00
Alexander Barkov
0c396e8fda An after-fix for
Bug#11765108 - Bug#58036: CLIENT UTF32, UTF16, UCS2 SHOULD BE DISALLOWED, THEY CRASH SERVER 

Fixing wrong usage of DBUG_ASSERT.
In non-debug version thd_init_client_charset
was not executed at all.
2011-03-03 11:25:37 +03:00
Vasil Dimov
5b029c7aeb Merge mysql-5.1 -> mysql-5.1-innodb 2011-03-02 10:59:43 +02:00
Vinay Fisrekar
c9e9dede76 Bug#11766165 - 59211: SELECT RETURNS DIFFERENT VALUE FOR MIN(YEAR) FUNCTION
Result File Correction For Bug Fix
2011-03-01 21:26:24 +05:30
Alexander Barkov
bb7f40a185 Bug#11766725 (Bug#59901) EXTRACTVALUE STILL BROKEN AFTER FIX FOR BUG #44332
Problem: a byte behind the end of input string was read
in case of a broken XML not having a quote or doublequote
character closing a string value.

Fix: changing condition not to read behind the end of input string

  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  Adding tests

  @ strings/xml.c
  When checking if the closing quote/doublequote was found,
  using p->cur[0] us unsafe, as p->cur can point to the byte after the value.
  Comparing p->cur to p->beg instead.
2011-03-01 15:30:18 +03:00
Bjorn Munch
3fceb5b699 Attempt at solving missing end of mtr output on Windows 2011-02-28 16:10:35 +01:00
Marko Mäkelä
8da1dfa9cb Bug #58549 Race condition in buf_LRU_drop_page_hash_for_tablespace()
and compressed tables

buf_LRU_drop_page_hash_for_tablespace(): after releasing and
reacquiring the buffer pool mutex, do not dereference any block
descriptor pointer that is not known to be a pointer to an
uncompressed page frame (type buf_block_t; state ==
BUF_BLOCK_FILE_PAGE). Also, defer the acquisition of the block_mutex
until it is needed.

buf_page_get_gen(): Add mode == BUF_GET_IF_IN_POOL_PEEK for
buffer-fixing a block without making it young in the LRU list.

buf_page_get_gen(), buf_page_init(), buf_LRU_block_remove_hashed_page():
Set bpage->state = BUF_BLOCK_ZIP_FREE before buf_buddy_free(bpage),
so that similar race conditions might be detected a little easier.

btr_search_drop_page_hash_when_freed(): Use BUF_GET_IF_IN_POOL_PEEK
when dropping the hash indexes.

rb://528 approved by Jimmy Yang
2011-02-28 13:51:18 +02:00
Vasil Dimov
05c4a3518e Fix BUG#11798085 - INCORRECT INTEGER TYPES USED IN CALCULATION RESULT
IN OVERFLOW

Do not assign the result of the difference to a signed variable and
checking whether it is negative afterwards because this limits the max diff
to 2G on 32 bit systems. E.g. "signed = 3.5G - 1G" would be negative and the
code would assume that 3.5G < 1G. Instead compare the two variables directly
and assign to unsigned only if we know that the result of the subtraction
will be positive.

Discussed with:	Jimmy and Sunny (via IRC)
2011-02-25 11:50:18 +02:00
Bjorn Munch
355f7ed789 merge from 5.1 main 2011-02-24 15:07:51 +01:00
Magne Mahre
a6ea6dc217 Bug#11767480 - SPATIAL INDEXES ON NON-SPATIAL COLUMNS CAUSE CRASHES.
This is a backport of the patch for MySQL Bug#50574.
      
Adding a SPATIAL INDEX on non-geometrical columns caused a
segmentation fault when the table was subsequently 
inserted into.
            
A test was added in mysql_prepare_create_table to explicitly
check whether non-geometrical columns are used in a
spatial index, and throw an error if so.
      
For MySQL 5.5 and later, a new and more meaningful error 
message was introduced.  For 5.1, we (re-)use an existing
error code.
2011-02-24 12:23:38 +01:00
Bjorn Munch
1f9d8cd862 Bug #11762407 54999: MTR GLOBAL SUPPRESSION HIDES SQL THREAD EXECUTION UNEXPECTED ERRORS
Removed the global suppression, added lots of local ones to affected tests
Re-commit, now kept "Slave SQL" at start of patterns.
2011-02-23 10:31:37 +01:00
hery.ramilison@oracle.com
40b27a952b Null-merge from mysql-5.1.52sp1-release 2011-02-22 22:03:32 +01:00
Nirbhay Choubey
dd4723d47d Postfix for tests failing due to fix for bug#11766310. 2011-02-22 19:28:50 +05:30
Nirbhay Choubey
a8e6f7c67b Bug#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH
("-") IN DATABASE NAMES IN ALTER DATABASE.

mysqldump did not quote database name in 'ALTER DATABASE'
statements in its output. This can further cause a failure
while loading if database name contains a hyphen '-'.

This happened as, while printing the 'ALTER DATABASE'
statements, the database name was not quoted.

Fixed by quoting the database name.
2011-02-21 12:37:24 +05:30
Alexander Barkov
cd3a8131c6 A post-fix for b58036. 2011-02-18 17:17:37 +03:00
Alexander Barkov
8a96012922 Bug#11765108 (Bug#58036) client utf32, utf16, ucs2 should be disallowed, they crash server
A separate fix for 5.1 (as 5.1 and 5.5 have seriously
differged in the related pieces of the code).
A patch for 5.5 was approved earlier.

Problem: ucs2 was correctly disallowed in "SET NAMES" only,
while mysql_real_connect() and mysql_change_user() still allowed
to use ucs2, which made server crash.

Fix: disallow ucs2 in mysql_real_connect() and mysql_change_user().

  @ sql/sql_priv.h
    - changing return type for thd_init_client_charset() to bool,
      to return errors to the caller

  @ sql/sql_var.cc
    - using new function

  @ sql/sql_connect.cc
    - thd_client_charset_init:
      in case of unsupported client character set send error and return true;
      in case of success return false
    - check_connection:
      Return error if character set initialization failed

  @ sql/sql_parse.cc
    - check charset in the very beginnig of the CMD_CHANGE_USER handling code

  @ tests/mysql_client_test.c
    - adding tests
2011-02-18 16:12:36 +03:00
Vasil Dimov
f912dcd82e Merge mysql-5.1-innodb -> mysql-5.1 2011-02-18 14:57:11 +02:00
Martin Hansson
cd4c263dc4 Bug#11766675 - 59839: Aggregation followed by subquery yields wrong result
The loop that was looping over subqueries' references to outer field used a
local boolean variable to tell whether the field was grouped or not. But the
implementor failed to reset the variable after each iteration. Thus a field
that was not directly aggregated appeared to be.

Fixed by resetting the variable upon each new iteration.
2011-02-18 11:50:06 +01:00
Marko Mäkelä
db55cf8526 Allow 30 seconds for slow shutdown in the Bug #60049 test. 2011-02-17 22:25:33 +02:00
Vasil Dimov
5e7d354326 Fix the non-determinism in innodb_information_schema.test
Thanks to Kristian Nielsen for finding out the root cause for the
failure, see: https://bugs.launchpad.net/maria/+bug/677407
2011-02-17 19:09:53 +02:00
Vasil Dimov
7581b94a6c Merge mysql-5.1 from bk-internal into my local repo 2011-02-17 14:07:39 +02:00
Vasil Dimov
0a3e7beb1e Merge mysql-5.1-innodb -> mysql-5.1 2011-02-17 13:56:05 +02:00
Magne Mahre
f2a42aee2e Bug#48053 String::c_ptr has a race and/or does an invalid
memory reference

There are two issues present here.
  1) There is a possibility that we test a byte beyond the
     allocated buffer

  2) We compare a byte that might never have been
     initalized to see if it's 0.

The first issue is not triggered by existing code, but an
ASSERT has been added to safe-guard against introducing
new code that triggers it.

The second issue is what triggers the Valgrind warnings
reported in the bug report. A buffer is allocated in
class String to hold the value. This buffer is populated
by the character data constituting the string, but is not
zero-terminated in most cases.  Testing if it is indeed
zero-terminated means that we check a byte that has never
been explicitly set, thus causing Valgrind to trigger.

Note that issue 2 is not a serious problem.  The variable
is read, and if it's not zero, we will set it to zero.
There are no further consequences.

Note that this patch does not fix the underlying problems
with issue 1, as it is deemed too risky to fix at this
point (as noted in the bug report).  As discussed in
the report, the c_ptr() method should probably be
replaced, but this requires a thorough analysis of the
~200 calls to the method.
2011-02-17 12:43:53 +01:00
Marko Mäkelä
e428f0ed9d Disable the Bug #60049 test on embedded, as it requires server restart. 2011-02-17 09:45:07 +02:00
Jonathan Perkin
1ce649d59c Merge to mysql-5.1 2011-02-16 14:43:56 -08:00
Jonathan Perkin
edcdc79e5a Updated README file. 2011-02-16 14:42:44 -08:00
Bjorn Munch
378ddd475f Simple fix of suppress pattern in test insert_select 2011-02-16 21:43:12 +01:00
Jon Olav Hauglid
d1192eb8ee Followup to Bug #11752069 (former bug 43152)
Assertion `bitmap_is_set_all(&table->s->all_set)' failed in
handler::ha_reset

This followup fixes the compilation warning
  'test_bit' may be used uninitialized in this function
introduced by the previous patch.
2011-02-16 18:19:10 +01:00
Jon Olav Hauglid
ba5b97343c Bug #11752069 (former bug 43152)
Assertion `bitmap_is_set_all(&table->s->all_set)' failed in
handler::ha_reset

This assertion could be triggered if two connections simultaneously
executed two bitmap test functions on the same bitmap. For example,
the assertion could be triggered if one connection executed UPDATE
while a second connection executed SELECT on the same table.

Even if bitmap test functions have read-only semantics and have
const bitmaps as parameter, several of them modified the internal
state of the bitmap. With interleaved execution of two such functions
it was possible for one function to modify the state of the same
bitmap that the other function had just modified. This lead to an
inconsistent state and could trigger the assert.

Internally the bitmap uses 32 bit words for storage. Since bitmaps
can contain any number of bits, the last word in the bitmap may
not be fully used. A 32 bit mask is maintained where a bit is set
if the corresponding bit in the last bitmap word is unused.
The problem was that several test functions applied this mask to
the last word. Sometimes the mask was negated and used to zero out
the remainder of the last word and sometimes the mask was used as-is
to fill the remainder of the last word with 1's. This meant that if
a function first used the negated mask and another function then
used the mask as-is (or vice-versa), the first function would then
get the wrong result.

This patch fixes the problem by changing the implementation of
9 bitmap functions that modified the bitmap state even if the 
bitmap was declared const. These functions now preserve the
internal state of the bitmap. This makes it possible for
two connections to concurrently execute two of these functions
on the same bitmap without issues.

The patch also removes dead testing code from my_bitmap.c.
These tests have already been moved to unittest/mysys/bitmap-t.c.
Existing test coverage of my_bitmap has been extended.

No MTR test case added as this would require adding several sync
points to the bitmap functions. The patch has been tested with
a non-deterministic test case posted on the bug report.
2011-02-16 16:26:19 +01:00
Marko Mäkelä
afda842f02 Make the implicit unpack parameter explicit in the Bug #60049 test. 2011-02-16 15:34:16 +02:00
Dmitry Lenev
7e1cd4ae0d Fix for bug#11766714 (former bug @59888) "debug assertion when
attempt to create spatial index on char > 31 bytes".

Attempt to create spatial index on char field with length
greater than 31 byte led to assertion failure on server
compiled with safemutex support.

The problem occurred in mi_create() function which was called
to create a new version of table being altered. This function
failed since it detected an attempt to create a spatial key
on non-binary column and tried to return an error.
On its error path it tried to unlock THR_LOCK_myisam mutex
which has not been not locked at this point. Indeed such an
incorrect behavior was caught by safemutex wrapper and caused
assertion failure.

This patch fixes the problem by ensuring that mi_create()
doesn't releases THR_LOCK_myisam mutex on error path if it was
not acquired.
2011-02-15 14:03:05 +03:00
Marko Mäkelä
518a4440ea Add a test for suspected Bug#60049. 2011-02-15 12:12:27 +02:00
Marko Mäkelä
6ae8c575f3 Bug#59307 Valgrind: uninitialized value in rw_lock_set_writer_id_and_recursion_flag()
rw_lock_create_func(): Initialize lock->writer_thread, so that Valgrind
will not complain even when Valgrind instrumentation is not enabled.
Flag lock->writer_thread uninitialized, so that Valgrind can complain
when it is used uninitialized.

rw_lock_set_writer_id_and_recursion_flag(): Revert the bogus Valgrind
instrumentation that was pushed in the first attempt to fix this bug.
2011-02-15 10:51:33 +02:00
Jimmy Yang
d06bb27fd1 Fix Bug #59749 Enabling concurrent reads while creating non-primary unique
index gives failures.

Approved by Marko
2011-02-14 02:07:59 -08:00
Jonathan Perkin
d5ffcb4235 Raise version number after cloning 5.1.56 2011-02-11 11:32:03 +01:00
Georgi Kodinov
56bca19e9a version bump to 5.1.57 2011-02-11 12:09:04 +02:00
Vasil Dimov
07116bbf8b Fix Bug#59307 Valgrind: uninitialized value in rw_lock_set_writer_id_and_recursion_flag()
by silencing a bogus Valgrind warning:

==4392== Conditional jump or move depends on uninitialised value(s)
==4392==    at 0x5A18416: rw_lock_set_writer_id_and_recursion_flag (sync0rw.ic:283)
==4392==    by 0x5A1865C: rw_lock_x_lock_low (sync0rw.c:558)
==4392==    by 0x5A18481: rw_lock_x_lock_func (sync0rw.c:617)
==4392==    by 0x597EEE6: mtr_x_lock_func (mtr0mtr.ic:271)
==4392==    by 0x597EBBD: fsp_header_init (fsp0fsp.c:970)
==4392==    by 0x5A15E78: innobase_start_or_create_for_mysql (srv0start.c:1508)
==4392==    by 0x598B789: innobase_init(void*) (ha_innodb.cc:2282)

os_compare_and_swap_thread_id() is defined as
__sync_bool_compare_and_swap(). From the GCC doc:

`bool __sync_bool_compare_and_swap (TYPE *ptr, TYPE oldval TYPE newval, ...)'
  ...
  The "bool" version returns true if the comparison is successful and
  NEWVAL was written.

So it is not possible that the return value is uninitialized, no matter what
the arguments to os_compare_and_swap_thread_id() are. Probably Valgrind gets
confused by the implementation of the GCC internal function
__sync_bool_compare_and_swap().
2011-02-10 17:16:32 +02:00
Vasil Dimov
2ae1cdf065 Increment InnoDB Plugin version from 1.0.15 to 1.0.16.
InnoDB Plugin 1.0.15 has been released with MySQL 5.1.55.
2011-02-10 13:21:22 +02:00
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