Commit graph

410 commits

Author SHA1 Message Date
Marko Makela
bda9e4570b Merge Bug #57345, Bug #56982, Bug#53307 test from mysql-5.1-innodb 2010-10-11 21:28:51 +02:00
Jimmy Yang
820e1bc6f4 A more complete fix for bug #57345 btr_pcur_store_position abort for load
with concurrent lock/unlock tables

Approved by Marko
2010-10-11 05:36:13 -07:00
Marko Mäkelä
df29195345 Bug #56947 InnoDB leaks memory when failing to create a table
No mysql-test case. Tested by creating a table, removing a *.frm file and
attempting to create the table again. Code coverage tested by
instrumentation. Tested with Valgrind.
2010-10-11 11:01:47 +03:00
Jimmy Yang
cf2c8701b4 Fix Bug #57255 Cascade Delete results in "Got error -1 from storage engine".
rb://477 approved by Marko
2010-10-06 03:41:26 -07:00
Georgi Kodinov
292a72a043 merged mysql-5.1 into mysql-5.1-bugteam 2010-10-05 11:11:56 +03:00
Marko Mäkelä
678bc90ed8 Bug#56716 InnoDB locks a record gap without locking the table
row_search_for_mysql(): Acquire an intention lock on the table
before locking the first record gap.
2010-10-04 13:05:21 +03:00
Vasil Dimov
eaaea8eb7d Fix Bug#56340 innodb updates index stats too frequently after non-index updates
This is a simple optimization issue. All stats are related to only indexed
columns, index size or number of rows in the whole table. UPDATEs that touch
only non-indexed columns cannot affect stats and we can avoid calling the
function row_update_statistics_if_needed() which may result in unnecessary I/O.

Approved by:	Marko (rb://466)
2010-09-30 15:48:44 +03:00
Vasil Dimov
05a0ad8dcb (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
handler/ha_innodb.cc: In function 'bool innodb_show_status(handlerton*, THD*, bool (*)(THD*, const char*, uint, const char*, uint, const char*, uint))':
handler/ha_innodb.cc:7539:7: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
2010-09-14 18:25:41 +03:00
Vasil Dimov
de12861681 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
handler/ha_innodb.cc: In function 'void innobase_drop_database(handlerton*, char*)':
handler/ha_innodb.cc:5969:6: error: variable 'error' set but not used [-Werror=unused-but-set-variable]
2010-09-14 18:22:30 +03:00
Vasil Dimov
bed81fec77 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0undo.c: In function 'trx_undo_set_state_at_prepare':
trx/trx0undo.c:1798:16: error: variable 'page_hdr' set but not used [-Werror=unused-but-set-variable]
2010-09-14 17:55:44 +03:00
Vasil Dimov
33c7ab2b98 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0undo.c: In function 'trx_undo_truncate_end':
trx/trx0undo.c:1015:14: error: variable 'rseg' set but not used [-Werror=unused-but-set-variable]
2010-09-14 17:53:49 +03:00
Vasil Dimov
e3de88c3f8 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0trx.c: In function 'trx_prepare_off_kernel':
trx/trx0trx.c:1830:11: error: variable 'update_hdr_page' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:30:26 +03:00
Vasil Dimov
9d74ab6033 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0sys.c: In function 'trx_sys_create_doublewrite_buf':
trx/trx0sys.c:168:10: error: variable 'new_page' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:28:48 +03:00
Vasil Dimov
d1b9cca52c (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warnings:
trx/trx0roll.c: In function 'trx_undo_arr_remove_info':
trx/trx0roll.c:717:9: error: variable 'n' set but not used [-Werror=unused-but-set-variable]
trx/trx0roll.c:716:9: error: variable 'n_used' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:21:32 +03:00
Vasil Dimov
94ce8492b6 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0purge.c: In function 'trx_purge_rec_release':
trx/trx0purge.c:1007:18: error: variable 'arr' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:19:04 +03:00
Vasil Dimov
00686b4e11 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0purge.c: In function 'trx_purge_rseg_get_next_history_log':
trx/trx0purge.c:599:15: error: variable 'seg_hdr' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:17:48 +03:00
Vasil Dimov
3d4dcf266f (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0purge.c: In function 'trx_purge_add_update_undo_to_history':
trx/trx0purge.c:254:16: error: variable 'page_header' set but not used [-Werror=unused-but-set-variable]
trx/trx0purge.c:252:15: error: variable 'seg_header' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:04:03 +03:00
Vasil Dimov
00c6e219c6 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
row/row0vers.c: In function 'row_vers_impl_x_locked_off_kernel':
row/row0vers.c:62:9: error: variable 'err' set but not used [-Werror=unused-but-set-variable]
2010-09-14 14:50:13 +03:00
Vasil Dimov
c283946dd6 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
row/row0upd.c: In function 'row_upd_in_place_in_select':
row/row0upd.c:2040:9: error: variable 'err' set but not used [-Werror=unused-but-set-variable]
2010-09-14 14:46:13 +03:00
Vasil Dimov
67c388410b (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
row/row0umod.c: In function 'row_undo_mod_clust_low':
row/row0umod.c:92:9: error: variable 'success' set but not used [-Werror=unused-but-set-variable]
2010-09-14 14:09:36 +03:00
Vasil Dimov
1bdcd70fad (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
row/row0purge.c: In function 'row_purge_step':
row/row0purge.c:660:9: error: variable 'err' set but not used [-Werror=unused-but-set-variable]

(row_purge() always returns DB_SUCCESS)
2010-09-14 13:56:29 +03:00
Vasil Dimov
a82e39e728 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
que/que0que.c: In function 'que_thr_dec_refer_count':
que/que0que.c:805:11: error: variable 'sess' set but not used [-Werror=unused-but-set-variable]
2010-09-14 13:39:52 +03:00
Vasil Dimov
d4bd5e0089 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
que/que0que.c: In function 'que_run_threads_low':
que/que0que.c:1295:9: error: variable 'cumul_resource' set but not used [-Werror=unused-but-set-variable]
2010-09-14 13:38:21 +03:00
Vasil Dimov
5e4febf4f3 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warnings:
os/os0file.c: In function 'os_file_create':
os/os0file.c:1318:14: error: variable 'purpose_str' set but not used [-Werror=unused-but-set-variable]
os/os0file.c:1317:14: error: variable 'type_str' set but not used [-Werror=unused-but-set-variable]
2010-09-14 13:01:25 +03:00
Vasil Dimov
1813340bd6 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
log/log0recv.c: In function 'recv_synchronize_groups':
log/log0recv.c:403:10: error: variable 'limit_lsn' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:46:23 +03:00
Vasil Dimov
27c84cf762 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
log/log0recv.c: In function 'recv_recovery_from_checkpoint_start':
log/log0recv.c:2509:10: error: variable 'archived_lsn' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:41:00 +03:00
Vasil Dimov
8e942b3265 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
lock/lock0lock.c: In function 'lock_print_info_all_transactions':
lock/lock0lock.c:4299:10: error: variable 'page' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:37:03 +03:00
Vasil Dimov
e63ef8a33f Remove redundant variable 2010-09-14 12:11:00 +03:00
Vasil Dimov
f0634f15ae (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
eval/eval0eval.c: In function 'eval_notfound':
eval/eval0eval.c:371:14: error: variable 'arg2' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:06:47 +03:00
Vasil Dimov
87d4bae87e (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
buf/buf0flu.c: In function 'buf_flush_batch':
buf/buf0flu.c:844:9: error: variable 'old_page_count' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:00:58 +03:00
Vasil Dimov
91918245ec (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warnings:
btr/btr0sea.c: In function 'btr_search_update_hash_on_delete':
btr/btr0sea.c:1404:9: error: variable 'found' set but not used [-Werror=unused-but-set-variable]
2010-09-14 11:39:34 +03:00
Vasil Dimov
38eba5da0d (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warnings:
btr/btr0pcur.c: In function 'btr_pcur_move_backward_from_page':
btr/btr0pcur.c:432:8: error: variable 'space' set but not used [-Werror=unused-but-set-variable]
2010-09-14 11:38:59 +03:00
Vasil Dimov
8d5eb632b3 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warnings:
btr/btr0cur.c: In function 'btr_store_big_rec_extern_fields':
btr/btr0cur.c:3368:10: error: variable 'rec_page' set but not used [-Werror=unused-but-set-variable]
btr/btr0cur.c: In function 'btr_free_externally_stored_field':
btr/btr0cur.c:3542:8: error: variable 'offset' set but not used [-Werror=unused-but-set-variable]
btr/btr0cur.c:3539:10: error: variable 'rec_page' set but not used [-Werror=unused-but-set-variable]
2010-09-14 11:37:21 +03:00
Vasil Dimov
806e6d0387 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:

btr/btr0btr.c:2063:9: error: variable 'level' set but not used [-Werror=unused-but-set-variable]
2010-09-13 16:39:40 +03:00
Vasil Dimov
cf481a46d7 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:

storage/innobase/include/ut0rnd.ic:70:8: error: variable 'n_bits' set but not used [-Werror=unused-but-set-variable]
2010-09-13 16:33:25 +03:00
Jimmy Yang
9b3a3944e4 Merge from mysql-5.1-bugteam to mysql-5.1-security 2010-09-01 17:43:02 -07:00
Jimmy Yang
224261eec5 This is to resolve a hang situation in 5.1 builtin raised by
bug #49251 (deadlock/crash with concurrent truncate table and index
statistics calculation) by backporting a solution from #54678 fixed
for 5.1 plugin and 5.5.
2010-08-24 20:42:33 -07:00
Marko Mäkelä
634af8f446 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-23 13:28:54 +03:00
Sunny Bains
81da9b3d72 Fix Bug #54538 - use of exclusive innodb dictionary lock limits performance.
This patch doesn't get rid of the need to acquire the dict_sys->mutex but
reduces the need to keep the mutex locked for the duration of the query
to fsp_get_available_space_in_free_extents() from ha_innobase::info().

rb://390.
2010-08-20 17:49:43 +10:00
Sunny Bains
3daf6d3d73 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
Jimmy Yang
531c0eee52 Address bug #55465 ERROR 1280 (42000): Incorrect index name '<index name>',
adding a couple FK related messages.

rb://409 approved by Sunny Bains
2010-08-06 02:49:22 -07:00
Sunny Bains
09eb23d50b 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
Jimmy Yang
04970a2ff1 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
190ec75c35 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
c110066bda Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-07-29 11:51:00 +03:00
Vasil Dimov
f43c9eff23 Merge mysql-5.1 -> mysql-5.1-innodb 2010-07-23 12:51:14 +03:00
Davi Arnaut
dfaf73a987 Merge of mysql-5.1 into mysql-5.1-bugteam. 2010-07-19 15:34:28 -03:00
Vasil Dimov
f219357a09 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
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