Commit graph

4407 commits

Author SHA1 Message Date
Jimmy Yang
bc4c38ac43 Temporarily backout the Information Schema System Table Information Schema
interface related change, will put back in once gain approval.
2010-09-16 19:24:32 -07:00
Jon Olav Hauglid
a51a4b104c Merge from mysql-5.5-bugfixing to mysql-5.5-runtime. 2010-09-16 16:16:29 +02:00
Marc Alff
623863fdc7 Bug#56761 Segfault on CHECKSUM TABLE performance_schema.EVENTS_WAITS_HISTORY EXTENDED
Before this fix, the server could crash inside a memcpy when reading data
from the EVENTS_WAITS_CURRENT / HISTORY / HISTORY_LONG  tables.

The root cause is that the length used in a memcpy could be corrupted,
when another thread writes data in the wait record being read.
Reading unsafe data is ok, per design choice, and the code does sanitize
the data in general, but did not sanitize the length given to memcpy.

The fix is to also sanitize the schema name / object name / file name
length when extracting the data to produce a row.
2010-09-15 12:20:48 -06:00
Vasil Dimov
844a8098aa Fix typo, should be UNIV_SYNC_DEBUG. 2010-09-15 19:58:36 +03:00
Vasil Dimov
da98776bfb (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:1069:14: error: variable 'rseg' set but not used [-Werror=unused-but-set-variable]
2010-09-15 19:50:05 +03:00
Vasil Dimov
e4996035b2 (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:1871:16: error: variable 'page_hdr' set but not used [-Werror=unused-but-set-variable]
2010-09-15 19:49:25 +03:00
Vasil Dimov
7e2a00b27e (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:1808:11: error: variable 'update_hdr_page' set but not used [-Werror=unused-but-set-variable]
2010-09-15 19:48:37 +03:00
Vasil Dimov
c8a205c68b (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:244:15: error: variable 'new_block' set but not used [-Werror=unused-but-set-variable]
2010-09-15 19:47:35 +03:00
Vasil Dimov
8968ca7f00 (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:744:9: error: variable 'n' set but not used [-Werror=unused-but-set-variable]
trx/trx0roll.c:743:9: error: variable 'n_used' set but not used [-Werror=unused-but-set-variable]
2010-09-15 19:06:31 +03:00
Vasil Dimov
7cfe9f4fbd (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:1071:18: error: variable 'arr' set but not used [-Werror=unused-but-set-variable]
2010-09-15 19:05:35 +03:00
Vasil Dimov
7d39b69f59 (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:660:15: error: variable 'seg_hdr' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:47:14 +03:00
Vasil Dimov
db656f084c (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:307:15: error: variable 'seg_header' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:45:57 +03:00
Vasil Dimov
85df29122d (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:309:16: error: variable 'page_header' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:44:55 +03:00
Vasil Dimov
6c0ad7212b (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:74:9: error: variable 'err' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:43:07 +03:00
Vasil Dimov
92c05f1b51 (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:117:9: error: variable 'success' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:41:35 +03:00
Vasil Dimov
8d543ffa0b (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:687:9: error: variable 'err' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:37:24 +03:00
Vasil Dimov
dac4573273 (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:1287:9: error: variable 'cumul_resource' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:35:59 +03:00
Vasil Dimov
fa1b367bcf (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:1371:14: error: variable 'purpose_str' set but not used [-Werror=unused-but-set-variable]
os/os0file.c:1370:14: error: variable 'type_str' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:35:11 +03:00
Vasil Dimov
88c37655fb (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:562:14: error: variable 'limit_lsn' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:32:12 +03:00
Vasil Dimov
ad6165a9d4 (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_func':
log/log0recv.c:2894:14: error: variable 'archived_lsn' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:31:16 +03:00
Vasil Dimov
a51ef6f673 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
handler/i_s.cc: In function 'int trx_i_s_common_fill_table(THD*, TABLE_LIST*, COND*)':
handler/i_s.cc:931:8: error: variable 'ret' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:25:24 +03:00
Vasil Dimov
7d0b8b5e5f (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:7010:6: error: variable 'error' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:10:10 +03:00
Vasil Dimov
7ed6878c6d (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:8851:7: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:06:46 +03:00
Vasil Dimov
ab5570d561 Remove redundant variable 2010-09-15 18:03:24 +03:00
Vasil Dimov
d8cd874f79 (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:388:14: error: variable 'arg2' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:02:26 +03:00
Vasil Dimov
40ae790ba1 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
dict/dict0dict.c: In function 'dict_index_print_low':
dict/dict0dict.c:4444:14: error: variable 'type_string' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:00:49 +03:00
Vasil Dimov
50dd924d7d (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
dict/dict0crea.c: In function 'dict_create_index_tree_step':
dict/dict0crea.c:630:16: error: variable 'table' set but not used [-Werror=unused-but-set-variable]
2010-09-15 11:33:49 +03:00
Vasil Dimov
fb4623f0a7 (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:1274:9: error: variable 'old_page_count' set but not used [-Werror=unused-but-set-variable]
2010-09-15 11:30:57 +03:00
Vasil Dimov
40140c00b9 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
buf/buf0flu.c: In function 'buf_flush_delete_from_flush_rbt':
buf/buf0flu.c:131:8: error: variable 'ret' set but not used [-Werror=unused-but-set-variable]
2010-09-15 11:29:51 +03:00
Vasil Dimov
bcde57a3bd (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
btr/btr0sea.c: In function 'btr_search_update_hash_on_delete':
btr/btr0sea.c:1498:9: error: variable 'found' set but not used [-Werror=unused-but-set-variable]
2010-09-14 21:36:29 +03:00
Vasil Dimov
8e3c62cc57 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
btr/btr0pcur.c: In function 'btr_pcur_move_backward_from_page':
btr/btr0pcur.c:455:9: error: variable 'space' set but not used [-Werror=unused-but-set-variable]
2010-09-14 21:35:37 +03:00
Vasil Dimov
07cded6187 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
btr/btr0cur.c: In function 'btr_free_externally_stored_field':
btr/btr0cur.c:4281:16: error: variable 'rec_block' set but not used [-Werror=unused-but-set-variable]
2010-09-14 21:33:02 +03:00
Vasil Dimov
57e860c6a1 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
btr/btr0cur.c: In function 'btr_cur_optimistic_update':
btr/btr0cur.c:1839:10: error: variable 'orig_rec' set but not used [-Werror=unused-but-set-variable]
2010-09-14 21:30:37 +03:00
Vasil Dimov
67a1603c93 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
btr/btr0btr.c: In function 'btr_compress':
btr/btr0btr.c:2564:9: error: variable 'level' set but not used [-Werror=unused-but-set-variable]
2010-09-14 21:14:42 +03:00
Vasil Dimov
424ec78a46 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
btr/btr0btr.c: In function 'btr_page_split_and_insert':
btr/btr0btr.c:1898:11: error: variable 'insert_page' set but not used [-Werror=unused-but-set-variable]
2010-09-14 21:12:19 +03:00
Vasil Dimov
33d9825d0c (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
./include/ut0rnd.ic: In function 'ut_rnd_gen_ulint':
./include/ut0rnd.ic:88:8: error: variable 'n_bits' set but not used [-Werror=unused-but-set-variable]
2010-09-14 20:58:02 +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
Joerg Bruehe
c15b344a9d Selective transfer of a bugfix patch into 5.5.6-rc.
The first part is the functional change,
the second is needed as a compile fix on Windows
(header file order).

| committer: Marc Alff <marc.alff@oracle.com>
| branch nick: mysql-5.5-bugfixing-56521
| timestamp: Thu 2010-09-09 14:28:47 -0600
| message:
|   Bug#56521 Assertion failed: (m_state == 2), function allocated_to_free, pfs_lock.h (138)
|
|   Before this fix, it was possible to build the server:
|   - with the performance schema
|   - with a dummy implementation of my_atomic (MY_ATOMIC_MODE_DUMMY).
|
|   In this case, the resulting binary will just crash,
|   as this configuration is not supported.
|
|   This fix enforces that the build will fail with a compilation error in this
|   configuration, instead of resulting in a broken binary.

| committer: Tor Didriksen <tor.didriksen@oracle.com>
| branch nick: 5.5-bugfixing-56521
| timestamp: Fri 2010-09-10 11:10:38 +0200
| message:
|   Header files should be self-contained
2010-09-13 12:14:48 +02:00
Vasil Dimov
f7d5e1d807 Whitespace fixup on ha_innodb.cc:9561 2010-09-10 12:52:14 +03:00
Vasil Dimov
838b4c6f38 Whitespace fixup on ha_innodb.cc:2567 2010-09-10 12:32:21 +03:00
Tor Didriksen
73384c99c0 Header files should be self-contained 2010-09-10 11:10:38 +02:00
Marc Alff
f943a12055 Bug#56521 Assertion failed: (m_state == 2), function allocated_to_free, pfs_lock.h (138)
Before this fix, it was possible to build the server:
- with the performance schema
- with a dummy implementation of my_atomic (MY_ATOMIC_MODE_DUMMY).

In this case, the resulting binary will just crash,
as this configuration is not supported.

This fix enforces that the build will fail with a compilation error in this
configuration, instead of resulting in a broken binary.
2010-09-09 14:28:47 -06:00
Marko Mäkelä
c07a0aeff4 Merge Vasil Dimov 2010-09-09 Enable UNIV_DEBUG when WITH_DEBUG is defined 2010-09-09 15:14:05 +03:00
Marko Mäkelä
3578a30fc4 Remove ut0auxconf.h.
It was needed when InnoDB Plugin was distributed independently of MySQL.
Approved by Vasil Dimov.
2010-09-09 14:27:52 +03:00
Marko Mäkelä
07ebf63261 Invoke make with -j$(nproc) for better parallelism. 2010-09-09 13:50:06 +03:00
Marko Mäkelä
987702f290 ibuf_insert_to_index_page(): Remove bogus code added for delete buffering.
In early development of delete buffering, we did allow B-tree pages
to become empty as a result of buffered deletes. That caused fundamental
problems. The fix was to refuse buffering purge operations unless
the page can be guaranteed to be nonempty. Remove an attempt to
cope with empty pages when merging inserts.
2010-09-09 13:48:00 +03:00
Marko Mäkelä
c42d0a143a Remove unused constant REC_INFO_BITS.
This was replaced with REC_OLD_INFO_BITS in MySQL 5.0.3.
2010-09-09 13:44:04 +03:00
Vasil Dimov
c9d8e8209a Enable UNIV_DEBUG when WITH_DEBUG is defined 2010-09-09 13:06:43 +03:00
Vasil Dimov
245a142d26 Merge mysql-5.5-bugfixing -> mysql-5.5-innodb 2010-09-09 12:30:05 +03:00
Jon Olav Hauglid
51a81b6faf Bug #56292 Deadlock with ALTER TABLE and MERGE tables
ALTER TABLE on a MERGE table could cause a deadlock with two
other connections if we reached a situation where:

1) A connection doing ALTER TABLE can't upgrade to MDL_EXCLUSIVE on the
parent table, but holds TL_READ_NO_INSERT on the child tables.
2) A connection doing DELETE on a child table can't get TL_WRITE on it
since ALTER TABLE holds TL_READ_NO_INSERT.
3) A connection doing SELECT on the parent table can't get TL_READ on 
the child tables since TL_WRITE is ahead in the lock queue, but holds
MDL_SHARED_READ on the parent table preventing ALTER TABLE from upgrading.

For regular tables, this deadlock is avoided by having ALTER TABLE
take a MDL_SHARED_NO_WRITE metadata lock on the table. This prevents
DELETE from acquiring MDL_SHARED_WRITE on the table before ALTER TABLE
tries to upgrade to MDL_EXCLUSIVE. In the example above, SELECT would
therefore not be blocked by the pending DELETE as DELETE would not be
able to enter TL_WRITE in the table lock queue.

This patch fixes the problem for merge tables by using the same metadata
lock type for child tables as for the parent table. The child tables will
in this case therefore be locked with MDL_SHARED_NO_WRITE, preventing
DELETE from acquiring a metadata lock and enter into the table lock queue.

Change in behavior: By taking the same metadata lock for child tables
as for the parent table, LOCK TABLE on the parent table will now also
implicitly lock the child tables. Since LOCK TABLE on the parent table
now takes more than one metadata lock, it is possible for LOCK TABLE
... WRITE on the parent table or child tables to give ER_LOCK_DEADLOCK
error.

Test case added to mdl_sync.test.
Merge.test/.result has been updated to reflect the change to LOCK TABLE.
2010-09-08 10:25:37 +02:00
Vasil Dimov
da437a06d6 Fix Bug#56384 Remove two COPYING files from innobase directory
Remove non applicable licensing files

storage/innobase/COPYING is in the MySQL top level directory and
storage/innobase/COPYING.Sun_Microsystems is not applicable anymore
now that Oracle and Sun are one company.
2010-09-07 21:09:50 +03:00
Jimmy Yang
7f36cd6cdd Port fix for bug #53756 from 5.1 built-in to 5.1 plugin. 2010-09-06 22:41:37 -07:00
Georgi Kodinov
083a647e6a merge from 5.5-merge 2010-09-02 16:57:59 +03:00
Jimmy Yang
9b3a3944e4 Merge from mysql-5.1-bugteam to mysql-5.1-security 2010-09-01 17:43:02 -07:00
Alexander Nozdrin
f0fe6e4dac Auto-merge from mysql-5.5-merge. 2010-08-30 18:07:40 +04:00
Marc Alff
a5aad2e7dc local merge 2010-08-27 15:23:37 -06:00
Christopher Powers
7e0cc48ed6 Bug# 53874 "SETUP_INSTRUMENTS.TIMED='NO' should not change TIMER_WAIT
Handle combined instrument states of ENABLED and/or TIMED:

ENABLED TIMED
1 1 Aggregate stats, increment counter
1 0 Increment counter
0 1 Do nothing
0 0 Do nothing 

storage/perfschema/pfs.cc:
  Aggregate stats only if state is both ENABLED and TIMED. If ENABLED
  but not TIMED, only increment the value counter.
storage/perfschema/pfs_stat.h:
  Split aggregate and counter increment into separate
  methods for performance.
2010-08-26 10:45:25 -05:00
Vasil Dimov
6b246aaf8d 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
Alexander Barkov
22d6e099c1 Bug#42511 mysqld: ctype-ucs2.c:2044: my_strnncollsp_utf32: Assertion (tlen % 4) == 0' fai
Problem: trailing spaces were stripped using 8-bit code,
so the truncation result length was incorrect, which led
to an assertion failure.
Fix: using multi-byte safe code.
2010-08-26 16:36:33 +04:00
Jimmy Yang
bfcc8ae8d9 Add a space indentation to InnoDB buffer pool size and log sequence
number boot up message.
2010-08-25 00:25:46 -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
Marc Alff
19e67ad27c Bug#55576 Two perfschema tests failed on mysql-next-mr-innodb PB2 tests
Before this fix, some tests failed due to lack of instrumentation slots
in the performance schema, because the default sizing was too low.

Now that more code has been instrumented, the default sizing has to be adjusted
to match the current instrumentation consumption.

This change:
- increases the number of rwlock classes from 20 to 30,
- increases the number of rwlock and mutex instances to 1 million.
Both are to account for the volume of data instrumented
when the innodb storage engine is used (because of the innodb buffer pool).

Adjusted the test output accordingly.
2010-08-24 18:21:43 -06:00
Marko Mäkelä
938ce0efd7 Merge Bug#55832 fix from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3550
revision-id: marko.makela@oracle.com-20100824081003-v4ecy0tga99cpxw2
parent: marko.makela@oracle.com-20100823102854-t1clrojqis2ley36
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Tue 2010-08-24 11:10:03 +0300
message:
  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:34:19 +03:00
Marko Mäkelä
fed2531f02 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
Mats Kindahl
b7ed981f37 Merging with mysql-5.5 2010-08-23 15:32:39 +02: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
Inaam Rana
398f3ebbed When flushing from LRU we try to keep a certain number of pages over
and above the general requirement free. We call them
BUF_FLUSH_EXTRA_MARGIN. With multiple buffer pools we may end up keeping
this amount of pages for each buffer pool. This patch, diagnosed and fixed
by Michael, throttles flushing in such cases.

rb://435
bug#54346
2010-08-20 12:39:04 -04:00
Christopher Powers
f4cef8d31f merge 2010-08-20 09:12:36 -05:00
Georgi Kodinov
c95f7a9816 merge 2010-08-20 16:10:49 +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
Sunny Bains
b6c5f4537b 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
Christopher Powers
02155b7173 Bug#53874, "SETUP_INSTRUMENTS.TIMED='NO' should not change TIMER_WAIT in aggregations"
end_*_wait() functions now honor TIMER_STATE_UNTIMED

storage/perfschema/pfs.cc:
  Don't aggregate stats if TIMER_STATE_UNTIMED
2010-08-19 17:24:07 -05:00
Jon Olav Hauglid
02863b4180 Merge from mysql-5.5-runtime to mysql-5.5-bugfixing. 2010-08-20 10:24:32 +02:00
Marko Mäkelä
cb73a044f8 Bug#56114 Disallow trx->dict_operation_lock_mode==RW_X_LATCH in srv_suspend_mysql_thread()
Issue an error message to the error log when
trx->dict_operation_lock_mode == RW_X_LATCH in
srv_suspend_mysql_thread(). Transactions that modify InnoDB
data dictionary tables must be free of lock waits, because they
must be holding the data dictionary latch in exclusive mode.
The transactions must not be accessing any other tables other than
the data dictionary tables.

The handling of RW_X_LATCH was accidentally added in the InnoDB Plugin,
as a wrong fix of an assertion failure. (Fast index creation was accessing
both data dictionary tables and user tables in the same transaction.)
2010-08-19 13:36:37 +03:00
Alexander Barkov
f827ef9ed4 Backporting Bug#32391 Character sets: crash with --character-set-server
from mysql-trunk-bugfixing (5.6.1-m5) from mysql-5.5-bugfixing (5.5.6-m3).
2010-08-19 10:00:43 +04:00
Jimmy Yang
97a780f1f9 Bug #48026 Log start and end of InnoDB buffer pool initialization to
the error log
2010-08-18 21:16:47 -07:00
Marko Mäkelä
618d6e7220 Merge Bug#55626 fix from mysql-5.1-innodb:
revno: 3545
revision-id: marko.makela@oracle.com-20100818110110-zfs0i1vfrccfb4yw
parent: vasil.dimov@oracle.com-20100817193934-1yl7zz2odikxauf8
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Wed 2010-08-18 14:01:10 +0300
message:
  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:40:02 +03:00
Jon Olav Hauglid
eb498cce4d Manual merge from mysql-5.5-bugfixing to mysql-5.5-runtime. 2010-08-18 13:29:04 +02:00
Marko Mäkelä
5a296bb07c 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
Magne Mahre
6293c44ff6 Bug #55547 InnoDB is not included when configuring by default
Added InnoDB to the 'default' plugin group, and modified 
the autoconf script so the 'default' group is actually 
built by default.
      
(i.e  ./configure.am == ./configure.am --with-plugins=default ,
instead of being ./configure.am --with-plugins=none )
2010-08-18 10:14:55 +02:00
Alexander Nozdrin
e28d6ee66a Auto-merge from mysql-5.5. 2010-08-18 11:48:38 +04:00
Vasil Dimov
ec4209255f Merge mysql-5.5-bugfixing -> mysql-5.5-innodb 2010-08-18 10:14:06 +03:00
Marko Mäkelä
085bb22ab2 A non-functional change:
dict_load_index_low(): Rename the parameter "cached" to "allocated"
and clarify the comments.
2010-08-17 15:07:54 +03:00
Jimmy Yang
b17b122b7d Fix bug #53496 Use Lock_time in slow query log output for InnoDB row
lock wait time. Including the InnoDB lock time in the exiting "Lock_time"
output.
2010-08-17 01:19:24 -07:00
Vasil Dimov
7f62ec7b38 Fix Bug#53761 RANGE estimation for matched rows may be 200 times different
Improve the range estimation algorithm.

Previously:
For a given level the algo knows the number of pages in the requested range and the n

With this change:
Same idea, but peek a few (10) of the intermediate pages to get a better estimate of 

In the bug report one of the examples has a btree with a snippet of the leaf level li
page1(899 records), page2(1 record), page3(1 record), page4(1 record)
so when trying to estimate, the previous algo, assumed there are average (899+1)/2=45
Fix Bug#53761 RANGE estimation for matched rows may be 200 times different

Improve the range estimation algorithm.

Previously:
For a given level the algo knows the number of pages in the requested range
and the number of records on the leftmost and the rightmost page. Then it
assumes all pages in between contain the average between the two border pages
and multiplies this average number by the number of intermediate pages.

With this change:
Same idea, but peek a few (10) of the intermediate pages to get a better
estimate of the average number of records per page. If there are less than 10
intermediate pages then all of them will be scanned and the result will be
precise, not an estimation.

In the bug report one of the examples has a btree with a snippet of the leaf
level like this:
page1(899 records), page2(1 record), page3(1 record), page4(1 record)
so when trying to estimate, the previous algo, assumed there are average
(899+1)/2=450 records per page which went terribly wrong. With this change
page2 and page3 will be read and the exact number of records will be returned.

Approved by:	Sunny (rb://401)
2010-08-16 17:23:29 +03:00
Mats Kindahl
b0836bd309 Merging with mysql-5.5-stage. 2010-08-16 14:50:27 +02:00
Alexander Nozdrin
98f69947aa Auto-merge from mysql-5.5. 2010-08-16 10:46:21 +04:00
Alexander Nozdrin
aadd49573c Auto-merge from mysql-5.5. 2010-08-16 10:38:26 +04:00
Sunny Bains
3c4d4e0a25 Merge from -c3476 mysql-5.1-security.
------------------------------------------------------------
     revno: 3476
     committer: Sunny Bains <Sunny.Bains@Oracle.Com>
     branch nick: 5.1-security
     timestamp: Thu 2010-08-05 19:18:17 +1000
     message:
       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-16 12:05:49 +10:00
Sunny Bains
adde4bac98 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

Merge from mysql-5.1-security.
2010-08-16 11:59:43 +10:00
Inaam Rana
1a649603f8 Change default for innodb_strict_mode to FALSE.
Note that this was originally pushed by Calvin but the was later
reverted by mistake.

bug#54702
2010-08-13 15:07:22 -04:00
Inaam Rana
50af6a8aea Undo changes to innodb_strict_mode that went in by mistake in r3149 2010-08-13 12:14:59 -04:00
Vasil Dimov
7f8627e36b Manually merge a changeset from mysql-5.1-security:
------------------------------------------------------------
  revno: 3475
  revision-id: jimmy.yang@oracle.com-20100804103744-vbpeghipkz6pyc9z
  parent: jimmy.yang@oracle.com-20100804101133-c38qqbm0fkwn9jhc
  committer: Jimmy Yang <jimmy.yang@oracle.com>
  branch nick: mysql-5.1-security
  timestamp: Wed 2010-08-04 03:37:44 -0700
  message:
    Fix bug #54678, InnoDB, TRUNCATE, ALTER, I_S SELECT, crash or deadlock
    
    rb://399 approved by Sunny Bains
  modified:
    storage/innodb_plugin/ChangeLog 2425@16c675df-0fcb-4bc9-8058-dcc011a37293:branches%2Fzip%2FChangeLog
    storage/innodb_plugin/include/dict0dict.h 2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Fdict0dict.h
    storage/innodb_plugin/include/dict0dict.ic 2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Fdict0dict.ic
    storage/innodb_plugin/row/row0mysql.c 2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Frow%2Frow0mysql.c
2010-08-13 15:52:11 +03:00
Alexander Nozdrin
8b645bed97 Patch for Bug#55854 (MySQL AB should not be AUTHOR, copyright incorrect).
Fixing copyright text.
2010-08-12 19:19:57 +04:00
Marc Alff
26f1efd981 Bug#55416 Renaming of performance_schema tables for 5.5
Removed table SETUP_OBJECTS.
      
Renamed table PROCESSLIST to THREADS.
      
Renamed table EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
to EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
      
Adjusted Makefiles, code and tests accordingly.
2010-08-12 08:08:52 -06:00
Sunny Bains
34a05995df Fix bug #52263 innodb does not compile on OpenSolaris with gcc4.3.2
Disable the GCC visibility attribute on all sun platforms.

Approved by Marko on IRC.
2010-08-12 20:00:07 +10:00
Marc Alff
a1d90f124f Bug#55462 Performance schema: reduce the overhead of PFS_events_waits::m_wait_class
This is a performance improvement fix.

Removed the "volatile" property of PFS_events_waits::m_wait_class.
Simplified the code accordingly.
2010-08-12 03:51:58 -06:00
Marko Mäkelä
271e6ae341 Bug#54914: InnoDB: performance drop with innodb_change_buffering=all
Reduce ibuf_mutex and ibuf_pessimistic_insert_mutex contention further.

Protect ibuf->empty by the insert buffer root page latch, not ibuf_mutex.

ibuf_tree_root_get(): Assert that ibuf_mutex is owned by the
caller. Assert that the stamped page number is correct. Assert that
ibuf->empty agrees with the root page.

ibuf_size_update(): Do not update ibuf->empty.

ibuf_init_at_db_start(): Update ibuf->empty while holding the root page latch.

ibuf_add_free_page(): Return TRUE/FALSE instead of DB_SUCCESS/DB_STRONG_FAIL.

ibuf_remove_free_page(): Release ibuf_pessimistic_insert_mutex as
early as possible.

ibuf_contract_ext(): Rely on a dirty read of ibuf->empty, unless the
server is being shut down. Never acquire ibuf_mutex. Eliminate n_stored.

ibuf_contract_after_insert(): Never acquire ibuf_mutex. Perform dirty
reads of ibuf->size and ibuf->max_size.

ibuf_insert_low(): Only acquire ibuf_mutex for mode==BTR_MODIFY_TREE.
Perform dirty reads of ibuf->size and ibuf->max_size. Update
ibuf->empty while holding the root page latch.

ibuf_delete_rec(): Update ibuf->empty while holding the root page latch.

ibuf_is_empty(): Release ibuf_mutex earlier.
2010-08-10 13:22:48 +03:00
Marko Mäkelä
a4c5cf7ca9 Reduce the ibuf_mutex hold time. This does not fix the update
regression in Bug #54914, but it does speed up the execution for
innodb_change_buffering=inserts.

ibuf_add_ops(), ibuf_merge_or_delete_for_page(),
ibuf_delete_for_discarded_space(): Use atomic built-ins instead of
ibuf_mutex, when available.

ibuf_add_free_page(), ibuf_remove_free_page(), ibuf_contract_ext():
Release ibuf_mutex earlier.

ibuf_free_excess_pages(): Release ibuf_mutex before a conditional branch.

ibuf_insert_low(): Release ibuf_mutex before a conditional
branch. Create ibuf_entry before re-acquiring ibuf_mutex. Simplify a
loop to reduce code footprint. Release ibuf_mutex before mtr_commit()
[btr_pcur_close()].

ibuf_is_empty(): Release ibuf_mutex before mtr_commit().
2010-08-09 11:58:37 +03:00
Davi Arnaut
76382d2746 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Post-merge fix: remove --with-debug=full, it was only used for safemalloc.

BUILD/compile-pentium-mysqlfs-debug:
  Remove build script for a feature that is long gone.
2010-08-06 09:59:38 -03: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
Inaam Rana
9943e3f472 merge 2010-08-05 11:42:11 -04:00
Inaam Rana
0812058d02 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
Inaam Rana
b4a25f462e 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:09:05 -04:00
Georgi Kodinov
ae64b6f7ab merge 2010-08-05 15:34:19 +03: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
Sunny Bains
b37256b1ab 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
Georgi Kodinov
b1a8b3aa6e Bug #42144: plugin_load fails
Reverted the ulong->uint diff
Re-applied the first diff.
The original commit message follows:

enum plugin system variables are ulong internally, not int.
On systems where long is not the same as an int it causes
problems. 
Fixed by correct typecasting. Removed the test from the 
experimental list.
2010-08-04 15:58:09 +03:00
Jimmy Yang
ad90d1942e 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
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
Alexander Nozdrin
aeeafbb396 Auto-merge from mysql-5.5. 2010-08-04 12:18:32 +04:00
Jimmy Yang
666dfaf090 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
Georgi Kodinov
efc8a27935 merge 2010-08-03 19:21:13 +03:00
Georgi Kodinov
5eeb6488cf Bug #42144: plugin_load fails
The enum system variables were handled inconsistently 
as ints, unsigned int and unsigned long on various places.
This caused problems on platforms on which 
sizeof(int) != sizeof(long).
Fixed by homogenizing the type of the enum variables
to unsigned int, since it's size compatible with the C enum
type. 
Removed the test from the experimental list.
2010-08-03 19:01:30 +03:00
Calvin Sun
b003544f65 Bug #54702: revert the default of innodb_strict_mode to false. 2010-08-03 01:12:03 -05: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
Inaam Rana
e3e0c290dd merge from parent 2010-07-30 10:41:59 -04:00
Inaam Rana
0f9c818545 When the caller of buf_flush_list() provides us with the number of
pages that it wants to flush then we should honor that value as in
not going beyond that in our eagerness to flush the neighbors of
the selected victim.
2010-07-30 10:39:16 -04:00
Alexander Nozdrin
32f3ab7933 Auto-merge from mysql-trunk-merge. 2010-07-29 16:32:11 +04:00
Konstantin Osipov
d85c628180 Merge trunk-bugfixing -> trunk-runtime. 2010-07-29 14:18:13 +04:00
Vasil Dimov
ca090321bf Merge mysql-trunk-bugfixing -> mysql-trunk-innodb 2010-07-29 12:42:55 +03:00
Vasil Dimov
c110066bda Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-07-29 11:51:00 +03:00
Jimmy Yang
277b055f14 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
3ced6488a4 Fix trailing whitespace on ha_innodb.cc:1259 2010-07-28 09:15:07 +03:00
Vasil Dimov
c02859352b Remove trailing whitespace on ha_innodb.cc:574 2010-07-28 08:38:28 +03:00
Konstantin Osipov
c4c678f653 Merge trunk-bugfixing -> trunk-runtime. 2010-07-27 18:32:42 +04:00
Davi Arnaut
e4cbcaf942 Bug#45377: ARCHIVE tables aren't discoverable after OPTIMIZE
The problem was that the optimize method of the ARCHIVE storage
engine was not preserving the FRM embedded in the ARZ file when
rewriting the ARZ file for optimization. The ARCHIVE engine stores
the FRM in the ARZ file so it can be transferred from machine to
machine without also copying the FRM -- the engine restores the
embedded FRM during discovery.

The solution is to copy over the FRM when rewriting the ARZ file.
In addition, some initial error checking is performed to ensure
garbage is not copied over.


mysql-test/t/archive.test:
  Add test case for Bug#45377.
storage/archive/azio.c:
  Add error checking to ensure that the I/O operations are
  successful.
storage/archive/ha_archive.cc:
  Copy over the embedded FRM.
2010-07-26 12:54:20 -03:00
Jimmy Yang
84a827018c Fix Bug #55395 INNODB_TRX duplicates columns
rb://408 approved by Sunny Bains
2010-07-26 03:07:36 -07:00
Davi Arnaut
8011a429b5 Add a maintainer target to the warning-mode of the build scripts.
Fix assorted warnings in order for the warning-mode to be effective.
2010-07-24 10:31:48 -03:00
Davi Arnaut
73188c913b Backport fixes for some of the more noise compiler warnings in ndb. 2010-07-24 09:54:27 -03:00
Davi Arnaut
7f80eb46e9 Bug#42733: Type-punning warnings when compiling MySQL
Post-merge fix: remove remaining casts which are now
unnecessary and are actually causing warnings.
2010-07-24 09:24:44 -03:00
Davi Arnaut
e001970cc7 WL#5498: Remove dead and unused source code
Remove workarounds for ancient systems.

mysys/default.c:
  Make cast more explicit to ensure a correct offset.
2010-07-23 17:17:55 -03:00
Davi Arnaut
75e2212397 WL#5498: Remove dead and unused source code
Remove unused macros or macro which are always defined.

include/my_global.h:
  Remove unused macros and move macros which aren't used globally.
2010-07-23 17:16:29 -03:00
Davi Arnaut
cc3a26289d WL#5498: Remove dead and unused source code
Remove the ancient and dead raid code. By now, even the server side
has been removed.
2010-07-23 17:15:07 -03:00
Davi Arnaut
bc4ba28cab WL#5498: Remove dead and unused source code
Remove unused variables.
2010-07-23 17:13:36 -03:00
Davi Arnaut
97c3182312 WL#5498: Remove dead and unused source code
Remove code that has been disabled for a long time.
2010-07-23 17:09:27 -03:00
Vasil Dimov
6c4335b4cd 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
f43c9eff23 Merge mysql-5.1 -> mysql-5.1-innodb 2010-07-23 12:51:14 +03:00
Sunny Bains
424250c26c Remove code that was added during the flush list mutex refactoring. We cannot
release a dirty page in the middle of a mini-transaction. Replace the code
with an assertion that checks for this condition.

Original svn revision was: r6330.
2010-07-22 14:46:12 +10:00
Sunny Bains
e27f4b3a4b Bug#54583 InnoDB: Assertion failure sync/sync0sync.c:1226
Silence the UNIV_SYNC_DEBUG assertion failure while upgrading old data files
to multiple rollback segments during server startup. Because the upgrade
takes place while InnoDB is running a single thread, we can safely ignore the
latching order checks without fearing deadlocks.
      
innobase_start_or_create_for_mysql(): Set srv_is_being_started = FALSE
only after trx_sys_create_rsegs() has completed.
      
sync_thread_add_level(): If srv_is_being_started, ignore latching order
violations for SYNC_TRX_SYS_HEADER and SYNC_IBUF_BITMAP.

Create all the non-IO threads after creating the extra rollback segments.

Patch originally from Marko with some additions by Sunny.
2010-07-22 09:16:19 +10:00
Sunny Bains
779741921c Bug 54617 - During shutdown: Failing assertion: arr->n_reserved == 0
Get rid of at least on suspicious path. Ensure that the purge thread
doesn't acquire a mutex after it has signalled shutdown.
2010-07-22 07:41:51 +10:00
Vasil Dimov
f867d5c1dc Increment InnoDB version to 1.1.2
InnoDB 1.1.1 was released with MySQL 5.5.5-m3
2010-07-21 20:19:59 +03:00
Vasil Dimov
5ba3936517 Merge mysql-trunk-bugfixing -> mysql-trunk-innodb
(resolving conflicts in mysql-test/suite/rpl/t/rpl_sync-slave.opt and
configure.cmake)
2010-07-21 17:22:29 +03:00
Calvin Sun
0802e5da69 Improve InnoDB synchronization primitives on Windows
This patch was originally developed by Vladislav Vaintroub.
The main changes are:

 * Use TryEnterCriticalSection in os_fast_mutex_trylock().
 * Use lightweight condition variables on Vista or later Windows;
   but fall back to events on older Windows, such as XP.

This patch also fixes the following bugs:
  bug# 52102 InnoDB Plugin shows performance drop compared to InnoDB
             on Windows
  bug# 53204 os_fastmutex_trylock is implemented incorrectly on Windows

rb://363 approved by Inaam Rana
2010-07-20 15:42:31 -05:00
Davi Arnaut
182599dd13 Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-07-20 16:30:10 -03:00
Davi Arnaut
9a5fa17fd3 Bug#45288: pb2 returns a lot of compilation warnings on linux
Fix warnings flagged by the new warning option -Wunused-but-set-variable
that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The
option causes a warning whenever a local variable is assigned to but is
later unused. It also warns about meaningless pointer dereferences.

client/mysql.cc:
  Meaningless pointer dereferences.
client/mysql_upgrade.c:
  Check whether reading from the file succeeded.
extra/comp_err.c:
  Unused.
extra/yassl/src/yassl_imp.cpp:
  Skip instead of reading data that is discarded.
include/my_pthread.h:
  Variable is only used in debug builds.
include/mysys_err.h:
  Add new error messages.
mysys/errors.c:
  Add new error message for permission related functions.
mysys/mf_iocache.c:
  Variable is only checked under THREAD.
mysys/my_copy.c:
  Raise a error if chmod or chown fails.
mysys/my_redel.c:
  Raise a error if chmod or chown fails.
regex/engine.c:
  Use a equivalent variable for the assert.
server-tools/instance-manager/instance_options.cc:
  Unused.
sql/field.cc:
  Unused.
sql/item.cc:
  Unused.
sql/log.cc:
  Do not ignore the return value of freopen: only set buffer if
  reopening succeeds.
  
  Adjust doxygen comment to the right function.
  
  Pass message lenght to log function.
sql/mysqld.cc:
  Do not ignore the return value of freopen: only set buffer if
  reopening succeeds.
sql/partition_info.cc:
  Unused.
sql/slave.cc:
  No need to set pointer to the address of '\0'.
sql/spatial.cc:
  Unused. Left for historical purposes.
sql/sql_acl.cc:
  Unused.
sql/sql_base.cc:
  Pointers are always set to the same variables.
sql/sql_parse.cc:
  End statement if reading fails.
  
  Store the buffer after it has actually been updated.
sql/sql_repl.cc:
  No need to set pointer to the address of '\0'.
sql/sql_show.cc:
  Put variable under the same ifdef block.
sql/udf_example.c:
  Set null pointer flag appropriately.
storage/csv/ha_tina.cc:
  Meaningless dereferences.
storage/example/ha_example.cc:
  Return the error since it's available.
storage/myisam/mi_locking.c:
  Remove unused and dead code.
2010-07-20 15:07:36 -03:00
Alexander Nozdrin
fdfbb82964 Auto-merge from mysql-trunk-merge. 2010-07-20 12:09:51 +04:00
Davi Arnaut
84d2ae22fe Merge into mysql-trunk-merge.. 2010-07-19 16:03:59 -03:00
Davi Arnaut
dfaf73a987 Merge of mysql-5.1 into mysql-5.1-bugteam. 2010-07-19 15:34:28 -03:00
Jon Olav Hauglid
7467ee7bc6 merge from mysql-trunk-bugfixing 2010-07-19 10:27:53 +02:00
Davi Arnaut
59c0e16d62 Merge of mysql-trunk-merge into mysql-trunk-bugfixing. 2010-07-16 17:02:40 -03:00
Davi Arnaut
92f3fc92f3 Bug#48327: Some crashes specific to FreeBSD ("embedded")
Bug#47139: Test "merge" crashes in "embedded" run

Backport patch for Bug#47139
2010-07-16 14:33:35 -03:00
Marc Alff
102d04dd65 Bug#52134 performance schema file io, symlink in path
Backport from mysql-next-mr (5.6) to mysql-trunk (5.5)
2010-07-15 19:25:03 -06:00
Marc Alff
3725080c25 Bug#53617 Missing performance schema tables not reported in the server log at startup
Backport from mysql-next-mr (5.6) to mysql-trunk (5.5)
2010-07-15 19:18:44 -06:00
Marc Alff
e04de9783a Bug#52502 Performance schema does not start with large mutex_instance buffers
Backport from mysql-next-mr (5.6) to mysql-trunk (5.5)
2010-07-15 19:03:08 -06:00
Marc Alff
36e80ced63 Bug#52586 Misleading error message on attempt to access a P_S table using a wrong name
Backport from mysql-next-mr (5.6) to mysql-trunk (5.5)
2010-07-15 18:50:39 -06:00
Marc Alff
bc6092a497 Bug#53566 SHOW ENGINE PERFORMANCE_SCHEMA STATUS reports less memory than really used
Backporting the fix from myql-next-mr (5.6) to mysql-trunk (5.5)
2010-07-15 18:28:52 -06:00
Marc Alff
aa2daceebc Bug#53148 Remove PFS_readonly_table
This fix is for cleanup, to resolve a remaining code review item.
Backport from mysql-next-mr (5.6) to mysql-trunk (5.5).
2010-07-15 18:06:33 -06:00
Marc Alff
4b1f459ae0 Fixed Copyright headers in storage/perfschema
Fixed minor merge issues with #includes
2010-07-15 17:44:45 -06:00
Davi Arnaut
711c318c07 Merge of mysql-trunk-bugfixing into mysql-trunk-merge. 2010-07-15 10:47:50 -03:00
Davi Arnaut
6420d6dc4a WL#5486: Remove code for unsupported platforms
Remove VMS specific code.
2010-07-15 08:26:38 -03:00
Davi Arnaut
13f7a1d244 WL#5486: Remove code for unsupported platforms
Remove MS-DOS specific code.
2010-07-15 08:16:06 -03:00
Davi Arnaut
07e7b4d6fe WL#5486: Remove code for unsupported platforms
Remove Netware specific code.
2010-07-15 08:13:30 -03:00
Sunny Bains
17fd8dec1d Fix bug# 54901 assert during recovery when binlog enabled.
Remove the pure attribute from a function. The function doesn't qualify as
a pure function because it has a side-effect (modifies its parameter). Add
a clarifying comment to another function's declaration.
2010-07-15 11:55:15 +10:00
Marc Alff
ef27448469 Implemented code review comments.
Fixed style according to the specific innodb style, for innodb code.
2010-07-14 10:23:21 -06:00
Davi Arnaut
4972f4d803 Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-07-14 10:16:10 -03:00
Davi Arnaut
ce78970202 Bug#48327: Some crashes specific to FreeBSD ("embedded")
Backport fixes from ndb: Rework the constructors of some static
object's to not call dbug functions since the constructors will
be called before main, and consequently, before the dbug library
is initialized.
2010-07-14 10:10:12 -03:00
Jimmy Yang
29bde8a0ce Fix Bug #55095 innodb_file_format_check: no warning for illegal value
rb://397 approved by Sunny Bains
2010-07-13 02:58:39 -07:00
Jon Olav Hauglid
f45523188e merge from mysql-trunk-bugfixing 2010-07-13 10:39:24 +02:00
Davi Arnaut
47a4a88160 Add the cmake option MYSQL_MAINTAINER_MODE which is equivalent
to the autotools option mysql-maintainer-mode. This option is
intended to set a few flags that should be activated by anyone
doing MySQL development, regardless of the build type. Also, the
flags are only set by the very end of the platform checks as
to not disturb fragile checks.
2010-07-12 13:39:00 -03:00
Marc Alff
ec41287630 Bug#55087 Performance schema: optimization of the instrumentation interface
This change is for performance optimization.

Fixed the performance schema instrumentation interface as follows:
- simplified mysql_unlock_mutex()
- simplified mysql_unlock_rwlock()
- simplified mysql_cond_signal()
- simplified mysql_cond_broadcast()

Changed the get_thread_XXX_locker apis to have one extra parameter,
to provide memory to the instrumentation implementation.
This API change allows to use memory provided by the caller,
to avoid having to use thread local storage.
Using this extra parameter will be done in a separate fix,
this change is for the interface only.

Adjusted all the code and unit tests accordingly.
2010-07-09 17:00:24 -06:00
Davi Arnaut
1c924a1652 Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-07-09 09:28:51 -03:00
unknown
6ad06b1522 Fix bug #55039 Failing assertion: space_id > 0 in fil0fil.c. 2010-07-09 14:23:48 +02:00
Davi Arnaut
11fae04527 Bug#45288: pb2 returns a lot of compilation warnings on linux
Although the C standard mandates that sprintf return the number
of bytes written, some very ancient systems (i.e. SunOS 4)
returned a pointer to the buffer instead. Since these systems
are not supported anymore and are hopefully long dead by now,
simply remove the portability wrapper that dealt with this
discrepancy. The autoconf check was causing trouble with GCC.
2010-07-09 09:00:17 -03:00
Davi Arnaut
cd37b73fe5 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.

config/ac-macros/maintainer.m4:
  Add a set of default compiler flags used when in maintainer mode.
configure.in:
  Hook into the maintainer mode. Disabled by default.
2010-07-09 08:37:51 -03:00
Jimmy Yang
143c8b5a6c Merge fix for bug #55039 from mysql-5.1-security to mysql-trunk-security.
bug #55039 Failing assertion: space_id > 0 in fil0fil.c line 2618 .

rb://396 approved by Sunny Bains
2010-07-09 02:01:05 -07:00
Jimmy Yang
74f23d7e8f Fix bug #55039 Failing assertion: space_id > 0 in fil0fil.c.
rb://396, approved by Sunny Bains.
2010-07-09 01:39:20 -07:00
Davi Arnaut
f56dd32bf7 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Essentially, the problem is that safemalloc is excruciatingly
slow as it checks all allocated blocks for overrun at each
memory management primitive, yielding a almost exponential
slowdown for the memory management functions (malloc, realloc,
free). The overrun check basically consists of verifying some
bytes of a block for certain magic keys, which catches some
simple forms of overrun. Another minor problem is violation
of aliasing rules and that its own internal list of blocks
is prone to corruption.

Another issue with safemalloc is rather the maintenance cost
as the tool has a significant impact on the server code.
Given the magnitude of memory debuggers available nowadays,
especially those that are provided with the platform malloc
implementation, maintenance of a in-house and largely obsolete
memory debugger becomes a burden that is not worth the effort
due to its slowness and lack of support for detecting more
common forms of heap corruption.

Since there are third-party tools that can provide the same
functionality at a lower or comparable performance cost, the
solution is to simply remove safemalloc. Third-party tools
can provide the same functionality at a lower or comparable
performance cost. 

The removal of safemalloc also allows a simplification of the
malloc wrappers, removing quite a bit of kludge: redefinition
of my_malloc, my_free and the removal of the unused second
argument of my_free. Since free() always check whether the
supplied pointer is null, redudant checks are also removed.

Also, this patch adds unit testing for my_malloc and moves
my_realloc implementation into the same file as the other
memory allocation primitives.

client/mysqldump.c:
  Pass my_free directly as its signature is compatible with the
  callback type -- which wasn't the case for free_table_ent.
2010-07-08 18:20:08 -03:00
Jimmy Yang
b7269520bd Fix Bug #54764 memory allocated in os_aio_array_create is not
freed at shutdown

rb://395, approved by Sunny Bains
2010-07-08 00:05:59 -07:00
Davi Arnaut
cd41cd953d Bug#22320: my_atomic-t unit test fails
The atomic operations implementation on 5.1 has a few problems,
which might cause tests to abort randomly. Since no code in 5.1
uses atomic operations, simply remove the code.
2010-07-05 09:00:39 -03:00
Georgi Kodinov
22f4498cd6 merge 2010-07-05 12:35:24 +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
Davi Arnaut
54a5c00de9 Unset the execute bit where it's not needed. 2010-07-03 20:17:03 -03:00
Davi Arnaut
5641fb64b4 Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-07-02 16:38:04 -03:00
Davi Arnaut
0eb26fdfa8 Bug#53445: Build with -Wall and fix warnings that it generates
Apart strict-aliasing warnings, fix the remaining warnings
generated by GCC 4.4.4 -Wall and -Wextra flags.

One major source of warnings was the in-house function my_bcmp
which (unconventionally) took pointers to unsigned characters
as the byte sequences to be compared. Since my_bcmp and bcmp
are deprecated functions whose only difference with memcmp is
the return value, every use of the function is replaced with
memcmp as the special return value wasn't actually being used
by any caller.

There were also various other warnings, mostly due to type
mismatches, missing return values, missing prototypes, dead
code (unreachable) and ignored return values.

BUILD/SETUP.sh:
  Remove flags that are implied by -Wall and -Wextra.
  Do not warn about unused parameters in C++.
BUILD/check-cpu:
  Print only the compiler version instead of verbose banner.
  Although the option is gcc specific, the check was only
  being used for GCC specific checks anyway.
client/mysql.cc:
  bcmp is no longer defined.
client/mysqltest.cc:
  Pass a string to function expecting a format string.
  Replace use of bcmp with memcmp.
cmd-line-utils/readline/Makefile.am:
  Always define _GNU_SOURCE when compiling GNU readline.
  Required to make certain prototypes visible.
cmd-line-utils/readline/input.c:
  Condition for the code to be meaningful.
configure.in:
  Remove check for bcmp.
extra/comp_err.c:
  Use appropriate type.
extra/replace.c:
  Replace use of bcmp with memcmp.
extra/yassl/src/crypto_wrapper.cpp:
  Do not ignore the return value of fgets. Retrieve the file
  position if fgets succeed -- if it fails, the function will
  bail out and return a error.
extra/yassl/taocrypt/include/blowfish.hpp:
  Use a single array instead of accessing positions of the sbox_
  through a subscript to pbox_.
extra/yassl/taocrypt/include/runtime.hpp:
  One definition of such functions is enough.
extra/yassl/taocrypt/src/aes.cpp:
  Avoid potentially ambiguous conditions.
extra/yassl/taocrypt/src/algebra.cpp:
  Rename arguments to avoid shadowing related warnings.
extra/yassl/taocrypt/src/blowfish.cpp:
  Avoid potentially ambiguous conditions.
extra/yassl/taocrypt/src/integer.cpp:
  Do not define type within a anonymous union.
  Use a variable to return a value instead of
  leaving the result in a register -- compiler
  does not know the logic inside the asm.
extra/yassl/taocrypt/src/misc.cpp:
  Define handler for pure virtual functions.
  Remove unused code.
extra/yassl/taocrypt/src/twofish.cpp:
  Avoid potentially ambiguous conditions.
extra/yassl/testsuite/test.hpp:
  Function must have C language linkage.
include/m_string.h:
  Remove check which relied on bcmp being defined -- they weren't
  being used as bcmp is only visible when _BSD_SOURCE is defined.
include/my_bitmap.h:
  Remove bogus helpers which were used only in a few files and
  were causing warnings about dead code.
include/my_global.h:
  Due to G++ bug, always silence false-positive uninitialized
  variables warnings when compiling C++ code with G++.
  Remove bogus helper.
libmysql/Makefile.shared:
  Remove built-in implementation of bcmp.
mysql-test/lib/My/SafeProcess/safe_process.cc:
  Cast pid to largest possible type for a process identifier.
mysys/mf_loadpath.c:
  Leave space of the ending nul.
mysys/mf_pack.c:
  Replace bcmp with memcmp.
mysys/my_bitmap.c:
  Dead code removal.
mysys/my_gethwaddr.c:
  Remove unused variable.
mysys/my_getopt.c:
  Silence bogus uninitialized variable warning.
  Do not cast away the constant qualifier.
mysys/safemalloc.c:
  Cast to expected type.
mysys/thr_lock.c:
  Silence bogus uninitialized variable warning.
sql/field.cc:
  Replace bogus helper with a more appropriate logic which is
  used throughout the code.
sql/item.cc:
  Remove bogus logical condition which always evaluates to TRUE.
sql/item_create.cc:
  Simplify code to avoid signedness related warnings.
sql/log_event.cc:
  Replace use of bcmp with memcmp.
  No need to use helpers for simple bit operations.
sql/log_event_old.cc:
  Replace bmove_align with memcpy.
sql/mysqld.cc:
  Move use declaration of variable to the ifdef block where it
  is used. Remove now-unnecessary casts and arguments.
sql/set_var.cc:
  Replace bogus helpers with simple and classic bit operations.
sql/slave.cc:
  Cast to expected type and silence bogus warning.
sql/sql_class.h:
  Don't use enum values as bit flags, the supposed type safety is
  bogus as the combined bit flags are not a value in the enumeration.
sql/udf_example.c:
  Only declare variable when necessary.
sql/unireg.h:
  Replace use of bmove_align with memcpy.
storage/innobase/os/os0file.c:
  Silence bogus warning.
storage/myisam/mi_open.c:
  Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
  char.
storage/myisam/mi_page.c:
  Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
  char.
strings/bcmp.c:
  Remove built-in bcmp.
strings/ctype-ucs2.c:
  Silence bogus warning.
tests/mysql_client_test.c:
  Use a appropriate type as expected by simple_command().
2010-07-02 15:30:47 -03:00
Konstantin Osipov
05617af025 A fix and a test case for Bug#36171 "CREATE TEMPORARY TABLE and
MERGE engine".
Backport the patch from 6.0 by Ingo Struewing:
revid:ingo.struewing@sun.com-20091028183659-6kmv1k3gdq6cpg4d
Bug#36171 - CREATE TEMPORARY TABLE and MERGE engine

In former MySQL versions, up to 5.1.23/6.0.4 it was possible to create
temporary MERGE tables with non-temporary MyISAM tables.
        
This has been changed in the mentioned version due to Bug 19627
(temporary merge table locking). MERGE children were locked through
the parent table. If the parent was temporary, it was not locked and
so the children were not locked either. Parallel use of the MyISAM
tables corrupted them.
       
Since 6.0.6 (WL 4144 - Lock MERGE engine children), the children are
locked independently from the parent. Now it is possible to allow
non-temporary children with a temporary parent. Even though the
temporary MERGE table itself is not locked, each non-temporary
MyISAM table is locked anyway.
        
NOTE: Behavior change: In 5.1.23/6.0.4 we prohibited non-temporary
children with a temporary MERGE table. Now we re-allow it.
An important side-effect is that temporary tables, which overlay
non-temporary MERGE children, overlay the children in the MERGE table.


mysql-test/r/merge.result:
  Update results (Bug#36171).
mysql-test/r/merge_mmap.result:
  Update results (Bug#36171).
mysql-test/t/merge.test:
  Add tests for Bug#36171
mysql-test/t/merge_mmap.test:
  Add tests for Bug#36171.
storage/myisammrg/ha_myisammrg.cc:
  Changed constraint for temporary state of tables.
2010-07-02 20:07:57 +04:00
Konstantin Osipov
1afe6ff03a A test case for Bug#50788 "main.merge fails on HPUX",
and a backport of relevant changes from the 6.0
version of the fix done by Ingo Struewing.
The bug itself was fixed by the patch for Bug#54811.


MyISAMMRG engine would try to use MMAP on its children
even on platforms that don't support it and even if
myisam_use_mmap option was off.
This lead to an infinite hang in INSERT ... SELECT into 
a MyISAMMRG table when the destination MyISAM table
was also selected from.

A bug in duplicate detection fixed by 54811 was essential to 
the hang - when a duplicate is detected, the optimizer 
disables the use of memory mapped files, and it wasn't the case.

The patch below is also to not turn on MMAP on children tables
if myisam_use_mmap is off.
A test case is added to cover MyISAMMRG and myisam_use_mmap
option.


mysql-test/r/merge_mmap.result:
  Result file - Bug#50788.
mysql-test/t/merge_mmap-master.opt:
  An option file for the test for Bug#50788 -- use mmap.
mysql-test/t/merge_mmap.test:
  Try INSERT ... SELECT into a merge table when myisam_use_mmap is on (Bug#50788).
storage/myisam/mi_statrec.c:
  Fixed misinterpretation of the return value of my_b_read().
storage/myisammrg/ha_myisammrg.cc:
  Skip HA_EXTRA_MMAP if MyISAM memory mapping is disabled.
2010-07-02 19:21:07 +04:00
Sergey Vojtovich
3670dcf38d BUG#54832 - Comment for MyISAM says it is a default engine
Fixed MyISAM storage engine comment, so it doesn't anymore
state that MyISAM is default storage engine.
2010-07-02 14:56:54 +04:00
Jimmy Yang
7f19cc824f 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
Jimmy Yang
6180fa31d3 Fix bug #54311 Crash on CHECK PARTITION after concurrent LOAD DATA
and adaptive_hash_index=OFF

rb://389 approved by Marko
2010-06-30 21:52:47 -07:00
Marko Mäkelä
75a5aaf2ad Merge a Bug #54358 error handling correction from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3534
revision-id: marko.makela@oracle.com-20100630093847-7gkr1lh3bh2xksy0
parent: marko.makela@oracle.com-20100630093149-wmc37t128gic933v
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Wed 2010-06-30 12:38:47 +0300
message:
  Bug#54358 follow-up: Correct some error handling.
2010-06-30 12:55:10 +03:00
Marko Mäkelä
533d430d2c Merge Bug #54358 comment corrections from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3533
revision-id: marko.makela@oracle.com-20100630093149-wmc37t128gic933v
parent: marko.makela@oracle.com-20100629131219-pjbkpk5rsqztmw27
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Wed 2010-06-30 12:31:49 +0300
message:
  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:52:41 +03:00
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
Mark Leith
6cb46973dc Bug#54726 - Inconsistent reporting between mutex and RW lock spin rounds
- Add round counts to the output for RW s/x locks
2010-06-30 10:11:04 +01:00
Jon Olav Hauglid
83920a72fd merge from mysql-trunk-bugfixing 2010-06-30 08:47:49 +02:00
Konstantin Osipov
c3b1a5751a Salvage comments added by Ingo while working on
Bug#52114 and Bug#50788.
The bugs themselves are regressions that are introduced
by an incomplete fix for Bug#36171 and will not be pushed.
2010-06-29 18:28:36 +04:00
Marko Mäkelä
6ea69ffe79 Merge Bug#54408 fix from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3531
revision-id: marko.makela@oracle.com-20100629130058-1ilqaj51u9sj9vqe
parent: marko.makela@oracle.com-20100629125653-t799e5x30h31cvrd
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Tue 2010-06-29 16:00:58 +0300
message:
  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:21:05 +03:00
Marko Mäkelä
7c718cdb01 Merge Bug#54358 fix from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3529
revision-id: marko.makela@oracle.com-20100629125518-m3am4ia1ffjr0d0j
parent: jimmy.yang@oracle.com-20100629024137-690sacm5sogruzvb
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Tue 2010-06-29 15:55:18 +0300
message:
  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 16:19:07 +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
Marko Mäkelä
142e8417dc Bug#52199 utf32: mbminlen=4, mbmaxlen=4, type->mbminlen=0, type->mbmaxlen=4
Merge and adjust a forgotten change to fix this bug.
rb://393 approved by Jimmy Yang
  ------------------------------------------------------------------------
  r3794 | marko | 2009-01-07 14:14:53 +0000 (Wed, 07 Jan 2009) | 18 lines

  branches/6.0: Allow the minimum length of a multi-byte character to be
  up to 4 bytes. (Bug #35391)

  dtype_t, dict_col_t: Replace mbminlen:2, mbmaxlen:3 with mbminmaxlen:5.
  In this way, the 5 bits can hold two values of 0..4, and the storage size
  of the fields will not cross the 64-bit boundary.  Encode the values as
  DATA_MBMAX * mbmaxlen + mbminlen.  Define the auxiliary macros
  DB_MBMINLEN(mbminmaxlen), DB_MBMAXLEN(mbminmaxlen), and
  DB_MINMAXLEN(mbminlen, mbmaxlen).

  Try to trim and pad UTF-16 and UTF-32 with spaces as appropriate.

  Alexander Barkov suggested the use of cs->cset->fill(cs, buff, len, 0x20).
  ha_innobase::store_key_val_for_row() now does that, but the added function
  row_mysql_pad_col() does not, because it doesn't have the MySQL TABLE object.

  rb://49 approved by Heikki Tuuri
  ------------------------------------------------------------------------
2010-06-29 14:32:48 +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
Vasil Dimov
8847387ecd Disable UNIV_DEBUG when WITH_DEBUG is enabled
It causes lots of failures due to
Bug#54861 Additional connections not handled properly in mtr --embedded
should be re-enabled when that bug is resolved
2010-06-28 15:52:24 +03:00
Alexander Nozdrin
8f521b41ba Backport of revid:ingo.struewing@sun.com-20091223200354-r2uzbdkj2v6yv111
Bug#47633 - assert in ha_myisammrg::info during OPTIMIZE
 
   The server crashed on an attempt to optimize a MERGE table with
   non-existent child table.
 
   mysql_admin_table() relied on the table to be successfully open
   if a table object had been allocated.
 
   Changed code to check return value of the open function before
   calling a handler:: function on it.

mysql-test/r/merge.result:
  Backport of revid:ingo.struewing@sun.com-20091223200354-r2uzbdkj2v6yv111
      Bug#47633 - assert in ha_myisammrg::info during OPTIMIZE
      Updated result file.
mysql-test/t/merge.test:
  Backport of revid:ingo.struewing@sun.com-20091223200354-r2uzbdkj2v6yv111
      Bug#47633 - assert in ha_myisammrg::info during OPTIMIZE
      Changed tests to respect changed TEMPORARY MERGE locking (unrelated).
      Changed tests to respect changed CREATE TABLE ... LIKE (unrelated).
      Changed tests to respect that no new tables can be created
      under LOCK TABLE (unrelated).
      Added test for Bug#47633.
  Changed error numbers to symbolic names.
  Added test for child locking for ALTER under LOCK TABLE.
  
  Since Bug 36171 is not pushed yet, not the whole patch has been backported.
mysys/my_delete.c:
  Backport of revid:ingo.struewing@sun.com-20091223200354-r2uzbdkj2v6yv111
      Bug#47633 - assert in ha_myisammrg::info during OPTIMIZE
      Fixed error reporting.
      Fixed indentation.
mysys/my_mmap.c:
  Backport of revid:ingo.struewing@sun.com-20091223200354-r2uzbdkj2v6yv111
      Bug#47633 - assert in ha_myisammrg::info during OPTIMIZE
      Added DBUG.
sql/item_func.cc:
  Backport of revid:ingo.struewing@sun.com-20091223200354-r2uzbdkj2v6yv111
  Added Debug Sync point, required by merge_sync.test.
sql/sql_table.cc:
  Backport of revid:ingo.struewing@sun.com-20091223200354-r2uzbdkj2v6yv111
      Bug#47633 - assert in ha_myisammrg::info during OPTIMIZE
      Do not call handler:: functions if the table was not opened
      successfully.
  Added Debug Sync point, required by merge_sync.test.
storage/myisam/mi_check.c:
  Backport of revid:ingo.struewing@sun.com-20091223200354-r2uzbdkj2v6yv111
      Bug#47633 - assert in ha_myisammrg::info during OPTIMIZE
      Unmap memory before exchanging data files. Needed on Windows.
storage/myisammrg/ha_myisammrg.cc:
  Backport of revid:ingo.struewing@sun.com-20091223200354-r2uzbdkj2v6yv111
  Added Debug Sync point, required by merge_sync.test.
  
  merge_sync.test will be introduced by a patch for Bug 36171,
  which is not pushed yet.
2010-06-25 19:32:59 +04: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
2844ae6be9 Merge a lost changeset inaam.rana@oracle.com-20100624124450-2m3mg1238ewvakgx 2010-06-25 11:08:52 +03:00
Jimmy Yang
dcbca85bb0 Moved fix for Bug#54044 to security branch. Undo revno:3116 2010-06-24 22:14:20 -07:00
Sunny Bains
1d329468ab Fix bug#54583. This change reverses r1530 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 12:59:37 +10:00
Inaam Rana
4cf3e93339 Add ChangeLog for bug#39168 2010-06-24 08:44:50 -04:00
Marko Mäkelä
e375c45c29 Merge Bug #54679 fix from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3523
revision-id: marko.makela@oracle.com-20100624104620-pklunowaigv7quu9
parent: jimmy.yang@oracle.com-20100624021010-oh2hnp8e1xbaax6u
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Thu 2010-06-24 13:46:20 +0300
message:
  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 14:06:52 +03: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
1082c98d97 Port fix for bug #54044 from mysql-5.1-security to mysql-trunk-security:
------------------------------------------------------------
revno: 3438
committer: Jimmy Yang <jimmy.yang@oracle.com>
branch nick: mysql-5.1-security
timestamp: Thu 2010-06-24 01:20:25 -0700
message:
  Fix Bug #54044 Create temporary tables and using innodb crashes.
2010-06-24 01:49:22 -07:00
Jimmy Yang
f2dfe5e8a5 Fix Bug #54044 Create temporary tables and using innodb crashes. 2010-06-24 01:20:25 -07:00
Marko Mäkelä
2ad32ccf79 trx_undo_parse_page_header(): Silence a bogus warning. 2010-06-24 10:21:40 +03:00
Marko Mäkelä
0c5a717d8e After-review cleanup of Bug#57428: replace the dulint struct with a 64-bit int
trx_undo_build_roll_ptr(): Clarify the assertion on is_insert being 0 or 1.

TRX_SYS_FILE_FORMAT_TAG: Remove "extra" space after period in the comment.
See also http://desktoppub.about.com/cs/typespacing/a/onetwospaces.htm
2010-06-24 09:09:29 +03:00
Marko Mäkelä
1703834dd9 mach_ull_parse_compressed(): Move to .ic file to silence a GCC warning
about trx_id being possibly uninitialized in trx_undo_parse_page_header().
The warning remains when UNIV_DEBUG or UNIV_MUST_NOT_INLINE is enabled.
2010-06-24 09:08:42 +03:00
Marko Mäkelä
bdf60d165f ut_ull_create(): Fix a typo in ut_ad(): ULINT32_MASK instead of ULINT32_MAX. 2010-06-24 09:01:46 +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