Commit graph

62635 commits

Author SHA1 Message Date
Marko Mäkelä
afb7f96b06 Copy built-in InnoDB tests to mysql-test/suite/innodb_plugin. 2010-06-03 12:48:59 +03:00
Marko Mäkelä
05bf36cbb0 Source have_innodb_plugin.inc in the plugin tests. 2010-06-03 12:46:37 +03:00
Marko Mäkelä
dbafe6be28 Add innodb_plugin to mysql-test-run default suites. 2010-06-03 12:45:34 +03:00
Marko Mäkelä
3ac0b6f203 Document the Bug #53674 fix in the InnoDB Plugin 2010-06-02 13:39:03 +03:00
Marko Mäkelä
c84c4b107c Bug#53674: InnoDB: Error: unlock row could not find a 4 mode lock on the record
In semi-consistent read, only unlock freshly locked non-matching records.

lock_rec_lock_fast(): Return LOCK_REC_SUCCESS,
LOCK_REC_SUCCESS_CREATED, or LOCK_REC_FAIL instead of TRUE/FALSE.

enum db_err: Add DB_SUCCESS_LOCKED_REC for indicating a successful
operation where a record lock was created.

lock_sec_rec_read_check_and_lock(),
lock_clust_rec_read_check_and_lock(), lock_rec_enqueue_waiting(),
lock_rec_lock_slow(), lock_rec_lock(), row_ins_set_shared_rec_lock(),
row_ins_set_exclusive_rec_lock(), sel_set_rec_lock(),
row_sel_get_clust_rec_for_mysql(): Return DB_SUCCESS_LOCKED_REC if a
new record lock was created. Adjust callers.

row_unlock_for_mysql(): Correct the function documentation.

row_prebuilt_t::new_rec_locks: Correct the documentation.
2010-06-02 13:37:14 +03:00
Marko Mäkelä
306e1338a5 Bug#53674: InnoDB: Error: unlock row could not find a 4 mode lock on the record
In semi-consistent read, only unlock freshly locked non-matching records.

Define DB_SUCCESS_LOCKED_REC for indicating a successful operation
where a record lock was created.

lock_rec_lock_fast(): Return LOCK_REC_SUCCESS,
LOCK_REC_SUCCESS_CREATED, or LOCK_REC_FAIL instead of TRUE/FALSE.

lock_sec_rec_read_check_and_lock(),
lock_clust_rec_read_check_and_lock(), lock_rec_enqueue_waiting(),
lock_rec_lock_slow(), lock_rec_lock(), row_ins_set_shared_rec_lock(),
row_ins_set_exclusive_rec_lock(), sel_set_rec_lock(),
row_sel_get_clust_rec_for_mysql(): Return DB_SUCCESS_LOCKED_REC if a
new record lock was created. Adjust callers.

row_unlock_for_mysql(): Correct the function documentation.

row_prebuilt_t::new_rec_locks: Correct the documentation.
2010-06-02 13:26:37 +03:00
Marko Mäkelä
b55ec58701 fil_print_orphaned_tablespaces(): Unused function, remove. 2010-06-02 13:19:40 +03:00
Marko Mäkelä
9f278a3682 Document Bug #48197 fix 2010-06-01 16:58:02 +03:00
Marko Mäkelä
6e569dd209 Bug#48197: Concurrent rw_lock_free may cause assertion failure
rw_lock_t: Remove magic_n unless UNIV_DEBUG is defined.
rw_lock_free(): Invalidate magic_n only after removing from rw_lock_list.
2010-06-01 16:43:35 +03:00
Marko Mäkelä
90cb7fa432 Minor cleanup.
lock_rec_unlock(): Cache first_lock and rewrite while() loops as for().

btr_cur_optimistic_update(): Use common error handling return.

row_create_prebuilt(): Add Valgrind instrumentation.
2010-06-01 15:07:51 +03:00
Marko Mäkelä
dd201037c2 Document the Bug #53812 fix. 2010-06-01 15:05:21 +03:00
Marko Mäkelä
2caade5053 Bug#53812: assert row/row0umod.c line 660 in txn rollback after crash recovery
row_undo_mod_upd_exist_sec(): Tolerate a failure to build the index entry
for a DYNAMIC or COMPRESSED table during crash recovery.
2010-06-01 13:37:38 +03:00
Vasil Dimov
da0b6d611f Merge a change from mysql-trunk-innodb:
------------------------------------------------------------
  revno: 3127
  revision-id: vasil.dimov@oracle.com-20100531152341-x2d4hma644icamh1
  parent: vasil.dimov@oracle.com-20100531105923-kpjwl4rbgfpfj13c
  committer: Vasil Dimov <vasil.dimov@oracle.com>
  branch nick: mysql-trunk-innodb
  timestamp: Mon 2010-05-31 18:23:41 +0300
  message:
    Fix Bug #53947 InnoDB: Assertion failure in thread 4224 in file .\sync\sync0sync.c line 324
    
    Destroy the rw-lock object before freeing the memory it is occupying.
    If we do not do this, then the mutex that is contained in the rw-lock
    object btr_search_latch_temp->mutex gets "freed" and subsequently
    mutex_free() from sync_close() hits a mutex whose memory has been
    freed and crashes.
    
    Approved by:	Heikki (via IRC)
    Discussed with:	Calvin
2010-05-31 19:35:40 +03:00
Jimmy Yang
d02ec3463e This is to fix a special case for the fix on bug #53592, where the
err_index could be not a member of the share structure or prebuilt
structure passed from MySQL. For now, we resort to the traditional
way of scanning index->table for the index number.
2010-05-28 06:17:37 -07:00
Inaam Rana
6734ce935e Fix the printout in for long semaphore waits to not
list a thread doing a wait_ex as an s-lock waiter.
2010-05-27 12:31:00 -04:00
Jimmy Yang
e20e3a2426 Update ChangeLog for bug fix regarding 53582. 2010-05-25 22:38:14 -07:00
Jimmy Yang
602bb5c0fe Fix Bug #53592 in plugin code, "crash replacing duplicates into table
after fast alter table added unique key". Look up MySQL index number should
go through index translation table.

rb://347, approved by Marko
2010-05-25 22:31:27 -07:00
Vasil Dimov
f230391cbb Merge mysql-5.1-innodb from bk-internal into my local tree 2010-05-25 17:21:33 +03:00
Marko Mäkelä
268e38753b row_search_for_mysql(): Add assertions to track down Bug #53627. 2010-05-25 15:53:52 +03:00
Marko Mäkelä
4ecd80297e Suppress bogus Valgrind warnings about buf_buddy_relocate()
accessing uninitialized memory in Valgrind-instrumented builds.
2010-05-25 15:37:48 +03:00
Vasil Dimov
f32908eab8 Merge mysql-5.1 into mysql-5.1-innodb
(this changeset does not introduce any changes)
2010-05-25 12:45:17 +03:00
Vasil Dimov
88676110ec Merge mysql-5.1-innodb from bk-internal into my local tree 2010-05-25 12:14:57 +03:00
Vasil Dimov
10f9434f12 Fix comments on row_merge_write()
This is a port of
vasil.dimov@oracle.com-20100521175337-c1b1lqxgizqegb0w and
vasil.dimov@oracle.com-20100521180951-mef23h24k023xuwq
from mysql-trunk-innodb
2010-05-25 11:01:03 +03:00
Marko Mäkelä
2dcd1ac65a Document the Bug #53578 fix. 2010-05-24 14:43:49 +03:00
Marko Mäkelä
d4fd7bb95e Bug#53578: assert on invalid page access, in fil_io()
Store the max_space_id in the data dictionary header in order to avoid
space_id reuse.

DICT_HDR_MIX_ID: Renamed to DICT_HDR_MAX_SPACE_ID, DICT_HDR_MIX_ID_LOW.

dict_hdr_get_new_id(): Return table_id, index_id, space_id or a subset of them.

fil_system_t: Add ibool space_id_reuse_warned.

fil_create_new_single_table_tablespace(): Get the space_id from the caller.

fil_space_create(): Issue a warning if the fil_system->max_assigned_id
is exceeded.

fil_assign_new_space_id(): Return TRUE/FALSE and take a pointer to the
space_id as a parameter. Make the function public.

fil_init(): Initialize all fil_system fields by mem_zalloc(). Remove
explicit initializations of certain fields to 0 or NULL.
2010-05-24 14:04:39 +03:00
Vasil Dimov
f664def4da Merge mysql-5.1-innodb from bk-internal into my local tree 2010-05-20 16:31:57 +03:00
Vasil Dimov
09438406cb Disable main.ps_3innodb for valgrind tests since it results in known
failures, that are described in

Bug#38999 valgrind warnings for update statement in function compare_record()

At the time I am adding this the failures are:

main.ps_3innodb                          [ fail ]  Found warnings/errors in server log file!
        Test ended at 2010-05-20 01:17:34
line
==31559== Thread 11:
==31559== Conditional jump or move depends on uninitialised value(s)
==31559==    at 0x75C5BD: compare_record(st_table*) (sql_update.cc:35)
==31559==    by 0x744732: write_record(THD*, st_table*, st_copy_info*) (sql_insert.cc:1486)
==31559==    by 0x74A0D7: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:835)
==31559==    by 0x6A79B4: mysql_execute_command(THD*) (sql_parse.cc:3198)
==31559==    by 0x754998: Prepared_statement::execute(String*, bool) (sql_prepare.cc:3583)
==31559==    by 0x754C4F: Prepared_statement::execute_loop(String*, bool, unsigned char*, unsigned char*) (sql_prepare.cc:3258)
==31559==    by 0x754F33: mysql_sql_stmt_execute(THD*) (sql_prepare.cc:2529)
==31559==    by 0x6A5028: mysql_execute_command(THD*) (sql_parse.cc:2272)
==31559==    by 0x6ADAE8: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5986)
==31559==    by 0x6AF3A4: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1233)
==31559==    by 0x6B0800: do_command(THD*) (sql_parse.cc:874)
==31559==    by 0x69CB46: handle_one_connection (sql_connect.cc:1134)
==31559==    by 0x33EDA062F6: start_thread (in /lib64/libpthread-2.5.so)
==31559==    by 0x33ECED1B6C: clone (in /lib64/libc-2.5.so)
==31559== Conditional jump or move depends on uninitialised value(s)
==31559==    at 0x75C5D0: compare_record(st_table*) (sql_update.cc:35)
==31559==    by 0x744732: write_record(THD*, st_table*, st_copy_info*) (sql_insert.cc:1486)
==31559==    by 0x74A0D7: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:835)
==31559==    by 0x6A79B4: mysql_execute_command(THD*) (sql_parse.cc:3198)
==31559==    by 0x754998: Prepared_statement::execute(String*, bool) (sql_prepare.cc:3583)
==31559==    by 0x754C4F: Prepared_statement::execute_loop(String*, bool, unsigned char*, unsigned char*) (sql_prepare.cc:3258)
==31559==    by 0x754F33: mysql_sql_stmt_execute(THD*) (sql_prepare.cc:2529)
==31559==    by 0x6A5028: mysql_execute_command(THD*) (sql_parse.cc:2272)
==31559==    by 0x6ADAE8: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5986)
==31559==    by 0x6AF3A4: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1233)
==31559==    by 0x6B0800: do_command(THD*) (sql_parse.cc:874)
==31559==    by 0x69CB46: handle_one_connection (sql_connect.cc:1134)
==31559==    by 0x33EDA062F6: start_thread (in /lib64/libpthread-2.5.so)
==31559==    by 0x33ECED1B6C: clone (in /lib64/libc-2.5.so)
^ Found warnings in /export/home4/pb2/test/sb_3-1827397-1274300957.87/mysql-5.1.48-linux-x86_64-test/mysql-test/var-n_mix/log/mysqld.1.err
2010-05-20 16:27:35 +03:00
Marko Mäkelä
a426d6f9a8 buf_LRU_free_block(): Correct an error in the comment. 2010-05-20 16:07:34 +03:00
Vasil Dimov
8ae42ceb0c Merge mysql-5.1-innodb from bk-internal into my local tree 2010-05-20 15:54:03 +03:00
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
Vasil Dimov
56586334f1 Merge from mysql-trunk-innodb into mysql-5.1-innodb/storage/innodb_plugin:
------------------------------------------------------------
  revno: 3094
  revision-id: vasil.dimov@oracle.com-20100513074652-0cvlhgkesgbb2bfh
  parent: vasil.dimov@oracle.com-20100512173700-byf8xntxjur1hqov
  committer: Vasil Dimov <vasil.dimov@oracle.com>
  branch nick: mysql-trunk-innodb
  timestamp: Thu 2010-05-13 10:46:52 +0300
  message:
    Followup to Bug#51920, fix binlog.binlog_killed
    
    This is a followup to the fix of
    
    Bug#51920 Innodb connections in row lock wait ignore KILL until lock wait
    timeout
    
    in that fix (rb://279) the behavior was changed to honor when a trx is
    interrupted during lock wait, but the returned error code was still
    "lock wait timeout" when it should be "interrupted".
    
    This change fixes the non-deterministically failing test binlog.binlog_killed,
    that failed like this:
    
    binlog.binlog_killed 'stmt'              [ fail ]
            Test ended at 2010-05-12 11:39:08
    
    CURRENT_TEST: binlog.binlog_killed
    mysqltest: At line 208: query 'reap' failed with wrong errno 1205: 'Lock wait timeout exceeded; try restarting transaction', instead of 0...
    
    Approved by:	Sunny Bains (rb://344)
  ------------------------------------------------------------
2010-05-20 10:50:07 +03:00
Vasil Dimov
094a1f1e58 Merge from mysql-trunk-innodb into mysql-5.1-innodb/storage/innobase:
------------------------------------------------------------
  revno: 3094
  revision-id: vasil.dimov@oracle.com-20100513074652-0cvlhgkesgbb2bfh
  parent: vasil.dimov@oracle.com-20100512173700-byf8xntxjur1hqov
  committer: Vasil Dimov <vasil.dimov@oracle.com>
  branch nick: mysql-trunk-innodb
  timestamp: Thu 2010-05-13 10:46:52 +0300
  message:
    Followup to Bug#51920, fix binlog.binlog_killed
    
    This is a followup to the fix of
    
    Bug#51920 Innodb connections in row lock wait ignore KILL until lock wait
    timeout
    
    in that fix (rb://279) the behavior was changed to honor when a trx is
    interrupted during lock wait, but the returned error code was still
    "lock wait timeout" when it should be "interrupted".
    
    This change fixes the non-deterministically failing test binlog.binlog_killed,
    that failed like this:
    
    binlog.binlog_killed 'stmt'              [ fail ]
            Test ended at 2010-05-12 11:39:08
    
    CURRENT_TEST: binlog.binlog_killed
    mysqltest: At line 208: query 'reap' failed with wrong errno 1205: 'Lock wait timeout exceeded; try restarting transaction', instead of 0...
    
    Approved by:	Sunny Bains (rb://344)
  ------------------------------------------------------------

This merge is non-trivial since it has to introduce the DB_INTERRUPTED
error code.

Also revert vasil.dimov@oracle.com-20100408165555-9rpjh24o0sa9ad5y
which adjusted the binlog.binlog_killed test to the new (wrong) behavior
2010-05-20 10:39:02 +03:00
unknown
e3a0d83031 Merge from mysql-5.1.47-release 2010-05-20 01:33:57 +02: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ä
a1250799af Work around Bug #53750 in innodb.innodb_bug48024 2010-05-19 10:56:13 +03:00
Marko Mäkelä
4ff217a458 Work around Bug #53750 in innodb_bug48024.test 2010-05-18 16:06:58 +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
Marko Mäkelä
80323e5200 Fix sys_vars.tx_isolation_func.test, which was broken in revno 3432
when making READ UNCOMMITTED lock as little as READ COMMITTED.
2010-05-11 19:58:45 +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