Commit graph

3411 commits

Author SHA1 Message Date
Marko Mäkelä
98406ba452 Bug#53593: Add some instrumentation to improve Valgrind sensitivity
BUILD/*: Add valgrind_configs=--with-valgrind.
BUILD/*: Remove -USAFEMALLOC from valgrind_flags.

configure.in: Add AC_ARG_WITH(valgrind) and HAVE_VALGRIND.

include/my_sys.h: Define a number of MEM_ wrappers for VALGRIND_ functions.
include/my_sys.h: Make TRASH do MEM_UNDEFINED().

include/m_string.h: Remove unused macro bzero_if_purify(A,B).

_mymalloc(): Declare MEM_UNDEFINED() on the allocated memory.

_myfree(): Declare MEM_NOACCESS() on the freed memory.

storage/innobase/include/univ.i: Enable UNIV_DEBUG_VALGRIND based on
HAVE_VALGRIND rather than HAVE_purify.

Possible things to do:
 * In my_global.h, remove the defined(HAVE_purify) condition
   from the _WIN32 uint3korr().
 * In my_global.h *int*korr(), use | instead of +
   in order to keep the Valgrind V bits accurate
 * Consider replacing HAVE_purify with HAVE_VALGRIND
 * Use VALGRIND_CREATE_BLOCK, VALGRIND_DISCARD in mem_root and similar places
2010-05-20 13:40:42 +03:00
Marko Mäkelä
3564a2643f Make UNIV_DEBUG Valgrind friendly in the built-in InnoDB.
Use | instead of +, and mask out the dont-care bits in debug assertions.
2010-05-19 11:16:18 +03:00
Marko Mäkelä
627074a6a4 Make UNIV_DEBUG Valgrind friendly. Use | instead of +,
and mask out the dont-care bits in debug assertions.
2010-05-19 11:07:43 +03:00
Marko Mäkelä
b8df3227da Silence some more bogus Valgrind warnings on non-32-bit systems. (Bug #53307) 2010-05-19 11:01:52 +03:00
Marko Mäkelä
72541c6b0d Add Valgrind checks to compressed BLOB access. 2010-05-19 10:58:43 +03:00
Marko Mäkelä
d32bf00e21 Document Bug #48024 and Bug #53644 in the ChangeLog 2010-05-14 16:10:50 +03:00
Marko Mäkelä
54f59fb55e Make the InnoDB FOREIGN KEY parser understand multi-statements. (Bug #48024)
Also make InnoDB thinks that /*/ only starts a comment. (Bug #53644).

This fixes the bugs in the InnoDB Plugin.

ha_innodb.h: Use trx_query_string() instead of trx_query() when
available (MySQL 5.1.42 or later).

innobase_get_stmt(): New function, to retrieve the currently running
SQL statement.

struct trx_struct: Remove mysql_query_str. Use innobase_get_stmt() instead.

dict_strip_comments(): Add and observe the parameter sql_length. Treat
/*/ as the start of a comment.

dict_create_foreign_constraints(), row_table_add_foreign_constraints():
Add the parameter sql_length.
2010-05-14 16:08:15 +03:00
Marko Mäkelä
c3c2279cbd Make the InnoDB FOREIGN KEY parser understand multi-statements. (Bug #48024)
Also make InnoDB thinks that /*/ only starts a comment. (Bug #53644).

struct trx_struct: Add mysql_query_len.

ha_innodb.cc: Use trx_query_string() instead of trx_query() and
initialize trx->mysql_query_len.

INNOBASE_COPY_STMT(thd, trx): New macro, to initialize
trx->mysql_query_str and trx->mysql_query_len.

dict_strip_comments(): Add and observe the parameter sql_length. Treat
/*/ as the start of a comment.

dict_create_foreign_constraints(), row_table_add_foreign_constraints():
Add the parameter sql_length.
2010-05-14 16:02:28 +03:00
Marko Mäkelä
162ab29157 Remove unused code. 2010-05-14 13:51:26 +03:00
Marko Mäkelä
42a07d5040 Document the Bug #53591 fix in the ChangeLog. 2010-05-12 13:46:03 +03:00
Marko Mäkelä
bfdae6402c ha_innobase::add_index(): Reset trx->error_state in error handling.
(Bug #53591)
2010-05-12 13:42:12 +03:00
Marko Mäkelä
96853eed54 Document recent fixes in ChangeLog. 2010-05-12 09:09:22 +03:00
Marko Mäkelä
2c889b9dbc row_merge_drop_temp_indexes(): Do not reference freed memory.
(Bug #53471)
2010-05-12 08:39:25 +03:00
Vasil Dimov
f4e5069f60 Merge mysql-5.1-innodb from bk-internal locally 2010-05-11 14:00:29 +03:00
Vasil Dimov
703309a3a8 Raise InnoDB Plugin version from 1.0.8 to 1.0.9.
1.0.8 will be released in MySQL 5.1.47, so
1.0.9 will be released in MySQL 5.1.48
2010-05-11 13:58:28 +03:00
Marko Mäkelä
537abedca7 Merge a patch from Facebook to fix Bug #53290
commit e759bc64eb5c5eed4f75677ad67246797d486460
Author: Ryan Mack
Date:   3 days ago

    Bugfix for 53290, fast unique index creation fails on duplicate null values

    Summary:
    Bug in the fast index creation code incorrectly considers null
    values to be duplicates during block merging.  Innodb policy is that
    multiple null values are allowed in a unique index.  Null duplicates
    were correctly ignored while sorting individual blocks and with slow
    index creation.

    Test Plan:
    mtr, including new test, load dbs using deferred index creation

    License:
    Copyright (C) 2009-2010 Facebook, Inc.  All Rights Reserved.

    Dual licensed under BSD license and GPLv2.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:
    1. Redistributions of source code must retain the above copyright notice,
       this list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright notice,
       this list of conditions and the following disclaimer in the documentation
       and/or other materials provided with the distribution.

    THIS SOFTWARE IS PROVIDED BY FACEBOOK, INC. ``AS IS'' AND ANY EXPRESS OR
    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
    EVENT SHALL FACEBOOK, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
    ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the Free
    Software Foundation; version 2 of the License.

    This program is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    more details.

    You should have received a copy of the GNU General Public License along with
    this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    Place, Suite 330, Boston, MA  02111-1307  USA
2010-05-11 13:53:08 +03:00
Marko Mäkelä
80142dd779 Do not demand that buf_page_t be fully initialized on 64-bit systems.
There may be padding before buf_page_t::zip. (Bug #53307)
2010-05-11 13:50:12 +03:00
Marko Mäkelä
b7cf210256 btr_page_split_and_insert(): Add an assertion
suggested by Sunny Bains when reviewing Bug #52964.
2010-05-11 13:49:10 +03:00
Marko Mäkelä
5acbc67f6e Remove a stray expression. Spotted by Sunny Bains. 2010-05-11 13:45:00 +03:00
Vasil Dimov
85f8f09c3e Make dict_index_stat_mutex[] static because it is only used in dict0dict.c 2010-05-10 16:24:33 +03:00
Marko Mäkelä
326d75bd41 Merge a contribution from Ryan Mack at Facebook:
Bugfix for 53290, fast unique index creation fails on duplicate null values

    Summary:
    Bug in the fast index creation code incorrectly considers null
    values to be duplicates during block merging.  Innodb policy is that
    multiple null values are allowed in a unique index.  Null duplicates
    were correctly ignored while sorting individual blocks and with slow
    index creation.

    Test Plan:
    mtr, including new test, load dbs using deferred index creation

    DiffCamp Revision: 110840
    Reviewed By: mcallaghan
    CC: mcallaghan, mysql-devel@lists
    Revert Plan:
    OK
2010-05-05 15:39:01 +03:00
Marko Mäkelä
dc4abe9481 Document Bug #53256 2010-05-05 14:50:11 +03:00
Marko Mäkelä
3ea54dbfa9 Note the 1.0.7 release 2010-05-05 14:45:13 +03:00
Marko Mäkelä
3f8a812d7a row_merge_drop_temp_indexes(): Load the table via the dictionary cache.
Allow multiple indexes to be dropped. (Bug #53256)
2010-05-05 14:24:11 +03:00
Marko Mäkelä
356d3a6ddb Merge 2010-05-05 13:37:33 +03:00
Marko Mäkelä
d4b1117768 Add Valgrind diagnostics to track down Bug #38999. 2010-05-05 13:05:07 +03:00
Jimmy Yang
9141b67822 Update ChangeLog for bug fix of #53165 2010-05-05 03:02:19 -07:00
Marko Mäkelä
264942661b Add Valgrind diagnostics to track down Bug #38999. 2010-05-05 12:53:28 +03:00
Jimmy Yang
6bc1a96b31 Port fix for 53165 to InnoDB 5.1 plugin. The change buffering options
are different in 5.1 comparing to that of 5.5, so a hand port is
necessary to avoid wrong default option to be set by a simple
branch merge.
2010-05-04 21:52:24 -07:00
Marko Mäkelä
322dda2397 Document Bug #53306 in the InnoDB Plugin ChangeLog. 2010-05-04 16:15:17 +03:00
Marko Mäkelä
304daa7431 fsp_init_file_page_low(): Zero out the page. (Bug #53306) 2010-05-04 16:13:58 +03:00
Marko Mäkelä
54b01fbff1 fsp_init_file_page_low(): Zero out the page. (Bug #53306) 2010-05-04 16:09:17 +03:00
Marko Mäkelä
6e5619be2c Add Valgrind checks to catch uninitialized writes to data files.
buf_flush_insert_into_flush_list(),
buf_flush_insert_sorted_into_flush_list(),
buf_flush_post_to_doublewrite_buf(): Check that the page is initialized.
2010-05-04 15:55:10 +03:00
Marko Mäkelä
19263724e4 Add Valgrind checks to catch uninitialized writes to data files.
buf_flush_insert_into_flush_list(),
buf_flush_insert_sorted_into_flush_list(),
buf_flush_post_to_doublewrite_buf(): Check that the page is initialized.
2010-05-04 15:47:44 +03:00
Marko Mäkelä
39be66c7ce Remove UNIV_BTR_AVOID_COPY. It was broken because btr_attach_half_pages()
would get the block, new_block in the wrong order.
Fixing that would have complicated the function even further
for this marginal case.
2010-05-04 13:55:46 +03:00
Marko Mäkelä
4e76242675 btr_page_split_and_insert(): Correct the fix of Bug #52964.
When split_rec==NULL, choose the correct node pointer key (first_rec).
2010-05-04 12:31:28 +03:00
Marko Mäkelä
7c4e538d76 buf_zip_decompress(): Allow BUF_NO_CHECKSUM_MAGIC as the stamped checksum.
buf_page_get_gen(): Assert that buf_zip_decompress() succeeds.
Callers are not prepared for a NULL return value. (Bug #53248)
2010-05-03 15:28:59 +03:00
Marko Makela
c144a091db recv_sys_init(), recv_sys_empty_hash(): Shrink recv_sys->addr_hash.
This addresses Bug #53122 in the built-in InnoDB.
2010-04-29 15:41:47 +02:00
Marko Makela
f10cf42068 recv_sys_init(), recv_sys_empty_hash(): Shrink recv_sys->addr_hash.
recv_addr_t: Turn space,page_no into bitfields to save space on 64-bit.
This addresses Bug #53122 in the InnoDB Plugin.
2010-04-29 15:37:50 +02:00
Marko Makela
0ca989eaaf Reduce the next-key locking of READ UNCOMMITTED to match that of
READ COMMITTED in the built-in InnoDB. (Bug #48607)
2010-04-29 15:29:45 +02:00
Marko Makela
74ae1326c9 Reduce the next-key locking of READ UNCOMMITTED to match that of
READ COMMITTED in the InnoDB Plugin. (Bug #48607)
2010-04-29 15:27:43 +02:00
Vasil Dimov
6fa8e485e5 Bug#53046 dict_update_statistics_low can still be run concurrently
on same table

Followup to vasil.dimov@oracle.com-20100428102033-dt3caf531rs3lidr :

Add more asserions, which I forgot.
2010-04-28 13:34:52 +03:00
Vasil Dimov
b7ef4f178d Revert the fix of Bug#38996 Race condition in ANALYZE TABLE
This is branches/zip@r6032 in SVN and _is part_ of
revid:svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6113
in BZR.

This is being reverted because now the code is serialized directly on
index->stat_n_diff_key_vals[] as the fix for
Bug#53046 dict_update_statistics_low can still be run concurrently on same table
goes.
2010-04-28 13:32:00 +03:00
Vasil Dimov
330f93bc11 Followup to vasil.dimov@oracle.com-20100428084627-wtrmc66wqvjsdgj7:
Address Marko's suggestions wrt the fix of
Bug#53046 dict_update_statistics_low can still be run concurrently
on same table
2010-04-28 13:20:33 +03:00
Vasil Dimov
2b57b0765d Fix Bug#53046 dict_update_statistics_low can still be run concurrently
on same table

Protect dict_index_t::stat_n_diff_key_vals[] with an array of
mutexes.

Testing: tested all code paths under UNIV_SYNC_DEBUG
for the one in dict_print() one has to enable the InnoDB table monitor:
CREATE TABLE innodb_table_monitor (a int) ENGINE=INNODB;
2010-04-28 11:46:27 +03:00
Marko Makela
91702fd313 Merge r6103 from InnoDB Plugin to the built-in InnoDB to fix Bug #53202:
------------------------------------------------------------------------
  r6103 | marko | 2009-10-26 15:46:18 +0200 (Mon, 26 Oct 2009) | 4 lines
  Changed paths:
     M /branches/zip/row/row0ins.c

  branches/zip: row_ins_alloc_sys_fields(): Zero out the system columns
  DB_TRX_ID, DB_ROLL_PTR and DB_ROW_ID, in order to avoid harmless
  Valgrind warnings about uninitialized data.  (The warnings were
  harmless, because the fields would be initialized at a later stage.)
  ------------------------------------------------------------------------
2010-04-28 08:33:25 +02:00
Vasil Dimov
a1bdbe8a0c Do not define UNIV_DEBUG_VALGRIND when HAVE_purify because
this results in some valgrind errors.

Bug#53202 valgrind: uninitialized bytes in dtuple_print()
has been opened to track this.
2010-04-27 17:05:41 +03:00
Marko Mäkelä
a5b4285132 row_merge_drop_temp_indexes(): Remove a bogus char-to-ulint cast. 2010-04-27 16:47:38 +03:00
Marko Mäkelä
4d646bd16e lock_rec_queue_validate(): Disable a bogus check that
a transaction that holds a lock on a clustered index record
also holds a lock on the secondary index record.
2010-04-26 16:10:29 +03:00
Marko Mäkelä
30d6298442 recv_sys_init(): Skip the red-black tree in Hot Backup. 2010-04-26 14:26:09 +03:00