Commit graph

306 commits

Author SHA1 Message Date
Marko Mäkelä
7271bcb4ec Bug#54358: READ UNCOMMITTED access failure of off-page DYNAMIC or COMPRESSED
columns

When the server crashes after a record stub has been inserted and
before all its off-page columns have been written, the record will
contain incomplete off-page columns after crash recovery. Such records
may only be accessed at the READ UNCOMMITTED isolation level or when
rolling back a recovered transaction in recv_recovery_rollback_active().
Skip these records at the READ UNCOMMITTED isolation level.

TODO: Add assertions for checking the above assumptions hold when an
incomplete BLOB is encountered.

btr_rec_copy_externally_stored_field(): Return NULL if the field is
incomplete.

row_prebuilt_t::templ_contains_blob: Clarify what "BLOB" means in this
context. Hint: MySQL BLOBs are not the same as InnoDB BLOBs.

row_sel_store_mysql_rec(): Return FALSE if not all columns could be
retrieved. Previously this function always returned TRUE.  Assert that
the record is not delete-marked.

row_sel_push_cache_row_for_mysql(): Return FALSE if not all columns
could be retrieved.

row_search_for_mysql(): Skip records containing incomplete off-page
columns. Assert that the transaction isolation level is READ
UNCOMMITTED.

rb://380 approved by Jimmy Yang
2010-06-29 15:55:18 +03:00
Sunny Bains
442ba20a92 Fix bug#54583. This change reverses rsvn:1350 by getting rid of a bogus assertion
and clarifies the invariant in dict_table_get_on_id().
      
In Mar 2007 Marko observed a crash during recovery, the crash resulted from
an UNDO operation on a system table. His solution was to acquire an X lock on
the data dictionary, this in hindsight was an overkill. It is unclear what
caused the crash, current hypothesis is that it was a memory corruption.
      
The X lock results in performance issues by when undoing changes due to
rollback during normal operation on regular tables.
      
Why the change is safe:
======================
The InnoDB code has changed since the original X lock change was made. In the
new code we always lock the data dictionary in X mode during startup when
UNDOing operations on the system tables (this is a given). This ensures that
the crash Marko observed cannot happen as long as all transactions that update
the system tables follow the standard rules by setting the appropriate DICT_OP
flag when writing the log records when they make the changes.
      
If transactions violate the above mentioned rule then during recovery (at
startup) the rollback code (see trx0roll.c) will not acquire the X lock
and we will see the crash again.  This will however be a different bug.
2010-06-25 18:18:41 +10:00
Vasil Dimov
011e57d24c Merge a lost changeset inaam.rana@oracle.com-20100624124450-2m3mg1238ewvakgx 2010-06-25 11:08:52 +03:00
Inaam Rana
dfed638267 Add ChangeLog for bug#39168 2010-06-24 08:44:50 -04:00
Marko Mäkelä
1910056fdc Add ChangeLog entry for Bug#54679 2010-06-24 13:48:20 +03:00
Marko Mäkelä
d2dfe0b8be Bug#54679: alter table causes compressed row_format to revert to compact
ha_innobase::create(): Add the local variable row_type = form->s->row_type.
Adjust it to ROW_TYPE_COMPRESSED when ROW_FORMAT is not specified or inherited
but KEY_BLOCK_SIZE is. Observe the inherited ROW_FORMAT even when it is not
explicitly specified.

innodb_bug54679.test: New test, to test the bug and to ensure that there are
no regressions. (The only difference in the test result without the patch
applied is that the first ALTER TABLE changes ROW_FORMAT to Compact.)
2010-06-24 13:46:20 +03:00
Jimmy Yang
1b5d6a33b6 Move the fix for bug #54044 to security branch, and revert commit -r3520:3521. 2010-06-23 19:10:10 -07:00
Jimmy Yang
5e127ad8ac Port fix for "bug #54044 Create temporary tables and using innodb crashes"
to 5.1 plugin codeline.

rb://378, approved by Marko
2010-06-22 19:39:20 -07:00
Vasil Dimov
5e6006dd42 Merge mysql-5.1-innodb from bk-internal to my local tree 2010-06-22 20:12:05 +03:00
Vasil Dimov
f763381aae Add ChangeLog entry for the fix of Bug#47991 2010-06-22 20:04:54 +03:00
Vasil Dimov
108ce56e60 Fix Bug#47991 InnoDB Dictionary Cache memory usage increases indefinitely
when renaming tables

Allocate the table name using ut_malloc() instead of table->heap because
the latter cannot be freed.

Adjust dict_sys->size calculations all over the code.

Change dict_table_t::name from const char* to char* because we need to
ut_malloc()/ut_free() it.

Reviewed by:	Inaam, Marko, Heikki (rb://384)
Approved by:	Heikki (rb://384)
2010-06-22 19:30:43 +03:00
Marko Mäkelä
baf5c6edec ChangeLog for Bug#54686 "field->col->mtype == type" assertion error at row/row0sel.c 2010-06-22 14:59:49 +03:00
Marko Mäkelä
ff9ba3e376 Bug#54686 "field->col->mtype == type" assertion error at row/row0sel.c
ha_innobase::index_read(), ha_innobase::records_in_range(): Check that
the index is useable before invoking row_sel_convert_mysql_key_to_innobase().

This fix is based on a suggestion by Yasufumi Kinoshita.
2010-06-22 14:52:15 +03:00
Marko Mäkelä
3e7d05b913 Bug#54658: Add ChangeLog entry 2010-06-21 12:51:48 +03:00
Marko Mäkelä
10c9c12bbf Bug #54658: InnoDB: Warning: allocated tablespace %lu, old maximum was 0
dict_check_tablespaces_and_store_max_id(): Initialize max_space_id
and fil_system->max_assigned_id from DICT_HDR_MAX_SPACE_ID.

fil_space_create(): Suppress the warning unless !recv_recovery_on
(do not complain while applying the redo log).
2010-06-21 12:40:08 +03:00
Vasil Dimov
644692fe83 Merge mysql-5.1-innodb from bk-internal to my local repo 2010-06-18 11:51:55 +03:00
Vasil Dimov
26cc1a4b3d Increment InnoDB Plugin version from 1.0.9 to 1.0.10, after
1.0.9 has been released with MySQL 5.1.48.
2010-06-18 10:00:01 +03:00
Jimmy Yang
573bf50c1e Fix an overly asserted assertion during previous checkin for bug #54330. 2010-06-17 10:33:03 -07:00
Jimmy Yang
9ac63a58fa Fix Bug #54330 Broken fast index creation. Add additional array to
account for each merge run's start offset, so correct offsets are
paired up for multiple merge runs.

rb://377 approved by Marko
2010-06-16 19:12:04 -07:00
Jimmy Yang
9908a1e090 Add checkin description for bug #47622 to ChangeLog. 2010-06-15 02:33:26 -07:00
Inaam Rana
b26db07a18 merge from parent 2010-06-10 10:35:39 -04:00
Inaam Rana
27c1213d55 Add a debug assertion. 2010-06-10 10:31:28 -04:00
Inaam Rana
18011f34fe Formatting changes 2010-06-10 09:58:11 -04:00
Sergey Glukhov
58f1c5fef3 Bug#38999 valgrind warnings for update statement in function compare_record()
(InnoDB plugin branch)
2010-06-09 16:17:18 +04:00
Inaam Rana
8a94e69e5b Add call to log_free_check() in the DML code paths that were missing
this before.
2010-06-08 14:14:08 -04:00
Marko Mäkelä
d8aada889e Document Bug#54009 in the InnoDB Plugin ChangeLog. 2010-06-08 15:12:15 +03:00
Marko Mäkelä
0b767082e7 Bug#54009: Server crashes when data is selected from non backed up table
for InnoDB plugin

dict_load_table(): Pass the correct tablespace flags to
fil_open_single_table_tablespace(). For ROW_FORMAT=COMPACT and REDUNDANT,
the tablespace flags are 0. The table flags would be 0 or DICT_TF_COMPACT.
2010-06-08 15:10:41 +03:00
Marko Mäkelä
883b16c7f7 buf_page_get_gen(): Pass file,line to rw_lock_x_lock(). 2010-06-08 14:40:55 +03:00
Jimmy Yang
c570b479e6 Remove unncessary name comapre in innobase_get_mysql_key_number_for_index()
introduced in bug fix #53592, since dict_table_t can sufficiently unique
identify the the table.
2010-06-03 06:44:48 -07:00
Marko Mäkelä
1655656b64 Document the Bug #53674 fix in the InnoDB Plugin 2010-06-02 13:39:03 +03:00
Marko Mäkelä
ac776a69e9 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ä
9938680e38 fil_print_orphaned_tablespaces(): Unused function, remove. 2010-06-02 13:19:40 +03:00
Marko Mäkelä
54e234a2c9 Document Bug #48197 fix 2010-06-01 16:58:02 +03:00
Marko Mäkelä
06a0882d60 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ä
831e6d9355 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ä
0ca5b0f6eb Document the Bug #53812 fix. 2010-06-01 15:05:21 +03:00
Marko Mäkelä
d99be48c2a 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
f5fd8530f6 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
bba92ac8a4 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
063574c379 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
1ecfadf83b Update ChangeLog for bug fix regarding 53582. 2010-05-25 22:38:14 -07:00
Jimmy Yang
0aed1f061e 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
5ae998292c Merge mysql-5.1-innodb from bk-internal into my local tree 2010-05-25 17:21:33 +03:00
Marko Mäkelä
34b126a238 row_search_for_mysql(): Add assertions to track down Bug #53627. 2010-05-25 15:53:52 +03:00
Marko Mäkelä
10b06978fe 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
f27f15987f Merge mysql-5.1-innodb from bk-internal into my local tree 2010-05-25 12:14:57 +03:00
Vasil Dimov
c28e99a5a4 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ä
1a892fa206 Document the Bug #53578 fix. 2010-05-24 14:43:49 +03:00
Marko Mäkelä
b7a2474416 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
ffa35ab37b Merge mysql-5.1-innodb from bk-internal into my local tree 2010-05-20 16:31:57 +03:00