Commit graph

334 commits

Author SHA1 Message Date
Jimmy Yang
edbae904ff Merge from mysql-5.1-bugteam to mysql-5.1-security 2010-09-01 17:43:02 -07:00
Vasil Dimov
72ec16b1d1 Increment InnoDB Plugin version to 1.0.12.
InnoDB Plugin 1.0.11 has been released with MySQL 5.1.50.
2010-08-26 18:06:07 +03:00
Marko Mäkelä
ce7d6a288c Bug#55832: selects crash too easily when innodb_force_recovery>3
dict_update_statistics_low(): Create bogus statistics for those
indexes that cannot be accessed because of the innodb_force_recovery
setting.

ha_innobase::info(): Calculate statistics for each index, even if
innodb_force_recovery is set. Fill in bogus data for those indexes
that are not accessed because of the innodb_force_recovery setting.
2010-08-24 11:10:03 +03:00
Sunny Bains
eff4a5d202 Fix Bug #55027: assertion: mutex_own(&dict_sys->mutex) in dict_table_get_on_id()
The callers should indicate that the dictionary is locked or not using
the trx->dict_operation_lock_mode == RW_X_LATCH mode. Checking explicitly
for system tables is unnecessary.

Approved by Marko on IRC.
2010-08-20 12:57:04 +10:00
Sunny Bains
73c92b1408 Fix bug#55699 - Assertion failure in innodb plugin with large number of threads
Fix a debug assertion that was missed in svnrev:2380 (fix for Bug# 35352).

Approved by Marko on IRC
2010-08-20 12:55:52 +10:00
Marko Mäkelä
d3a7ef9913 Bug#55626: MIN and MAX reading a delete-marked record from secondary index
Remove a bogus debug assertion that triggered the bug.
Add assertions precisely where records must not be delete-marked.
And a comment to clarify when the record is allowed to be delete-marked.
2010-08-18 14:01:10 +03:00
Inaam Rana
372999ed01 Backport of revno 3148 mysql-innodb-trunk
Currently we do a full validation of AHI whenever check tables is
  called on any table. This patch fixes this by only doing this full
  check in debug versions.
  
  bug#55716
  rb://423
  approved by: Marko
2010-08-05 11:34:44 -04:00
Sunny Bains
6c0f9301ea Fix Bug #55277 - Failing assertion: auto_inc > 0
Handle overflow when reading value from SELECT MAX(C) FROM T;

Call ha_innobase::info() after initializing the autoinc value
in ha_innobase::open().

Fix for both the builtin and plugin.

rb://402
2010-08-05 19:24:34 +10:00
Sunny Bains
e19a494287 Fix bug# 55543 - InnoDB Plugin: Signal 6: Assertion failure in file fil/fil0fil.c line 4306
The bug is due to a double delete of a BLOB, once via:

    rollback -> btr_cur_pessimistic_delete()

and the second time via purge.

The bug is in row_upd_clust_rec_by_insert(). There we relinquish ownership
of the non-updated BLOB columns in btr_cur_mark_extern_inherited_fields()
before building the row entry that will be inserted and whose contents will
be logged in the UNDO log. However, we don't set the BLOB column later to
INHERITED so that a possible rollback will not free the original row's
non-updated BLOB entries. This is because the condition that checks for
that is in :

	if (node->upd_ext) {}.

node->upd_ext is non-NULL only if a BLOB column was updated and that column
is part of some key ordering (see row_upd_replace()). This results in the
non-update BLOB columns being deleted during a rollback and subsequently by
purge again.

rb://413
2010-08-05 19:18:17 +10:00
Jimmy Yang
f4e68824c8 Fix bug #54678, InnoDB, TRUNCATE, ALTER, I_S SELECT, crash or deadlock
rb://399 approved by Sunny Bains
2010-08-04 03:37:44 -07:00
Jimmy Yang
6fce5c4c77 Fix Bug #54582 stack overflow when opening many tables linked with
foreign keys at once

rb://391 approved by Heikki
Z
2010-08-04 03:11:33 -07:00
Jimmy Yang
e79a7e1b93 Backport "NULL pointer check for ut_free()" from mysql-trunk-innodb to
mysql-5.1-innodb plugin to fix bug #55627 segv in ut_free pars_lexer_close
innobase_shutdown innodb-use-sys-malloc=0.
2010-08-03 20:20:55 -07:00
Jimmy Yang
f4b088972a Fix Bug #55382 Assignment with SELECT expressions takes unexpected S locks
in READ COMMITTED

rb://410 Approved by Sunny Bains
2010-08-01 22:25:57 -07:00
Vasil Dimov
a95441c03a Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-07-29 11:51:00 +03:00
Jimmy Yang
8d28ec7c77 Fix bug #55581 by backporting fix of #52546 from mysql-trunk-innodb
to mysql-5.1-innodb plugin.
2010-07-28 03:20:44 -07:00
Vasil Dimov
6af3c0f947 Increment InnoDB Plugin version to 1.0.11.
InnoDB Plugin 1.0.10 has been released with MySQL 5.1.49.
2010-07-23 19:32:38 +03:00
Vasil Dimov
10870186e5 Merge mysql-5.1 -> mysql-5.1-innodb 2010-07-23 12:51:14 +03:00
Davi Arnaut
13f856f57b Merge of mysql-5.1 into mysql-5.1-bugteam. 2010-07-19 15:34:28 -03:00
karen.langford@oracle.com
8349522bde Fix bug #55039 Failing assertion: space_id > 0 in fil0fil.c. 2010-07-09 14:23:48 +02:00
Vasil Dimov
0b0c18a09c Merge mysql-5.1-innodb -> mysql-5.1-security
Merge up to sunny.bains@oracle.com-20100625081841-ppulnkjk1qlazh82 .
There are 8 more changesets in mysql-5.1-innodb, but PB2 shows a
failure for a test added in one of them. If that is resolved quickly
then those 8 more changesets will be merged too.
2010-07-04 10:12:44 +03:00
Jimmy Yang
0d32867763 Port fix for bug #54311 from mysql-trunk-innodb to mysql-5.1-innodb codeline.
Bug #54311: Crash on CHECK PARTITION after concurrent LOAD DATA
and adaptive_hash_index=OFF
2010-06-30 22:06:01 -07:00
Marko Mäkelä
81d3dadb54 Bug#54358 follow-up: Correct some error handling. 2010-06-30 12:38:47 +03:00
Marko Mäkelä
5754382c31 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ä
5a25f40815 ChangeLog entry for Bug #54408 2010-06-29 16:12:19 +03:00
Marko Mäkelä
c8e48de261 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ä
c43070dabe ChangeLog entry for Bug #54358 2010-06-29 15:56:53 +03:00
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
c7afb80fe0 Fix Bug #54044 Create temporary tables and using innodb crashes. 2010-06-24 01:20:25 -07: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
Davi Arnaut
4f59204b49 Bug#53445: Build with -Wall and fix warnings that it generates
Introduce a MySQL maintainer/developer mode that enables
a set of warning options for the C/C++ compiler. This mode
is intended to help improve the overall quality of the code.

The warning options are:

C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror"
CXX_WARNINGS="$C_WARNINGS -Wno-unused-parameter"

Since -Wall is essentially a moving target, autoconf checks
are not run with warning options enabled, in particualr -Werror.
This decision might be revisited in the future. The patch also
fixes a mistake in the makefiles, where automake CXXFLAGS would
be set to CFLAGS.
2010-07-09 08:37:51 -03: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