Commit graph

62750 commits

Author SHA1 Message Date
Marko Mäkelä
38d8ca8cec Bug#54358 follow-up: Correct some error handling. 2010-06-30 12:38:47 +03:00
Marko Mäkelä
707a3bef6e Correct some comments that were added in the fix of Bug #54358
(READ UNCOMMITTED access failure of off-page DYNAMIC or COMPRESSED columns).

Records that lack incompletely written externally stored columns may
be accessed by READ UNCOMMITTED transaction even without involving a
crash during an INSERT or UPDATE operation. I verified this as follows.

(1) added a delay after the mini-transaction for writing the clustered
index 'stub' record was committed (patch attached)
(2) started mysqld in gdb, setting breakpoints to the where the
assertions about READ UNCOMMITTED were added in the bug fix
(3) invoked ibtest3 --create-options=key_block_size=2
to create BLOBs in a COMPRESSED table
(4) invoked the following:
yes 'set transaction isolation level read uncommitted;
checksum table blobt3;select sleep(1);'|mysql -uroot test
(5) noted that one of the breakpoints was triggered
(return(NULL) in btr_rec_copy_externally_stored_field())

=== modified file 'storage/innodb_plugin/row/row0ins.c'
--- storage/innodb_plugin/row/row0ins.c	2010-06-30 08:17:25 +0000
+++ storage/innodb_plugin/row/row0ins.c	2010-06-30 08:17:25 +0000
@@ -2120,6 +2120,7 @@ function_exit:
 		rec_t*	rec;
 		ulint*	offsets;
 		mtr_start(&mtr);
+		os_thread_sleep(5000000);
 
 		btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
 					    BTR_MODIFY_TREE, &cursor, 0,

=== modified file 'storage/innodb_plugin/row/row0upd.c'
--- storage/innodb_plugin/row/row0upd.c	2010-06-30 08:11:55 +0000
+++ storage/innodb_plugin/row/row0upd.c	2010-06-30 08:11:55 +0000
@@ -1763,6 +1763,7 @@ row_upd_clust_rec(
 		rec_offs_init(offsets_);
 
 		mtr_start(mtr);
+		os_thread_sleep(5000000);
 
 		ut_a(btr_pcur_restore_position(BTR_MODIFY_TREE, pcur, mtr));
 		rec = btr_cur_get_rec(btr_cur);
2010-06-30 12:31:49 +03:00
Marko Mäkelä
d842130094 ChangeLog entry for Bug #54408 2010-06-29 16:12:19 +03:00
Marko Mäkelä
63c44558dc Bug#54408: txn rollback after recovery: row0umod.c:673
dict_table_get_format(index->table)

The REDUNDANT and COMPACT formats store a local 768-byte prefix of
each externally stored column. No row_ext cache is needed, but we
initialized one nevertheless. When the BLOB pointer was zero, we would
ignore the locally stored prefix as well. This triggered an assertion
failure in row_undo_mod_upd_exist_sec().

row_build(): Allow ext==NULL when a REDUNDANT or COMPACT table
contains externally stored columns.

row_undo_search_clust_to_pcur(), row_upd_store_row(): Invoke
row_build() with ext==NULL on REDUNDANT and COMPACT tables.

rb://382 approved by Jimmy Yang
2010-06-29 16:00:58 +03:00
Marko Mäkelä
4ee0dc7cca ChangeLog entry for Bug #54358 2010-06-29 15:56:53 +03:00
Marko Mäkelä
62084feb55 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
Jimmy Yang
1b31b3a38a Check in fix for bug #53756: "ALTER TABLE ADD PRIMARY KEY affects
crash recovery"

rb://369 approved by Marko
2010-06-28 19:41:37 -07:00
Sunny Bains
7299858763 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
dec092962b Merge a lost changeset inaam.rana@oracle.com-20100624124843-m7ouqwe5zqcqapn1
(no changed files)
2010-06-25 11:10:44 +03:00
Vasil Dimov
2844ae6be9 Merge a lost changeset inaam.rana@oracle.com-20100624124450-2m3mg1238ewvakgx 2010-06-25 11:08:52 +03:00
Vasil Dimov
4cbaa431e1 Merge a lost changeset marko.makela@oracle.com-20100624104820-p4ojmxcmq8qeos6d 2010-06-25 11:06:02 +03:00
Vasil Dimov
fc9e36eadb Merge a lost changeset marko.makela@oracle.com-20100624104620-pklunowaigv7quu9 2010-06-25 11:03:38 +03:00
Vasil Dimov
9346aeb58e Merge a lost changeset jimmy.yang@oracle.com-20100624021010-oh2hnp8e1xbaax6u 2010-06-25 11:02:31 +03:00
Inaam Rana
d105dc8190 merge 2010-06-24 08:48:43 -04:00
Inaam Rana
4cf3e93339 Add ChangeLog for bug#39168 2010-06-24 08:44:50 -04:00
Marko Mäkelä
79f71e1915 Add ChangeLog entry for Bug#54679 2010-06-24 13:48:20 +03:00
Marko Mäkelä
42011fb716 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
08a801e409 Move the fix for bug #54044 to security branch, and revert commit -r3520:3521. 2010-06-23 19:10:10 -07:00
Jimmy Yang
95586f2c83 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
Jimmy Yang
1ac84a45df Fix bug #54044, Create temporary tables and using innodb crashes. Screen
out NULL type columns, and return without creating the table.

rb://378 approved by Marko
2010-06-22 19:04:31 -07:00
Vasil Dimov
d17ee9f8ec Merge mysql-5.1-innodb from bk-internal to my local tree 2010-06-22 20:12:05 +03:00
Vasil Dimov
e42ab1af8d Add ChangeLog entry for the fix of Bug#47991 2010-06-22 20:04:54 +03:00
Vasil Dimov
ba04d53826 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ä
31939e0d14 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ä
a1ac083fc3 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ä
a6c1d93e02 Bug#54658: Add ChangeLog entry 2010-06-21 12:51:48 +03:00
Marko Mäkelä
aebf6c06c4 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
c66ce15fe3 Merge mysql-5.1-innodb from bk-internal to my local repo 2010-06-18 11:51:55 +03:00
Vasil Dimov
40c13ca9bd 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
4d446d4c10 Check in fix for Bug #52814 InnoDB: Use the new ha_data interfaces
rb://290, approved by Sunny
2010-06-17 22:38:22 -07:00
Jimmy Yang
69bc6dd01c Fix an overly asserted assertion during previous checkin for bug #54330. 2010-06-17 10:33:03 -07:00
Jimmy Yang
3c0be2c7b3 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
8e7ce2e9d8 Add checkin description for bug #47622 to ChangeLog. 2010-06-15 02:33:26 -07:00
Vasil Dimov
3170aa677d Adjust suite/innodb/r/innodb_mysql.result after the merge 2010-06-14 13:35:15 +03:00
Vasil Dimov
6996ef1380 Merge mysql-5.1 -> mysql-5.1-innodb
(innodb_mysql.result needs to be adjusted after this commit)
2010-06-14 12:43:02 +03:00
Inaam Rana
0e5eb364a2 merge from parent 2010-06-10 10:35:39 -04:00
Inaam Rana
e7c672cbd9 Add a debug assertion. 2010-06-10 10:31:28 -04:00
Inaam Rana
e40c3b9763 Formatting changes 2010-06-10 09:58:11 -04:00
Marko Mäkelä
50d0cd7248 Bug #38999: Re-enable innodb_multi_update.test 2010-06-10 15:56:23 +03:00
Sergey Glukhov
022e2ef800 Bug#38999 valgrind warnings for update statement in function compare_record()
(InnoDB plugin branch)

mysql-test/suite/innodb_plugin/r/innodb_mysql.result:
  test case
mysql-test/suite/innodb_plugin/t/innodb_mysql.test:
  test case
storage/innodb_plugin/row/row0sel.c:
  init null bytes with default values as they might be
  left uninitialized in some cases and these uninited bytes
  might be copied into mysql record buffer that leads to
  valgrind warnings on next use of the buffer.
2010-06-09 16:17:18 +04:00
Sergey Glukhov
60a66c451a Bug#38999 valgrind warnings for update statement in function compare_record()
Valgrind warning happpens because of uninitialized null bytes.
In row_sel_push_cache_row_for_mysql() function we fill fetch cache
with necessary field values, row_sel_store_mysql_rec() is called
for this and leaves null bytes untouched.
Later row_sel_pop_cached_row_for_mysql() rewrites table record
buffer with uninited null bytes. We can see the problem from the
test case:
At 'SELECT...' we call row_sel_push...->row_sel_store...->row_sel_pop_cached...
chain which rewrites table->record[0] buffer with uninitialized null bytes.
When we call 'UPDATE...' statement, compare_record uses this buffer and
valgrind warning occurs.
The fix is to init null bytes with default values.


mysql-test/suite/innodb/r/innodb_mysql.result:
  test case
mysql-test/suite/innodb/t/innodb_mysql.test:
  test case
mysql-test/t/ps_3innodb.test:
  enable valgrind testing
storage/innobase/row/row0sel.c:
  init null bytes with default values as they might be
  left uninitialized in some cases and these uninited bytes
  might be copied into mysql record buffer that leads to
  valgrind warnings on next use of the buffer.
2010-06-09 16:07:34 +04:00
Inaam Rana
28187edf33 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ä
76a7cda35c Document Bug#54009 in the InnoDB Plugin ChangeLog. 2010-06-08 15:12:15 +03:00
Marko Mäkelä
627c14d9e8 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ä
55acf60c93 buf_page_get_gen(): Pass file,line to rw_lock_x_lock(). 2010-06-08 14:40:55 +03:00
unknown
5bc84421f2 Raise version number after cloning 5.1.48 2010-06-03 16:03:17 +02:00
Jimmy Yang
d80f8c07d6 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ä
60845867e3 Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
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