Commit 8f18616e authored by marko's avatar marko

Reindent the code base (except for ha_innodb.{cc,h} and generated parser

and lexer files).  From now on, the following Emacs cc-mode settings apply
when indenting C function bodies in InnoDB:

(setq c-basic-offset 8)
(setq c-label-minimum-indentation 0)
(add-to-list 'c-offsets-alist '(c . 0))
(add-to-list 'c-offsets-alist '(label . [0]))

The indentation rules for function declarations still have not been
formalized, and they must be formatted manually.

Try to limit all lines to at most 79 characters (assuming TAB stops every
8 characters) by splitting lines before opening parenthesis, or at
string constants.

Fix some grammar mistakes in diagnostic output:
 match to, match with -> match
 found from -> found in
 trying rename -> trying to rename

Fix an error in page_check_dir(): it said "supremum not pointed to"
when the infimum was not pointed to.

Enclose commented-out code snippets in #if 0 ... #endif instead of /* ... */.
Add (void*) casts to some %p parameters in fprintf() calls.  Try to
split lines before a binary operator, not after one.  (These three fixes
were not made everywhere.)
parent bd338ceb
This diff is collapsed.
This diff is collapsed.
...@@ -133,14 +133,13 @@ btr_pcur_store_position( ...@@ -133,14 +133,13 @@ btr_pcur_store_position(
} }
cursor->old_stored = BTR_PCUR_OLD_STORED; cursor->old_stored = BTR_PCUR_OLD_STORED;
cursor->old_rec = dict_tree_copy_rec_order_prefix(tree, rec, cursor->old_rec = dict_tree_copy_rec_order_prefix
&cursor->old_n_fields, (tree, rec, &cursor->old_n_fields,
&cursor->old_rec_buf, &cursor->old_rec_buf, &cursor->buf_size);
&cursor->buf_size);
cursor->block_when_stored = buf_block_align(page); cursor->block_when_stored = buf_block_align(page);
cursor->modify_clock = buf_block_get_modify_clock( cursor->modify_clock = buf_block_get_modify_clock
cursor->block_when_stored); (cursor->block_when_stored);
} }
/****************************************************************** /******************************************************************
...@@ -216,14 +215,15 @@ btr_pcur_restore_position( ...@@ -216,14 +215,15 @@ btr_pcur_restore_position(
ut_error; ut_error;
} }
if (UNIV_UNLIKELY(cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE if (UNIV_UNLIKELY
(cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE
|| cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE)) { || cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE)) {
/* In these cases we do not try an optimistic restoration, /* In these cases we do not try an optimistic restoration,
but always do a search */ but always do a search */
btr_cur_open_at_index_side( btr_cur_open_at_index_side
cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE, (cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE,
btr_pcur_get_btr_cur(cursor)->index, latch_mode, btr_pcur_get_btr_cur(cursor)->index, latch_mode,
btr_pcur_get_btr_cur(cursor), mtr); btr_pcur_get_btr_cur(cursor), mtr);
...@@ -242,7 +242,8 @@ btr_pcur_restore_position( ...@@ -242,7 +242,8 @@ btr_pcur_restore_position(
|| UNIV_LIKELY(latch_mode == BTR_MODIFY_LEAF)) { || UNIV_LIKELY(latch_mode == BTR_MODIFY_LEAF)) {
/* Try optimistic restoration */ /* Try optimistic restoration */
if (UNIV_LIKELY(buf_page_optimistic_get(latch_mode, if (UNIV_LIKELY
(buf_page_optimistic_get(latch_mode,
cursor->block_when_stored, page, cursor->block_when_stored, page,
cursor->modify_clock, mtr))) { cursor->modify_clock, mtr))) {
cursor->pos_state = BTR_PCUR_IS_POSITIONED; cursor->pos_state = BTR_PCUR_IS_POSITIONED;
...@@ -262,14 +263,16 @@ btr_pcur_restore_position( ...@@ -262,14 +263,16 @@ btr_pcur_restore_position(
index = btr_pcur_get_btr_cur(cursor)->index; index = btr_pcur_get_btr_cur(cursor)->index;
heap = mem_heap_create(256); heap = mem_heap_create(256);
offsets1 = rec_get_offsets(cursor->old_rec, offsets1 = rec_get_offsets
index, NULL, (cursor->old_rec, index, NULL,
cursor->old_n_fields, &heap); cursor->old_n_fields, &heap);
offsets2 = rec_get_offsets(rec, index, NULL, offsets2 = rec_get_offsets
(rec, index, NULL,
cursor->old_n_fields, &heap); cursor->old_n_fields, &heap);
ut_ad(cmp_rec_rec(cursor->old_rec, ut_ad(!cmp_rec_rec(cursor->old_rec,
rec, offsets1, offsets2, index) == 0); rec, offsets1, offsets2,
index));
mem_heap_free(heap); mem_heap_free(heap);
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
return(TRUE); return(TRUE);
...@@ -308,7 +311,8 @@ btr_pcur_restore_position( ...@@ -308,7 +311,8 @@ btr_pcur_restore_position(
if (cursor->rel_pos == BTR_PCUR_ON if (cursor->rel_pos == BTR_PCUR_ON
&& btr_pcur_is_on_user_rec(cursor, mtr) && btr_pcur_is_on_user_rec(cursor, mtr)
&& 0 == cmp_dtuple_rec(tuple, btr_pcur_get_rec(cursor), && 0 == cmp_dtuple_rec(tuple, btr_pcur_get_rec(cursor),
rec_get_offsets(btr_pcur_get_rec(cursor), rec_get_offsets
(btr_pcur_get_rec(cursor),
btr_pcur_get_btr_cur(cursor)->index, btr_pcur_get_btr_cur(cursor)->index,
NULL, ULINT_UNDEFINED, &heap))) { NULL, ULINT_UNDEFINED, &heap))) {
......
...@@ -432,8 +432,9 @@ btr_search_update_hash_ref( ...@@ -432,8 +432,9 @@ btr_search_update_hash_ref(
} }
tree_id = ((cursor->index)->tree)->id; tree_id = ((cursor->index)->tree)->id;
fold = rec_fold(rec, rec_get_offsets(rec, cursor->index, fold = rec_fold(rec,
offsets_, ULINT_UNDEFINED, &heap), rec_get_offsets(rec, cursor->index, offsets_,
ULINT_UNDEFINED, &heap),
block->curr_n_fields, block->curr_n_fields,
block->curr_n_bytes, tree_id); block->curr_n_bytes, tree_id);
if (UNIV_LIKELY_NULL(heap)) { if (UNIV_LIKELY_NULL(heap)) {
...@@ -617,8 +618,8 @@ btr_search_check_guess( ...@@ -617,8 +618,8 @@ btr_search_check_guess(
prev_rec = page_rec_get_prev(rec); prev_rec = page_rec_get_prev(rec);
if (page_rec_is_infimum(prev_rec)) { if (page_rec_is_infimum(prev_rec)) {
success = btr_page_get_prev( success = btr_page_get_prev
buf_frame_align(prev_rec), mtr) == FIL_NULL; (buf_frame_align(prev_rec), mtr) == FIL_NULL;
goto exit_func; goto exit_func;
} }
...@@ -642,8 +643,8 @@ btr_search_check_guess( ...@@ -642,8 +643,8 @@ btr_search_check_guess(
next_rec = page_rec_get_next(rec); next_rec = page_rec_get_next(rec);
if (page_rec_is_supremum(next_rec)) { if (page_rec_is_supremum(next_rec)) {
if (btr_page_get_next( if (btr_page_get_next
buf_frame_align(next_rec), mtr) == FIL_NULL) { (buf_frame_align(next_rec), mtr) == FIL_NULL) {
cursor->up_match = 0; cursor->up_match = 0;
success = TRUE; success = TRUE;
...@@ -762,10 +763,10 @@ btr_search_guess_on_hash( ...@@ -762,10 +763,10 @@ btr_search_guess_on_hash(
if (UNIV_LIKELY(!has_search_latch)) { if (UNIV_LIKELY(!has_search_latch)) {
if (UNIV_UNLIKELY(!buf_page_get_known_nowait(latch_mode, page, if (UNIV_UNLIKELY
(!buf_page_get_known_nowait(latch_mode, page,
BUF_MAKE_YOUNG, BUF_MAKE_YOUNG,
__FILE__, __LINE__, __FILE__, __LINE__, mtr))) {
mtr))) {
goto failure_unlock; goto failure_unlock;
} }
...@@ -802,7 +803,8 @@ btr_search_guess_on_hash( ...@@ -802,7 +803,8 @@ btr_search_guess_on_hash(
right. */ right. */
if (UNIV_EXPECT(ut_dulint_cmp(tree_id, btr_page_get_index_id(page)), 0) if (UNIV_EXPECT(ut_dulint_cmp(tree_id, btr_page_get_index_id(page)), 0)
|| !btr_search_check_guess(cursor, || !btr_search_check_guess(cursor,
can_only_compare_to_cursor_rec, tuple, mode, mtr)) { can_only_compare_to_cursor_rec,
tuple, mode, mtr)) {
if (UNIV_LIKELY(!has_search_latch)) { if (UNIV_LIKELY(!has_search_latch)) {
btr_leaf_page_release(page, latch_mode, mtr); btr_leaf_page_release(page, latch_mode, mtr);
} }
...@@ -1029,8 +1031,10 @@ cleanup: ...@@ -1029,8 +1031,10 @@ cleanup:
/* Corruption */ /* Corruption */
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Corruption of adaptive hash index. After dropping\n" " InnoDB: Corruption of adaptive hash index."
"InnoDB: the hash index to a page of %s, still %lu hash nodes remain.\n", " After dropping\n"
"InnoDB: the hash index to a page of %s,"
" still %lu hash nodes remain.\n",
index->name, (ulong) block->n_pointers); index->name, (ulong) block->n_pointers);
rw_lock_x_unlock(&btr_search_latch); rw_lock_x_unlock(&btr_search_latch);
...@@ -1378,8 +1382,8 @@ btr_search_update_hash_on_delete( ...@@ -1378,8 +1382,8 @@ btr_search_update_hash_on_delete(
tree_id = cursor->index->tree->id; tree_id = cursor->index->tree->id;
fold = rec_fold(rec, rec_get_offsets(rec, cursor->index, offsets_, fold = rec_fold(rec, rec_get_offsets(rec, cursor->index, offsets_,
ULINT_UNDEFINED, &heap), block->curr_n_fields, ULINT_UNDEFINED, &heap),
block->curr_n_bytes, tree_id); block->curr_n_fields, block->curr_n_bytes, tree_id);
if (UNIV_LIKELY_NULL(heap)) { if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap); mem_heap_free(heap);
} }
...@@ -1570,11 +1574,11 @@ check_next_rec: ...@@ -1570,11 +1574,11 @@ check_next_rec:
if (side == BTR_SEARCH_RIGHT_SIDE) { if (side == BTR_SEARCH_RIGHT_SIDE) {
ha_insert_for_fold(table, ins_fold, ins_rec); ha_insert_for_fold(table, ins_fold, ins_rec);
/* /*
fputs("Hash insert for ", stderr); fputs("Hash insert for ", stderr);
dict_index_name_print(stderr, cursor->index); dict_index_name_print(stderr, cursor->index);
fprintf(stderr, " fold %lu\n", ins_fold); fprintf(stderr, " fold %lu\n", ins_fold);
*/ */
} else { } else {
ha_insert_for_fold(table, next_fold, next_rec); ha_insert_for_fold(table, next_fold, next_rec);
} }
...@@ -1635,10 +1639,11 @@ btr_search_validate(void) ...@@ -1635,10 +1639,11 @@ btr_search_validate(void)
offsets = rec_get_offsets((rec_t*) node->data, offsets = rec_get_offsets((rec_t*) node->data,
block->index, offsets, block->index, offsets,
block->curr_n_fields block->curr_n_fields
+ (block->curr_n_bytes > 0), &heap); + (block->curr_n_bytes > 0),
&heap);
if (!block->is_hashed if (!block->is_hashed || node->fold
|| node->fold != rec_fold((rec_t*)(node->data), != rec_fold((rec_t*)(node->data),
offsets, offsets,
block->curr_n_fields, block->curr_n_fields,
block->curr_n_bytes, block->curr_n_bytes,
...@@ -1647,28 +1652,36 @@ btr_search_validate(void) ...@@ -1647,28 +1652,36 @@ btr_search_validate(void)
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Error in an adaptive hash index pointer to page %lu\n" " InnoDB: Error in an adaptive hash"
"ptr mem address %p index id %lu %lu, node fold %lu, rec fold %lu\n", " index pointer to page %lu\n"
"InnoDB: ptr mem address %p"
" index id %lu %lu,"
" node fold %lu, rec fold %lu\n",
(ulong) buf_frame_get_page_no(page), (ulong) buf_frame_get_page_no(page),
node->data, node->data,
(ulong) ut_dulint_get_high(btr_page_get_index_id(page)), (ulong) ut_dulint_get_high
(ulong) ut_dulint_get_low(btr_page_get_index_id(page)), (btr_page_get_index_id(page)),
(ulong) ut_dulint_get_low
(btr_page_get_index_id(page)),
(ulong) node->fold, (ulong) node->fold,
(ulong) rec_fold((rec_t*)(node->data), (ulong) rec_fold((rec_t*)(node->data),
offsets, offsets,
block->curr_n_fields, block->curr_n_fields,
block->curr_n_bytes, block->curr_n_bytes,
btr_page_get_index_id(page))); btr_page_get_index_id
(page)));
fputs("InnoDB: Record ", stderr); fputs("InnoDB: Record ", stderr);
rec_print_new(stderr, (rec_t*)node->data, rec_print_new(stderr, (rec_t*)node->data,
offsets); offsets);
fprintf(stderr, "\nInnoDB: on that page." fprintf(stderr, "\nInnoDB: on that page."
"Page mem address %p, is hashed %lu, n fields %lu, n bytes %lu\n" " Page mem address %p, is hashed %lu,"
"side %lu\n", " n fields %lu, n bytes %lu\n"
page, (ulong) block->is_hashed, "InnoDB: side %lu\n",
(void*) page, (ulong) block->is_hashed,
(ulong) block->curr_n_fields, (ulong) block->curr_n_fields,
(ulong) block->curr_n_bytes, (ulong) block->curr_side); (ulong) block->curr_n_bytes,
(ulong) block->curr_side);
if (n_page_dumps < 20) { if (n_page_dumps < 20) {
buf_page_print(page); buf_page_print(page);
......
This diff is collapsed.
...@@ -118,7 +118,8 @@ buf_flush_ready_for_replace( ...@@ -118,7 +118,8 @@ buf_flush_ready_for_replace(
if (block->state != BUF_BLOCK_FILE_PAGE) { if (block->state != BUF_BLOCK_FILE_PAGE) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Error: buffer block state %lu in the LRU list!\n", " InnoDB: Error: buffer block state %lu"
" in the LRU list!\n",
(ulong)block->state); (ulong)block->state);
ut_print_buf(stderr, block, sizeof(buf_block_t)); ut_print_buf(stderr, block, sizeof(buf_block_t));
...@@ -259,9 +260,12 @@ buf_flush_buffered_writes(void) ...@@ -259,9 +260,12 @@ buf_flush_buffered_writes(void)
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) { - FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n" " InnoDB: ERROR: The page to be written"
"InnoDB: The lsn fields do not match! Noticed in the buffer pool\n" " seems corrupt!\n"
"InnoDB: before posting to the doublewrite buffer.\n"); "InnoDB: The lsn fields do not match!"
" Noticed in the buffer pool\n"
"InnoDB: before posting to the"
" doublewrite buffer.\n");
} }
if (block->check_index_page_at_flush if (block->check_index_page_at_flush
...@@ -271,9 +275,12 @@ buf_flush_buffered_writes(void) ...@@ -271,9 +275,12 @@ buf_flush_buffered_writes(void)
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Apparent corruption of an index page n:o %lu in space %lu\n" " InnoDB: Apparent corruption of an"
"InnoDB: to be written to data file. We intentionally crash server\n" " index page n:o %lu in space %lu\n"
"InnoDB: to prevent corrupt data from ending up in data\n" "InnoDB: to be written to data file."
" We intentionally crash server\n"
"InnoDB: to prevent corrupt data"
" from ending up in data\n"
"InnoDB: files.\n", "InnoDB: files.\n",
(ulong) block->offset, (ulong) block->space); (ulong) block->offset, (ulong) block->space);
...@@ -304,8 +311,10 @@ buf_flush_buffered_writes(void) ...@@ -304,8 +311,10 @@ buf_flush_buffered_writes(void)
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) { - FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n" " InnoDB: ERROR: The page to be written"
"InnoDB: The lsn fields do not match! Noticed in the doublewrite block1.\n"); " seems corrupt!\n"
"InnoDB: The lsn fields do not match!"
" Noticed in the doublewrite block1.\n");
} }
} }
...@@ -317,7 +326,8 @@ buf_flush_buffered_writes(void) ...@@ -317,7 +326,8 @@ buf_flush_buffered_writes(void)
TRUE, TRX_SYS_SPACE, TRUE, TRX_SYS_SPACE,
trx_doublewrite->block2, 0, len, trx_doublewrite->block2, 0, len,
(void*)(trx_doublewrite->write_buf (void*)(trx_doublewrite->write_buf
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE), + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE
* UNIV_PAGE_SIZE),
NULL); NULL);
write_buf = trx_doublewrite->write_buf write_buf = trx_doublewrite->write_buf
...@@ -328,11 +338,15 @@ buf_flush_buffered_writes(void) ...@@ -328,11 +338,15 @@ buf_flush_buffered_writes(void)
+ FIL_PAGE_LSN + 4) + FIL_PAGE_LSN + 4)
!= mach_read_from_4(write_buf + len2 != mach_read_from_4(write_buf + len2
+ UNIV_PAGE_SIZE + UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) { - FIL_PAGE_END_LSN_OLD_CHKSUM
+ 4)) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n" " InnoDB: ERROR: The page to be"
"InnoDB: The lsn fields do not match! Noticed in the doublewrite block2.\n"); " written seems corrupt!\n"
"InnoDB: The lsn fields do not match!"
" Noticed in"
" the doublewrite block2.\n");
} }
} }
} }
...@@ -353,10 +367,14 @@ buf_flush_buffered_writes(void) ...@@ -353,10 +367,14 @@ buf_flush_buffered_writes(void)
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) { - FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n" " InnoDB: ERROR: The page to be written"
"InnoDB: The lsn fields do not match! Noticed in the buffer pool\n" " seems corrupt!\n"
"InnoDB: after posting and flushing the doublewrite buffer.\n" "InnoDB: The lsn fields do not match!"
"InnoDB: Page buf fix count %lu, io fix %lu, state %lu\n", " Noticed in the buffer pool\n"
"InnoDB: after posting and flushing"
" the doublewrite buffer.\n"
"InnoDB: Page buf fix count %lu,"
" io fix %lu, state %lu\n",
(ulong)block->buf_fix_count, (ulong)block->buf_fix_count,
(ulong)block->io_fix, (ulong)block->io_fix,
(ulong)block->state); (ulong)block->state);
...@@ -457,8 +475,9 @@ buf_flush_init_for_writing( ...@@ -457,8 +475,9 @@ buf_flush_init_for_writing(
/* Store the new formula checksum */ /* Store the new formula checksum */
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
srv_use_checksums ? srv_use_checksums
buf_calc_page_new_checksum(page) : BUF_NO_CHECKSUM_MAGIC); ? buf_calc_page_new_checksum(page)
: BUF_NO_CHECKSUM_MAGIC);
/* We overwrite the first 4 bytes of the end lsn field to store /* We overwrite the first 4 bytes of the end lsn field to store
the old formula checksum. Since it depends also on the field the old formula checksum. Since it depends also on the field
...@@ -466,8 +485,9 @@ buf_flush_init_for_writing( ...@@ -466,8 +485,9 @@ buf_flush_init_for_writing(
new formula checksum. */ new formula checksum. */
mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM, mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
srv_use_checksums ? srv_use_checksums
buf_calc_page_old_checksum(page) : BUF_NO_CHECKSUM_MAGIC); ? buf_calc_page_old_checksum(page)
: BUF_NO_CHECKSUM_MAGIC);
} }
/************************************************************************ /************************************************************************
...@@ -494,7 +514,8 @@ buf_flush_write_block_low( ...@@ -494,7 +514,8 @@ buf_flush_write_block_low(
if (!univ_log_debug_warned) { if (!univ_log_debug_warned) {
univ_log_debug_warned = TRUE; univ_log_debug_warned = TRUE;
fputs( fputs(
"Warning: cannot force log to disk if UNIV_LOG_DEBUG is defined!\n" "Warning: cannot force log to disk if"
" UNIV_LOG_DEBUG is defined!\n"
"Crash recovery will not work!\n", "Crash recovery will not work!\n",
stderr); stderr);
} }
...@@ -680,7 +701,8 @@ buf_flush_try_page( ...@@ -680,7 +701,8 @@ buf_flush_try_page(
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
if (buf_debug_prints) { if (buf_debug_prints) {
fprintf(stderr, fprintf(stderr,
"Flushing single page space %lu, page no %lu \n", "Flushing single page space %lu,"
" page no %lu \n",
(ulong) block->space, (ulong) block->space,
(ulong) block->offset); (ulong) block->offset);
} }
......
...@@ -216,7 +216,8 @@ buf_LRU_search_and_free_block( ...@@ -216,7 +216,8 @@ buf_LRU_search_and_free_block(
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
if (buf_debug_prints) { if (buf_debug_prints) {
fprintf(stderr, fprintf(stderr,
"Putting space %lu page %lu to free list\n", "Putting space %lu page %lu"
" to free list\n",
(ulong) block->space, (ulong) block->space,
(ulong) block->offset); (ulong) block->offset);
} }
...@@ -344,14 +345,19 @@ loop: ...@@ -344,14 +345,19 @@ loop:
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: ERROR: over 95 percent of the buffer pool is occupied by\n" " InnoDB: ERROR: over 95 percent of the buffer pool"
"InnoDB: lock heaps or the adaptive hash index! Check that your\n" " is occupied by\n"
"InnoDB: transactions do not set too many row locks.\n" "InnoDB: lock heaps or the adaptive hash index!"
"InnoDB: Your buffer pool size is %lu MB. Maybe you should make\n" " Check that your\n"
"InnoDB: the buffer pool bigger?\n" "InnoDB: transactions do not set too many row locks.\n"
"InnoDB: We intentionally generate a seg fault to print a stack trace\n" "InnoDB: Your buffer pool size is %lu MB."
"InnoDB: on Linux!\n", " Maybe you should make\n"
(ulong)(buf_pool->curr_size / (1024 * 1024 / UNIV_PAGE_SIZE))); "InnoDB: the buffer pool bigger?\n"
"InnoDB: We intentionally generate a seg fault"
" to print a stack trace\n"
"InnoDB: on Linux!\n",
(ulong) (buf_pool->curr_size
/ (1024 * 1024 / UNIV_PAGE_SIZE)));
ut_error; ut_error;
...@@ -366,14 +372,20 @@ loop: ...@@ -366,14 +372,20 @@ loop:
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: WARNING: over 67 percent of the buffer pool is occupied by\n" " InnoDB: WARNING: over 67 percent of"
"InnoDB: lock heaps or the adaptive hash index! Check that your\n" " the buffer pool is occupied by\n"
"InnoDB: transactions do not set too many row locks.\n" "InnoDB: lock heaps or the adaptive"
"InnoDB: Your buffer pool size is %lu MB. Maybe you should make\n" " hash index! Check that your\n"
"InnoDB: the buffer pool bigger?\n" "InnoDB: transactions do not set too many"
"InnoDB: Starting the InnoDB Monitor to print diagnostics, including\n" " row locks.\n"
"InnoDB: lock heap and hash index sizes.\n", "InnoDB: Your buffer pool size is %lu MB."
(ulong) (buf_pool->curr_size / (1024 * 1024 / UNIV_PAGE_SIZE))); " Maybe you should make\n"
"InnoDB: the buffer pool bigger?\n"
"InnoDB: Starting the InnoDB Monitor to print"
" diagnostics, including\n"
"InnoDB: lock heap and hash index sizes.\n",
(ulong) (buf_pool->curr_size
/ (1024 * 1024 / UNIV_PAGE_SIZE)));
buf_lru_switched_on_innodb_mon = TRUE; buf_lru_switched_on_innodb_mon = TRUE;
srv_print_innodb_monitor = TRUE; srv_print_innodb_monitor = TRUE;
...@@ -405,7 +417,8 @@ loop: ...@@ -405,7 +417,8 @@ loop:
/* Remove from the list of mapped pages */ /* Remove from the list of mapped pages */
UT_LIST_REMOVE(awe_LRU_free_mapped, UT_LIST_REMOVE(awe_LRU_free_mapped,
buf_pool->awe_LRU_free_mapped, block); buf_pool->awe_LRU_free_mapped,
block);
} else { } else {
/* We map the page to a frame; second param /* We map the page to a frame; second param
FALSE below because we do not want it to be FALSE below because we do not want it to be
...@@ -441,15 +454,22 @@ loop: ...@@ -441,15 +454,22 @@ loop:
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Warning: difficult to find free blocks from\n" "InnoDB: Warning: difficult to find free blocks from\n"
"InnoDB: the buffer pool (%lu search iterations)! Consider\n" "InnoDB: the buffer pool (%lu search iterations)!"
" Consider\n"
"InnoDB: increasing the buffer pool size.\n" "InnoDB: increasing the buffer pool size.\n"
"InnoDB: It is also possible that in your Unix version\n" "InnoDB: It is also possible that"
"InnoDB: fsync is very slow, or completely frozen inside\n" " in your Unix version\n"
"InnoDB: the OS kernel. Then upgrading to a newer version\n" "InnoDB: fsync is very slow, or"
"InnoDB: of your operating system may help. Look at the\n" " completely frozen inside\n"
"InnoDB: the OS kernel. Then upgrading to"
" a newer version\n"
"InnoDB: of your operating system may help."
" Look at the\n"
"InnoDB: number of fsyncs in diagnostic info below.\n" "InnoDB: number of fsyncs in diagnostic info below.\n"
"InnoDB: Pending flushes (fsync) log: %lu; buffer pool: %lu\n" "InnoDB: Pending flushes (fsync) log: %lu;"
"InnoDB: %lu OS file reads, %lu OS file writes, %lu OS fsyncs\n" " buffer pool: %lu\n"
"InnoDB: %lu OS file reads, %lu OS file writes,"
" %lu OS fsyncs\n"
"InnoDB: Starting InnoDB Monitor to print further\n" "InnoDB: Starting InnoDB Monitor to print further\n"
"InnoDB: diagnostics to the standard output.\n", "InnoDB: diagnostics to the standard output.\n",
(ulong) n_iterations, (ulong) n_iterations,
...@@ -522,16 +542,16 @@ buf_LRU_old_adjust_len(void) ...@@ -522,16 +542,16 @@ buf_LRU_old_adjust_len(void)
if (old_len < new_len - BUF_LRU_OLD_TOLERANCE) { if (old_len < new_len - BUF_LRU_OLD_TOLERANCE) {
buf_pool->LRU_old = UT_LIST_GET_PREV(LRU, buf_pool->LRU_old = UT_LIST_GET_PREV
buf_pool->LRU_old); (LRU, buf_pool->LRU_old);
(buf_pool->LRU_old)->old = TRUE; (buf_pool->LRU_old)->old = TRUE;
buf_pool->LRU_old_len++; buf_pool->LRU_old_len++;
} else if (old_len > new_len + BUF_LRU_OLD_TOLERANCE) { } else if (old_len > new_len + BUF_LRU_OLD_TOLERANCE) {
(buf_pool->LRU_old)->old = FALSE; (buf_pool->LRU_old)->old = FALSE;
buf_pool->LRU_old = UT_LIST_GET_NEXT(LRU, buf_pool->LRU_old = UT_LIST_GET_NEXT
buf_pool->LRU_old); (LRU, buf_pool->LRU_old);
buf_pool->LRU_old_len--; buf_pool->LRU_old_len--;
} else { } else {
ut_a(buf_pool->LRU_old); /* Check that we did not ut_a(buf_pool->LRU_old); /* Check that we did not
...@@ -875,15 +895,20 @@ buf_LRU_block_remove_hashed_page( ...@@ -875,15 +895,20 @@ buf_LRU_block_remove_hashed_page(
if (block != buf_page_hash_get(block->space, block->offset)) { if (block != buf_page_hash_get(block->space, block->offset)) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: page %lu %lu not found from the hash table\n", "InnoDB: Error: page %lu %lu not found"
" in the hash table\n",
(ulong) block->space, (ulong) block->space,
(ulong) block->offset); (ulong) block->offset);
if (buf_page_hash_get(block->space, block->offset)) { if (buf_page_hash_get(block->space, block->offset)) {
fprintf(stderr, fprintf(stderr,
"InnoDB: From hash table we find block %p of %lu %lu which is not %p\n", "InnoDB: In hash table we find block"
(void*) buf_page_hash_get(block->space, block->offset), " %p of %lu %lu which is not %p\n",
(ulong) buf_page_hash_get(block->space, block->offset)->space, (void*) buf_page_hash_get
(ulong) buf_page_hash_get(block->space, block->offset)->offset, (block->space, block->offset),
(ulong) buf_page_hash_get
(block->space, block->offset)->space,
(ulong) buf_page_hash_get
(block->space, block->offset)->offset,
(void*) block); (void*) block);
} }
...@@ -1009,7 +1034,8 @@ buf_LRU_print(void) ...@@ -1009,7 +1034,8 @@ buf_LRU_print(void)
ut_ad(buf_pool); ut_ad(buf_pool);
mutex_enter(&(buf_pool->mutex)); mutex_enter(&(buf_pool->mutex));
fprintf(stderr, "Pool ulint clock %lu\n", (ulong) buf_pool->ulint_clock); fprintf(stderr, "Pool ulint clock %lu\n",
(ulong) buf_pool->ulint_clock);
block = UT_LIST_GET_FIRST(buf_pool->LRU); block = UT_LIST_GET_FIRST(buf_pool->LRU);
...@@ -1042,7 +1068,8 @@ buf_LRU_print(void) ...@@ -1042,7 +1068,8 @@ buf_LRU_print(void)
fprintf(stderr, "LRU pos %lu type %lu index id %lu ", fprintf(stderr, "LRU pos %lu type %lu index id %lu ",
(ulong) block->LRU_position, (ulong) block->LRU_position,
(ulong) fil_page_get_type(frame), (ulong) fil_page_get_type(frame),
(ulong) ut_dulint_get_low(btr_page_get_index_id(frame))); (ulong) ut_dulint_get_low
(btr_page_get_index_id(frame)));
block = UT_LIST_GET_NEXT(LRU, block); block = UT_LIST_GET_NEXT(LRU, block);
if (++len == 10) { if (++len == 10) {
......
...@@ -89,7 +89,8 @@ buf_read_page_low( ...@@ -89,7 +89,8 @@ buf_read_page_low(
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE))) { + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE))) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Warning: trying to read doublewrite buffer page %lu\n", " InnoDB: Warning: trying to read"
" doublewrite buffer page %lu\n",
(ulong) offset); (ulong) offset);
return(0); return(0);
...@@ -256,15 +257,18 @@ buf_read_ahead_random( ...@@ -256,15 +257,18 @@ buf_read_ahead_random(
mode: hence FALSE as the first parameter */ mode: hence FALSE as the first parameter */
if (!ibuf_bitmap_page(i)) { if (!ibuf_bitmap_page(i)) {
count += buf_read_page_low(&err, FALSE, ibuf_mode count += buf_read_page_low
| OS_AIO_SIMULATED_WAKE_LATER, (&err, FALSE,
ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
space, tablespace_version, i); space, tablespace_version, i);
if (err == DB_TABLESPACE_DELETED) { if (err == DB_TABLESPACE_DELETED) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Warning: in random readahead trying to access tablespace\n" " InnoDB: Warning: in random"
"InnoDB: %lu page no. %lu,\n" " readahead trying to access\n"
"InnoDB: but the tablespace does not exist or is just being dropped.\n", "InnoDB: tablespace %lu page %lu,\n"
"InnoDB: but the tablespace does not"
" exist or is just being dropped.\n",
(ulong) space, (ulong) i); (ulong) space, (ulong) i);
} }
} }
...@@ -322,8 +326,10 @@ buf_read_page( ...@@ -322,8 +326,10 @@ buf_read_page(
if (err == DB_TABLESPACE_DELETED) { if (err == DB_TABLESPACE_DELETED) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Error: trying to access tablespace %lu page no. %lu,\n" " InnoDB: Error: trying to access"
"InnoDB: but the tablespace does not exist or is just being dropped.\n", " tablespace %lu page no. %lu,\n"
"InnoDB: but the tablespace does not exist"
" or is just being dropped.\n",
(ulong) space, (ulong) offset); (ulong) space, (ulong) offset);
} }
...@@ -543,15 +549,18 @@ buf_read_ahead_linear( ...@@ -543,15 +549,18 @@ buf_read_ahead_linear(
aio mode: hence FALSE as the first parameter */ aio mode: hence FALSE as the first parameter */
if (!ibuf_bitmap_page(i)) { if (!ibuf_bitmap_page(i)) {
count += buf_read_page_low(&err, FALSE, ibuf_mode count += buf_read_page_low
| OS_AIO_SIMULATED_WAKE_LATER, (&err, FALSE,
ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
space, tablespace_version, i); space, tablespace_version, i);
if (err == DB_TABLESPACE_DELETED) { if (err == DB_TABLESPACE_DELETED) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Warning: in linear readahead trying to access tablespace\n" " InnoDB: Warning: in"
"InnoDB: %lu page no. %lu,\n" " linear readahead trying to access\n"
"InnoDB: but the tablespace does not exist or is just being dropped.\n", "InnoDB: tablespace %lu page %lu,\n"
"InnoDB: but the tablespace does not"
" exist or is just being dropped.\n",
(ulong) space, (ulong) i); (ulong) space, (ulong) i);
} }
} }
...@@ -612,13 +621,11 @@ buf_read_ibuf_merge_pages( ...@@ -612,13 +621,11 @@ buf_read_ibuf_merge_pages(
} }
for (i = 0; i < n_stored; i++) { for (i = 0; i < n_stored; i++) {
if ((i + 1 == n_stored) && sync) { buf_read_page_low(&err,
buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, (i + 1 == n_stored) && sync,
space_ids[i], space_versions[i], page_nos[i]); BUF_READ_ANY_PAGE,
} else { space_ids[i], space_versions[i],
buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE, page_nos[i]);
space_ids[i], space_versions[i], page_nos[i]);
}
if (err == DB_TABLESPACE_DELETED) { if (err == DB_TABLESPACE_DELETED) {
/* We have deleted or are deleting the single-table /* We have deleted or are deleting the single-table
...@@ -679,9 +686,12 @@ buf_read_recv_pages( ...@@ -679,9 +686,12 @@ buf_read_recv_pages(
if (count > 100) { if (count > 100) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: InnoDB has waited for 50 seconds for pending\n" "InnoDB: Error: InnoDB has waited for"
"InnoDB: reads to the buffer pool to be finished.\n" " 50 seconds for pending\n"
"InnoDB: Number of pending reads %lu, pending pread calls %lu\n", "InnoDB: reads to the buffer pool to"
" be finished.\n"
"InnoDB: Number of pending reads %lu,"
" pending pread calls %lu\n",
(ulong) buf_pool->n_pend_reads, (ulong) buf_pool->n_pend_reads,
(ulong)os_file_n_pending_preads); (ulong)os_file_n_pending_preads);
...@@ -692,12 +702,14 @@ buf_read_recv_pages( ...@@ -692,12 +702,14 @@ buf_read_recv_pages(
os_aio_print_debug = FALSE; os_aio_print_debug = FALSE;
if ((i + 1 == n_stored) && sync) { if ((i + 1 == n_stored) && sync) {
buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space, buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE,
tablespace_version, page_nos[i]); space, tablespace_version,
page_nos[i]);
} else { } else {
buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE
| OS_AIO_SIMULATED_WAKE_LATER, | OS_AIO_SIMULATED_WAKE_LATER,
space, tablespace_version, page_nos[i]); space, tablespace_version,
page_nos[i]);
} }
} }
...@@ -709,7 +721,8 @@ buf_read_recv_pages( ...@@ -709,7 +721,8 @@ buf_read_recv_pages(
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
if (buf_debug_prints) { if (buf_debug_prints) {
fprintf(stderr, fprintf(stderr,
"Recovery applies read-ahead pages %lu\n", (ulong) n_stored); "Recovery applies read-ahead pages %lu\n",
(ulong) n_stored);
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
} }
...@@ -192,7 +192,7 @@ dfield_check_typed_no_assert( ...@@ -192,7 +192,7 @@ dfield_check_typed_no_assert(
|| dfield_get_type(field)->mtype < DATA_VARCHAR) { || dfield_get_type(field)->mtype < DATA_VARCHAR) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: data field type %lu, len %lu\n", "InnoDB: Error: data field type %lu, len %lu\n",
(ulong) dfield_get_type(field)->mtype, (ulong) dfield_get_type(field)->mtype,
(ulong) dfield_get_len(field)); (ulong) dfield_get_len(field));
return(FALSE); return(FALSE);
...@@ -215,9 +215,9 @@ dtuple_check_typed_no_assert( ...@@ -215,9 +215,9 @@ dtuple_check_typed_no_assert(
if (dtuple_get_n_fields(tuple) > REC_MAX_N_FIELDS) { if (dtuple_get_n_fields(tuple) > REC_MAX_N_FIELDS) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: index entry has %lu fields\n", "InnoDB: Error: index entry has %lu fields\n",
(ulong) dtuple_get_n_fields(tuple)); (ulong) dtuple_get_n_fields(tuple));
dump: dump:
fputs("InnoDB: Tuple contents: ", stderr); fputs("InnoDB: Tuple contents: ", stderr);
dtuple_print(stderr, tuple); dtuple_print(stderr, tuple);
putc('\n', stderr); putc('\n', stderr);
...@@ -250,7 +250,7 @@ dfield_check_typed( ...@@ -250,7 +250,7 @@ dfield_check_typed(
|| dfield_get_type(field)->mtype < DATA_VARCHAR) { || dfield_get_type(field)->mtype < DATA_VARCHAR) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: data field type %lu, len %lu\n", "InnoDB: Error: data field type %lu, len %lu\n",
(ulong) dfield_get_type(field)->mtype, (ulong) dfield_get_type(field)->mtype,
(ulong) dfield_get_len(field)); (ulong) dfield_get_len(field));
...@@ -518,7 +518,8 @@ dtuple_convert_big_rec( ...@@ -518,7 +518,8 @@ dtuple_convert_big_rec(
if (UNIV_UNLIKELY(size > 1000000000)) { if (UNIV_UNLIKELY(size > 1000000000)) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Warning: tuple size very big: %lu\n", (ulong) size); "InnoDB: Warning: tuple size very big: %lu\n",
(ulong) size);
fputs("InnoDB: Tuple contents: ", stderr); fputs("InnoDB: Tuple contents: ", stderr);
dtuple_print(stderr, entry); dtuple_print(stderr, entry);
putc('\n', stderr); putc('\n', stderr);
...@@ -539,8 +540,8 @@ dtuple_convert_big_rec( ...@@ -539,8 +540,8 @@ dtuple_convert_big_rec(
n_fields = 0; n_fields = 0;
while (rec_get_converted_size(index, entry) while (rec_get_converted_size(index, entry)
>= ut_min(page_get_free_space_of_empty( >= ut_min(page_get_free_space_of_empty
dict_table_is_comp(index->table)) / 2, (dict_table_is_comp(index->table)) / 2,
REC_MAX_DATA_SIZE)) { REC_MAX_DATA_SIZE)) {
longest = 0; longest = 0;
...@@ -609,8 +610,8 @@ dtuple_convert_big_rec( ...@@ -609,8 +610,8 @@ dtuple_convert_big_rec(
vector->fields[n_fields].len = dfield->len vector->fields[n_fields].len = dfield->len
- DICT_MAX_INDEX_COL_LEN; - DICT_MAX_INDEX_COL_LEN;
vector->fields[n_fields].data = mem_heap_alloc(heap, vector->fields[n_fields].data = mem_heap_alloc
vector->fields[n_fields].len); (heap, vector->fields[n_fields].len);
/* Copy data (from the end of field) to big rec vector */ /* Copy data (from the end of field) to big rec vector */
......
...@@ -67,8 +67,8 @@ dtype_get_at_most_n_mbchars( ...@@ -67,8 +67,8 @@ dtype_get_at_most_n_mbchars(
if (dtype->mbminlen != dtype->mbmaxlen) { if (dtype->mbminlen != dtype->mbmaxlen) {
ut_a(!(prefix_len % dtype->mbmaxlen)); ut_a(!(prefix_len % dtype->mbmaxlen));
return(innobase_get_at_most_n_mbchars( return(innobase_get_at_most_n_mbchars
dtype_get_charset_coll(dtype->prtype), (dtype_get_charset_coll(dtype->prtype),
prefix_len, data_len, str)); prefix_len, data_len, str));
} }
......
...@@ -236,9 +236,9 @@ dict_boot(void) ...@@ -236,9 +236,9 @@ dict_boot(void)
..._MARGIN, it will immediately be updated to the disk-based ..._MARGIN, it will immediately be updated to the disk-based
header. */ header. */
dict_sys->row_id = ut_dulint_add( dict_sys->row_id = ut_dulint_add
ut_dulint_align_up( (ut_dulint_align_up(mtr_read_dulint
mtr_read_dulint(dict_hdr + DICT_HDR_ROW_ID, &mtr), (dict_hdr + DICT_HDR_ROW_ID, &mtr),
DICT_HDR_ROW_ID_WRITE_MARGIN), DICT_HDR_ROW_ID_WRITE_MARGIN),
DICT_HDR_ROW_ID_WRITE_MARGIN); DICT_HDR_ROW_ID_WRITE_MARGIN);
...@@ -262,14 +262,16 @@ dict_boot(void) ...@@ -262,14 +262,16 @@ dict_boot(void)
dict_sys->sys_tables = table; dict_sys->sys_tables = table;
index = dict_mem_index_create("SYS_TABLES", "CLUST_IND", index = dict_mem_index_create("SYS_TABLES", "CLUST_IND",
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 1); DICT_HDR_SPACE,
DICT_UNIQUE | DICT_CLUSTERED, 1);
dict_mem_index_add_field(index, "NAME", 0); dict_mem_index_add_field(index, "NAME", 0);
index->id = DICT_TABLES_ID; index->id = DICT_TABLES_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint( success = dict_index_add_to_cache(table, index, mtr_read_ulint
dict_hdr + DICT_HDR_TABLES, MLOG_4BYTES, &mtr)); (dict_hdr + DICT_HDR_TABLES,
MLOG_4BYTES, &mtr));
ut_a(success); ut_a(success);
/*-------------------------*/ /*-------------------------*/
index = dict_mem_index_create("SYS_TABLES", "ID_IND", index = dict_mem_index_create("SYS_TABLES", "ID_IND",
...@@ -277,8 +279,10 @@ dict_boot(void) ...@@ -277,8 +279,10 @@ dict_boot(void)
dict_mem_index_add_field(index, "ID", 0); dict_mem_index_add_field(index, "ID", 0);
index->id = DICT_TABLE_IDS_ID; index->id = DICT_TABLE_IDS_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint( success = dict_index_add_to_cache(table, index,
dict_hdr + DICT_HDR_TABLE_IDS, MLOG_4BYTES, &mtr)); mtr_read_ulint
(dict_hdr + DICT_HDR_TABLE_IDS,
MLOG_4BYTES, &mtr));
ut_a(success); ut_a(success);
/*-------------------------*/ /*-------------------------*/
table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, 0); table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, 0);
...@@ -297,14 +301,16 @@ dict_boot(void) ...@@ -297,14 +301,16 @@ dict_boot(void)
dict_sys->sys_columns = table; dict_sys->sys_columns = table;
index = dict_mem_index_create("SYS_COLUMNS", "CLUST_IND", index = dict_mem_index_create("SYS_COLUMNS", "CLUST_IND",
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2); DICT_HDR_SPACE,
DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, "TABLE_ID", 0); dict_mem_index_add_field(index, "TABLE_ID", 0);
dict_mem_index_add_field(index, "POS", 0); dict_mem_index_add_field(index, "POS", 0);
index->id = DICT_COLUMNS_ID; index->id = DICT_COLUMNS_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint( success = dict_index_add_to_cache(table, index, mtr_read_ulint
dict_hdr + DICT_HDR_COLUMNS, MLOG_4BYTES, &mtr)); (dict_hdr + DICT_HDR_COLUMNS,
MLOG_4BYTES, &mtr));
ut_a(success); ut_a(success);
/*-------------------------*/ /*-------------------------*/
table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, 0); table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, 0);
...@@ -333,14 +339,16 @@ dict_boot(void) ...@@ -333,14 +339,16 @@ dict_boot(void)
dict_sys->sys_indexes = table; dict_sys->sys_indexes = table;
index = dict_mem_index_create("SYS_INDEXES", "CLUST_IND", index = dict_mem_index_create("SYS_INDEXES", "CLUST_IND",
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2); DICT_HDR_SPACE,
DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, "TABLE_ID", 0); dict_mem_index_add_field(index, "TABLE_ID", 0);
dict_mem_index_add_field(index, "ID", 0); dict_mem_index_add_field(index, "ID", 0);
index->id = DICT_INDEXES_ID; index->id = DICT_INDEXES_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint( success = dict_index_add_to_cache(table, index, mtr_read_ulint
dict_hdr + DICT_HDR_INDEXES, MLOG_4BYTES, &mtr)); (dict_hdr + DICT_HDR_INDEXES,
MLOG_4BYTES, &mtr));
ut_a(success); ut_a(success);
/*-------------------------*/ /*-------------------------*/
table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, 0); table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, 0);
...@@ -354,14 +362,16 @@ dict_boot(void) ...@@ -354,14 +362,16 @@ dict_boot(void)
dict_sys->sys_fields = table; dict_sys->sys_fields = table;
index = dict_mem_index_create("SYS_FIELDS", "CLUST_IND", index = dict_mem_index_create("SYS_FIELDS", "CLUST_IND",
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2); DICT_HDR_SPACE,
DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, "INDEX_ID", 0); dict_mem_index_add_field(index, "INDEX_ID", 0);
dict_mem_index_add_field(index, "POS", 0); dict_mem_index_add_field(index, "POS", 0);
index->id = DICT_FIELDS_ID; index->id = DICT_FIELDS_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint( success = dict_index_add_to_cache(table, index, mtr_read_ulint
dict_hdr + DICT_HDR_FIELDS, MLOG_4BYTES, &mtr)); (dict_hdr + DICT_HDR_FIELDS,
MLOG_4BYTES, &mtr));
ut_a(success); ut_a(success);
mtr_commit(&mtr); mtr_commit(&mtr);
......
...@@ -222,8 +222,8 @@ dict_build_table_def_step( ...@@ -222,8 +222,8 @@ dict_build_table_def_step(
row_len = 0; row_len = 0;
for (i = 0; i < table->n_def; i++) { for (i = 0; i < table->n_def; i++) {
row_len += dtype_get_min_size(dict_col_get_type( row_len += dtype_get_min_size(dict_col_get_type
&table->cols[i])); (&table->cols[i]));
} }
if (row_len > BTR_PAGE_MAX_REC_SIZE) { if (row_len > BTR_PAGE_MAX_REC_SIZE) {
return(DB_TOO_BIG_RECORD); return(DB_TOO_BIG_RECORD);
...@@ -251,8 +251,8 @@ dict_build_table_def_step( ...@@ -251,8 +251,8 @@ dict_build_table_def_step(
is_path = FALSE; is_path = FALSE;
} }
error = fil_create_new_single_table_tablespace( error = fil_create_new_single_table_tablespace
&(table->space), path_or_name, is_path, (&table->space, path_or_name, is_path,
FIL_IBD_FILE_INITIAL_SIZE); FIL_IBD_FILE_INITIAL_SIZE);
if (error != DB_SUCCESS) { if (error != DB_SUCCESS) {
...@@ -684,7 +684,8 @@ dict_drop_index_tree( ...@@ -684,7 +684,8 @@ dict_drop_index_tree(
btr_free_root(space, root_page_no, mtr); btr_free_root(space, root_page_no, mtr);
page_rec_write_index_page_no(rec, page_rec_write_index_page_no(rec,
DICT_SYS_INDEXES_PAGE_NO_FIELD, FIL_NULL, mtr); DICT_SYS_INDEXES_PAGE_NO_FIELD,
FIL_NULL, mtr);
} }
/*********************************************************************** /***********************************************************************
...@@ -767,8 +768,8 @@ dict_truncate_index_tree( ...@@ -767,8 +768,8 @@ dict_truncate_index_tree(
appropriate field in the SYS_INDEXES record: this mini-transaction appropriate field in the SYS_INDEXES record: this mini-transaction
marks the B-tree totally truncated */ marks the B-tree totally truncated */
comp = page_is_comp(btr_page_get( comp = page_is_comp(btr_page_get
space, root_page_no, RW_X_LATCH, mtr)); (space, root_page_no, RW_X_LATCH, mtr));
btr_free_root(space, root_page_no, mtr); btr_free_root(space, root_page_no, mtr);
/* We will temporarily write FIL_NULL to the PAGE_NO field /* We will temporarily write FIL_NULL to the PAGE_NO field
...@@ -1157,13 +1158,15 @@ dict_create_or_check_foreign_constraint_tables(void) ...@@ -1157,13 +1158,15 @@ dict_create_or_check_foreign_constraint_tables(void)
if (table1) { if (table1) {
fprintf(stderr, fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN table\n"); "InnoDB: dropping incompletely created"
" SYS_FOREIGN table\n");
row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE); row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE);
} }
if (table2) { if (table2) {
fprintf(stderr, fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN_COLS table\n"); "InnoDB: dropping incompletely created"
" SYS_FOREIGN_COLS table\n");
row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE); row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE);
} }
...@@ -1184,13 +1187,19 @@ dict_create_or_check_foreign_constraint_tables(void) ...@@ -1184,13 +1187,19 @@ dict_create_or_check_foreign_constraint_tables(void)
"PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n" "PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n"
"BEGIN\n" "BEGIN\n"
"CREATE TABLE\n" "CREATE TABLE\n"
"SYS_FOREIGN(ID CHAR, FOR_NAME CHAR, REF_NAME CHAR, N_COLS INT);\n" "SYS_FOREIGN(ID CHAR, FOR_NAME CHAR,"
"CREATE UNIQUE CLUSTERED INDEX ID_IND ON SYS_FOREIGN (ID);\n" " REF_NAME CHAR, N_COLS INT);\n"
"CREATE INDEX FOR_IND ON SYS_FOREIGN (FOR_NAME);\n" "CREATE UNIQUE CLUSTERED INDEX ID_IND"
"CREATE INDEX REF_IND ON SYS_FOREIGN (REF_NAME);\n" " ON SYS_FOREIGN (ID);\n"
"CREATE INDEX FOR_IND"
" ON SYS_FOREIGN (FOR_NAME);\n"
"CREATE INDEX REF_IND"
" ON SYS_FOREIGN (REF_NAME);\n"
"CREATE TABLE\n" "CREATE TABLE\n"
"SYS_FOREIGN_COLS(ID CHAR, POS INT, FOR_COL_NAME CHAR, REF_COL_NAME CHAR);\n" "SYS_FOREIGN_COLS(ID CHAR, POS INT,"
"CREATE UNIQUE CLUSTERED INDEX ID_IND ON SYS_FOREIGN_COLS (ID, POS);\n" " FOR_COL_NAME CHAR, REF_COL_NAME CHAR);\n"
"CREATE UNIQUE CLUSTERED INDEX ID_IND"
" ON SYS_FOREIGN_COLS (ID, POS);\n"
"COMMIT WORK;\n" "COMMIT WORK;\n"
"END;\n" "END;\n"
, FALSE, trx); , FALSE, trx);
...@@ -1201,10 +1210,11 @@ dict_create_or_check_foreign_constraint_tables(void) ...@@ -1201,10 +1210,11 @@ dict_create_or_check_foreign_constraint_tables(void)
ut_a(error == DB_OUT_OF_FILE_SPACE); ut_a(error == DB_OUT_OF_FILE_SPACE);
fprintf(stderr, "InnoDB: creation failed\n");
fprintf(stderr, "InnoDB: tablespace is full\n");
fprintf(stderr, fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN tables\n"); "InnoDB: creation failed\n"
"InnoDB: tablespace is full\n"
"InnoDB: dropping incompletely created"
" SYS_FOREIGN tables\n");
row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE); row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE);
row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE); row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE);
...@@ -1220,7 +1230,8 @@ dict_create_or_check_foreign_constraint_tables(void) ...@@ -1220,7 +1230,8 @@ dict_create_or_check_foreign_constraint_tables(void)
if (error == DB_SUCCESS) { if (error == DB_SUCCESS) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Foreign key constraint system tables created\n"); "InnoDB: Foreign key constraint system tables"
" created\n");
} }
return(error); return(error);
...@@ -1282,7 +1293,8 @@ dict_foreign_eval_sql( ...@@ -1282,7 +1293,8 @@ dict_foreign_eval_sql(
" for table ", ef); " for table ", ef);
ut_print_name(ef, trx, TRUE, table->name); ut_print_name(ef, trx, TRUE, table->name);
fputs(".\n" fputs(".\n"
"See the MySQL .err log in the datadir for more information.\n", ef); "See the MySQL .err log in the datadir"
" for more information.\n", ef);
mutex_exit(&dict_foreign_err_mutex); mutex_exit(&dict_foreign_err_mutex);
return(error); return(error);
...@@ -1316,13 +1328,13 @@ dict_create_add_foreign_field_to_dictionary( ...@@ -1316,13 +1328,13 @@ dict_create_add_foreign_field_to_dictionary(
pars_info_add_str_literal(info, "ref_col_name", pars_info_add_str_literal(info, "ref_col_name",
foreign->referenced_col_names[field_nr]); foreign->referenced_col_names[field_nr]);
return dict_foreign_eval_sql(info, return(dict_foreign_eval_sql
"PROCEDURE P () IS\n" (info, "PROCEDURE P () IS\n"
"BEGIN\n" "BEGIN\n"
"INSERT INTO SYS_FOREIGN_COLS VALUES" "INSERT INTO SYS_FOREIGN_COLS VALUES"
"(:id, :pos, :for_col_name, :ref_col_name);\n" "(:id, :pos, :for_col_name, :ref_col_name);\n"
"END;\n" "END;\n",
, table, foreign, trx); table, foreign, trx));
} }
/************************************************************************ /************************************************************************
...@@ -1381,8 +1393,8 @@ dict_create_add_foreign_to_dictionary( ...@@ -1381,8 +1393,8 @@ dict_create_add_foreign_to_dictionary(
} }
for (i = 0; i < foreign->n_fields; i++) { for (i = 0; i < foreign->n_fields; i++) {
error = dict_create_add_foreign_field_to_dictionary(i, error = dict_create_add_foreign_field_to_dictionary
table, foreign, trx); (i, table, foreign, trx);
if (error != DB_SUCCESS) { if (error != DB_SUCCESS) {
...@@ -1428,7 +1440,8 @@ dict_create_add_foreigns_to_dictionary( ...@@ -1428,7 +1440,8 @@ dict_create_add_foreigns_to_dictionary(
if (NULL == dict_table_get_low("SYS_FOREIGN")) { if (NULL == dict_table_get_low("SYS_FOREIGN")) {
fprintf(stderr, fprintf(stderr,
"InnoDB: table SYS_FOREIGN not found from internal data dictionary\n"); "InnoDB: table SYS_FOREIGN not found"
" in internal data dictionary\n");
return(DB_ERROR); return(DB_ERROR);
} }
...@@ -1437,8 +1450,8 @@ dict_create_add_foreigns_to_dictionary( ...@@ -1437,8 +1450,8 @@ dict_create_add_foreigns_to_dictionary(
foreign; foreign;
foreign = UT_LIST_GET_NEXT(foreign_list, foreign)) { foreign = UT_LIST_GET_NEXT(foreign_list, foreign)) {
error = dict_create_add_foreign_to_dictionary(&number, error = dict_create_add_foreign_to_dictionary
table, foreign, trx); (&number, table, foreign, trx);
if (error != DB_SUCCESS) { if (error != DB_SUCCESS) {
......
This diff is collapsed.
...@@ -372,9 +372,8 @@ dict_load_columns( ...@@ -372,9 +372,8 @@ dict_load_columns(
ut_ad(len == 4); ut_ad(len == 4);
ut_a(i == mach_read_from_4(field)); ut_a(i == mach_read_from_4(field));
ut_a(0 == ut_strcmp("NAME", ut_a(!strcmp("NAME", dict_field_get_col
dict_field_get_col( (dict_index_get_nth_field(sys_index, 4))->name));
dict_index_get_nth_field(sys_index, 4))->name));
field = rec_get_nth_field_old(rec, 4, &len); field = rec_get_nth_field_old(rec, 4, &len);
name = mem_heap_strdupl(heap, (char*) field, len); name = mem_heap_strdupl(heap, (char*) field, len);
...@@ -393,13 +392,15 @@ dict_load_columns( ...@@ -393,13 +392,15 @@ dict_load_columns(
/* Use the binary collation for /* Use the binary collation for
string columns of binary type. */ string columns of binary type. */
prtype = dtype_form_prtype(prtype, prtype = dtype_form_prtype
(prtype,
DATA_MYSQL_BINARY_CHARSET_COLL); DATA_MYSQL_BINARY_CHARSET_COLL);
} else { } else {
/* Use the default charset for /* Use the default charset for
other than binary columns. */ other than binary columns. */
prtype = dtype_form_prtype(prtype, prtype = dtype_form_prtype
(prtype,
data_mysql_default_charset_coll); data_mysql_default_charset_coll);
} }
} }
...@@ -407,9 +408,8 @@ dict_load_columns( ...@@ -407,9 +408,8 @@ dict_load_columns(
field = rec_get_nth_field_old(rec, 7, &len); field = rec_get_nth_field_old(rec, 7, &len);
col_len = mach_read_from_4(field); col_len = mach_read_from_4(field);
ut_a(0 == ut_strcmp("PREC", ut_a(!strcmp("PREC", dict_field_get_col
dict_field_get_col( (dict_index_get_nth_field(sys_index, 8))->name));
dict_index_get_nth_field(sys_index, 8))->name));
field = rec_get_nth_field_old(rec, 8, &len); field = rec_get_nth_field_old(rec, 8, &len);
prec = mach_read_from_4(field); prec = mach_read_from_4(field);
...@@ -526,14 +526,14 @@ dict_load_fields( ...@@ -526,14 +526,14 @@ dict_load_fields(
prefix_len = 0; prefix_len = 0;
} }
ut_a(0 == ut_strcmp("COL_NAME", ut_a(!strcmp("COL_NAME", dict_field_get_col
dict_field_get_col( (dict_index_get_nth_field(sys_index, 4))->name));
dict_index_get_nth_field(sys_index, 4))->name));
field = rec_get_nth_field_old(rec, 4, &len); field = rec_get_nth_field_old(rec, 4, &len);
dict_mem_index_add_field(index, dict_mem_index_add_field(index, mem_heap_strdupl
mem_heap_strdupl(heap, (char*) field, len), prefix_len); (heap, (char*) field, len),
prefix_len);
btr_pcur_move_to_next_user_rec(&pcur, &mtr); btr_pcur_move_to_next_user_rec(&pcur, &mtr);
} }
...@@ -631,9 +631,8 @@ dict_load_indexes( ...@@ -631,9 +631,8 @@ dict_load_indexes(
ut_ad(len == 8); ut_ad(len == 8);
id = mach_read_from_8(field); id = mach_read_from_8(field);
ut_a(0 == ut_strcmp("NAME", ut_a(!strcmp("NAME", dict_field_get_col
dict_field_get_col( (dict_index_get_nth_field(sys_index, 4))->name));
dict_index_get_nth_field(sys_index, 4))->name));
field = rec_get_nth_field_old(rec, 4, &name_len); field = rec_get_nth_field_old(rec, 4, &name_len);
name_buf = mem_heap_strdupl(heap, (char*) field, name_len); name_buf = mem_heap_strdupl(heap, (char*) field, name_len);
...@@ -647,9 +646,8 @@ dict_load_indexes( ...@@ -647,9 +646,8 @@ dict_load_indexes(
field = rec_get_nth_field_old(rec, 7, &len); field = rec_get_nth_field_old(rec, 7, &len);
space = mach_read_from_4(field); space = mach_read_from_4(field);
ut_a(0 == ut_strcmp("PAGE_NO", ut_a(!strcmp("PAGE_NO", dict_field_get_col
dict_field_get_col( (dict_index_get_nth_field(sys_index, 8))->name));
dict_index_get_nth_field(sys_index, 8))->name));
field = rec_get_nth_field_old(rec, 8, &len); field = rec_get_nth_field_old(rec, 8, &len);
page_no = mach_read_from_4(field); page_no = mach_read_from_4(field);
...@@ -657,7 +655,8 @@ dict_load_indexes( ...@@ -657,7 +655,8 @@ dict_load_indexes(
if (page_no == FIL_NULL) { if (page_no == FIL_NULL) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: trying to load index %s for table %s\n" "InnoDB: Error: trying to load index %s"
" for table %s\n"
"InnoDB: but the index tree has been freed!\n", "InnoDB: but the index tree has been freed!\n",
name_buf, table->name); name_buf, table->name);
...@@ -671,8 +670,10 @@ dict_load_indexes( ...@@ -671,8 +670,10 @@ dict_load_indexes(
&& NULL == dict_table_get_first_index(table)) { && NULL == dict_table_get_first_index(table)) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: trying to load index %s for table %s\n" "InnoDB: Error: trying to load index %s"
"InnoDB: but the first index is not clustered!\n", " for table %s\n"
"InnoDB: but the first index"
" is not clustered!\n",
name_buf, table->name); name_buf, table->name);
btr_pcur_close(&pcur); btr_pcur_close(&pcur);
...@@ -768,7 +769,7 @@ dict_load_table( ...@@ -768,7 +769,7 @@ dict_load_table(
if (!btr_pcur_is_on_user_rec(&pcur, &mtr) if (!btr_pcur_is_on_user_rec(&pcur, &mtr)
|| rec_get_deleted_flag(rec, 0)) { || rec_get_deleted_flag(rec, 0)) {
/* Not found */ /* Not found */
err_exit: err_exit:
btr_pcur_close(&pcur); btr_pcur_close(&pcur);
mtr_commit(&mtr); mtr_commit(&mtr);
mem_heap_free(heap); mem_heap_free(heap);
...@@ -784,9 +785,8 @@ dict_load_table( ...@@ -784,9 +785,8 @@ dict_load_table(
goto err_exit; goto err_exit;
} }
ut_a(0 == ut_strcmp("SPACE", ut_a(!strcmp("SPACE", dict_field_get_col
dict_field_get_col( (dict_index_get_nth_field(sys_index, 9))->name));
dict_index_get_nth_field(sys_index, 9))->name));
field = rec_get_nth_field_old(rec, 9, &len); field = rec_get_nth_field_old(rec, 9, &len);
space = mach_read_from_4(field); space = mach_read_from_4(field);
...@@ -804,8 +804,9 @@ dict_load_table( ...@@ -804,8 +804,9 @@ dict_load_table(
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: error: space object of table %s,\n" " InnoDB: error: space object of table %s,\n"
"InnoDB: space id %lu did not exist in memory. Retrying an open.\n", "InnoDB: space id %lu did not exist in memory."
" Retrying an open.\n",
name, (ulong)space); name, (ulong)space);
/* Try to open the tablespace */ /* Try to open the tablespace */
if (!fil_open_single_table_tablespace(TRUE, if (!fil_open_single_table_tablespace(TRUE,
...@@ -818,9 +819,8 @@ dict_load_table( ...@@ -818,9 +819,8 @@ dict_load_table(
} }
} }
ut_a(0 == ut_strcmp("N_COLS", ut_a(!strcmp("N_COLS", dict_field_get_col
dict_field_get_col( (dict_index_get_nth_field(sys_index, 4))->name));
dict_index_get_nth_field(sys_index, 4))->name));
field = rec_get_nth_field_old(rec, 4, &len); field = rec_get_nth_field_old(rec, 4, &len);
n_cols = mach_read_from_4(field); n_cols = mach_read_from_4(field);
...@@ -837,9 +837,8 @@ dict_load_table( ...@@ -837,9 +837,8 @@ dict_load_table(
table->ibd_file_missing = ibd_file_missing; table->ibd_file_missing = ibd_file_missing;
ut_a(0 == ut_strcmp("ID", ut_a(!strcmp("ID", dict_field_get_col
dict_field_get_col( (dict_index_get_nth_field(sys_index, 3))->name));
dict_index_get_nth_field(sys_index, 3))->name));
field = rec_get_nth_field_old(rec, 3, &len); field = rec_get_nth_field_old(rec, 3, &len);
table->id = mach_read_from_8(field); table->id = mach_read_from_8(field);
...@@ -863,7 +862,7 @@ dict_load_table( ...@@ -863,7 +862,7 @@ dict_load_table(
dict_load_indexes(table, heap); dict_load_indexes(table, heap);
err = dict_load_foreigns(table->name, TRUE); err = dict_load_foreigns(table->name, TRUE);
/* #if 0
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
mutex_enter(&dict_foreign_err_mutex); mutex_enter(&dict_foreign_err_mutex);
...@@ -871,16 +870,22 @@ dict_load_table( ...@@ -871,16 +870,22 @@ dict_load_table(
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Error: could not make a foreign key definition to match\n" " InnoDB: Error: could not make a foreign key"
"InnoDB: the foreign key table or the referenced table!\n" " definition to match\n"
"InnoDB: The data dictionary of InnoDB is corrupt. You may need to drop\n" "InnoDB: the foreign key table"
"InnoDB: and recreate the foreign key table or the referenced table.\n" " or the referenced table!\n"
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n" "InnoDB: The data dictionary of InnoDB is corrupt."
"InnoDB: Latest foreign key error printout:\n%s\n", dict_foreign_err_buf); " You may need to drop\n"
"InnoDB: and recreate the foreign key table"
" or the referenced table.\n"
"InnoDB: Submit a detailed bug report"
" to http://bugs.mysql.com\n"
"InnoDB: Latest foreign key error printout:\n%s\n",
dict_foreign_err_buf);
mutex_exit(&dict_foreign_err_mutex); mutex_exit(&dict_foreign_err_mutex);
} }
*/ #endif /* 0 */
mem_heap_free(heap); mem_heap_free(heap);
return(table); return(table);
...@@ -920,8 +925,8 @@ dict_load_table_on_id( ...@@ -920,8 +925,8 @@ dict_load_table_on_id(
/*---------------------------------------------------*/ /*---------------------------------------------------*/
/* Get the secondary index based on ID for table SYS_TABLES */ /* Get the secondary index based on ID for table SYS_TABLES */
sys_tables = dict_sys->sys_tables; sys_tables = dict_sys->sys_tables;
sys_table_ids = dict_table_get_next_index( sys_table_ids = dict_table_get_next_index
dict_table_get_first_index(sys_tables)); (dict_table_get_first_index(sys_tables));
ut_a(!dict_table_is_comp(sys_tables)); ut_a(!dict_table_is_comp(sys_tables));
heap = mem_heap_create(256); heap = mem_heap_create(256);
...@@ -1027,11 +1032,11 @@ dict_load_foreign_cols( ...@@ -1027,11 +1032,11 @@ dict_load_foreign_cols(
ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(mutex_own(&(dict_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
foreign->foreign_col_names = mem_heap_alloc(foreign->heap, foreign->foreign_col_names = mem_heap_alloc
foreign->n_fields * sizeof(void*)); (foreign->heap, foreign->n_fields * sizeof(void*));
foreign->referenced_col_names = mem_heap_alloc(foreign->heap, foreign->referenced_col_names = mem_heap_alloc
foreign->n_fields * sizeof(void*)); (foreign->heap, foreign->n_fields * sizeof(void*));
mtr_start(&mtr); mtr_start(&mtr);
sys_foreign_cols = dict_table_get_low("SYS_FOREIGN_COLS"); sys_foreign_cols = dict_table_get_low("SYS_FOREIGN_COLS");
...@@ -1085,7 +1090,8 @@ dict_load_foreign( ...@@ -1085,7 +1090,8 @@ dict_load_foreign(
/* out: DB_SUCCESS or error code */ /* out: DB_SUCCESS or error code */
const char* id, /* in: foreign constraint id as a const char* id, /* in: foreign constraint id as a
null-terminated string */ null-terminated string */
ibool check_charsets)/* in: TRUE=check charset compatibility */ ibool check_charsets)
/* in: TRUE=check charset compatibility */
{ {
dict_foreign_t* foreign; dict_foreign_t* foreign;
dict_table_t* sys_foreign; dict_table_t* sys_foreign;
...@@ -1239,7 +1245,8 @@ dict_load_foreigns( ...@@ -1239,7 +1245,8 @@ dict_load_foreigns(
/* No foreign keys defined yet in this database */ /* No foreign keys defined yet in this database */
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: no foreign key system tables in the database\n"); "InnoDB: Error: no foreign key system tables"
" in the database\n");
return(DB_ERROR); return(DB_ERROR);
} }
...@@ -1250,8 +1257,8 @@ dict_load_foreigns( ...@@ -1250,8 +1257,8 @@ dict_load_foreigns(
/* Get the secondary index based on FOR_NAME from table /* Get the secondary index based on FOR_NAME from table
SYS_FOREIGN */ SYS_FOREIGN */
sec_index = dict_table_get_next_index( sec_index = dict_table_get_next_index
dict_table_get_first_index(sys_foreign)); (dict_table_get_first_index(sys_foreign));
start_load: start_load:
heap = mem_heap_create(256); heap = mem_heap_create(256);
......
...@@ -741,7 +741,8 @@ eval_predefined( ...@@ -741,7 +741,8 @@ eval_predefined(
uint_val = (ulint) int_val; uint_val = (ulint) int_val;
} }
for (tmp = int_len; uint_val > 0; uint_val /= 10) { for (tmp = int_len; uint_val > 0; uint_val /= 10) {
data[--tmp] = (byte) ('0' + (byte)(uint_val % 10)); data[--tmp] = (byte)
('0' + (byte)(uint_val % 10));
} }
} }
......
...@@ -51,7 +51,8 @@ if_step( ...@@ -51,7 +51,8 @@ if_step(
for (;;) { for (;;) {
eval_exp(elsif_node->cond); eval_exp(elsif_node->cond);
if (eval_node_get_ibool_val(elsif_node->cond)) { if (eval_node_get_ibool_val
(elsif_node->cond)) {
/* The condition evaluated to TRUE: /* The condition evaluated to TRUE:
start execution from the first start execution from the first
...@@ -192,8 +193,8 @@ for_step( ...@@ -192,8 +193,8 @@ for_step(
loop_var_value = eval_node_get_int_val(node->loop_start_limit); loop_var_value = eval_node_get_int_val(node->loop_start_limit);
node->loop_end_value = eval_node_get_int_val( node->loop_end_value
node->loop_end_limit); = eval_node_get_int_val(node->loop_end_limit);
} }
/* Check if we should do another loop */ /* Check if we should do another loop */
......
This diff is collapsed.
This diff is collapsed.
...@@ -310,8 +310,9 @@ ha_validate( ...@@ -310,8 +310,9 @@ ha_validate(
if (hash_calc_hash(node->fold, table) != i) { if (hash_calc_hash(node->fold, table) != i) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: hash table node fold value %lu does not\n" "InnoDB: Error: hash table node"
"InnoDB: match with the cell number %lu.\n", " fold value %lu does not\n"
"InnoDB: match the cell number %lu.\n",
(ulong) node->fold, (ulong) i); (ulong) node->fold, (ulong) i);
ok = FALSE; ok = FALSE;
...@@ -363,6 +364,7 @@ ha_print_info( ...@@ -363,6 +364,7 @@ ha_print_info(
n_bufs++; n_bufs++;
} }
fprintf(file, ", node heap has %lu buffer(s)\n", (ulong) n_bufs); fprintf(file, ", node heap has %lu buffer(s)\n",
(ulong) n_bufs);
} }
} }
This diff is collapsed.
...@@ -202,7 +202,8 @@ btr_node_ptr_get_child_page_no( ...@@ -202,7 +202,8 @@ btr_node_ptr_get_child_page_no(
if (UNIV_UNLIKELY(page_no == 0)) { if (UNIV_UNLIKELY(page_no == 0)) {
fprintf(stderr, fprintf(stderr,
"InnoDB: a nonsensical page number 0 in a node ptr record at offset %lu\n", "InnoDB: a nonsensical page number 0"
" in a node ptr record at offset %lu\n",
(ulong) ut_align_offset(rec, UNIV_PAGE_SIZE)); (ulong) ut_align_offset(rec, UNIV_PAGE_SIZE));
buf_page_print(buf_frame_align(rec)); buf_page_print(buf_frame_align(rec));
} }
......
...@@ -583,9 +583,11 @@ to know struct size! */ ...@@ -583,9 +583,11 @@ to know struct size! */
struct btr_cur_struct { struct btr_cur_struct {
dict_index_t* index; /* index where positioned */ dict_index_t* index; /* index where positioned */
page_cur_t page_cur; /* page cursor */ page_cur_t page_cur; /* page cursor */
page_t* left_page; /* this field is used to store a pointer page_t* left_page; /* this field is used to store
to the left neighbor page, in the cases a pointer to the left neighbor
BTR_SEARCH_PREV and BTR_MODIFY_PREV */ page, in the cases
BTR_SEARCH_PREV and
BTR_MODIFY_PREV */
/*------------------------------*/ /*------------------------------*/
que_thr_t* thr; /* this field is only used when que_thr_t* thr; /* this field is only used when
btr_cur_search_... is called for an btr_cur_search_... is called for an
......
...@@ -156,8 +156,8 @@ improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed as LA! */ ...@@ -156,8 +156,8 @@ improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed as LA! */
NOTE! The following macros should be used instead of NOTE! The following macros should be used instead of
buf_page_optimistic_get_func, to improve debugging. Only values RW_S_LATCH and buf_page_optimistic_get_func, to improve debugging. Only values RW_S_LATCH and
RW_X_LATCH are allowed as LA! */ RW_X_LATCH are allowed as LA! */
#define buf_page_optimistic_get(LA, BL, G, MC, MTR) buf_page_optimistic_get_func(\ #define buf_page_optimistic_get(LA, BL, G, MC, MTR) \
LA, BL, G, MC, __FILE__, __LINE__, MTR) buf_page_optimistic_get_func(LA, BL, G, MC, __FILE__, __LINE__, MTR)
/************************************************************************ /************************************************************************
This is the general function used to get optimistic access to a database This is the general function used to get optimistic access to a database
page. */ page. */
......
...@@ -213,12 +213,15 @@ buf_block_align( ...@@ -213,12 +213,15 @@ buf_block_align(
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: trying to access a stray pointer %p\n" "InnoDB: Error: trying to access a stray pointer %p\n"
"InnoDB: buf pool start is at %p, end at %p\n" "InnoDB: buf pool start is at %p, end at %p\n"
"InnoDB: Probable reason is database corruption or memory\n" "InnoDB: Probable reason is database corruption"
"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n" " or memory\n"
"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n" "InnoDB: corruption. If this happens in an"
"InnoDB: how to force recovery.\n", " InnoDB database recovery, see\n"
"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/"
"forcing-recovery.html\n"
"InnoDB: how to force recovery.\n",
ptr, frame_zero, ptr, frame_zero,
buf_pool->high_end); buf_pool->high_end);
ut_error; ut_error;
...@@ -249,12 +252,15 @@ buf_frame_align( ...@@ -249,12 +252,15 @@ buf_frame_align(
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: trying to access a stray pointer %p\n" "InnoDB: Error: trying to access a stray pointer %p\n"
"InnoDB: buf pool start is at %p, end at %p\n" "InnoDB: buf pool start is at %p, end at %p\n"
"InnoDB: Probable reason is database corruption or memory\n" "InnoDB: Probable reason is database corruption"
"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n" " or memory\n"
"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n" "InnoDB: corruption. If this happens in an"
"InnoDB: how to force recovery.\n", " InnoDB database recovery, see\n"
"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/"
"forcing-recovery.html\n"
"InnoDB: how to force recovery.\n",
ptr, buf_pool->frame_zero, ptr, buf_pool->frame_zero,
buf_pool->high_end); buf_pool->high_end);
ut_error; ut_error;
......
...@@ -94,7 +94,8 @@ buf_read_recv_pages( ...@@ -94,7 +94,8 @@ buf_read_recv_pages(
/* The size in pages of the area which the read-ahead algorithms read if /* The size in pages of the area which the read-ahead algorithms read if
invoked */ invoked */
#define BUF_READ_AHEAD_AREA ut_min(64, ut_2_power_up(buf_pool->curr_size / 32)) #define BUF_READ_AHEAD_AREA \
ut_min(64, ut_2_power_up(buf_pool->curr_size / 32))
/* Modes used in read-ahead */ /* Modes used in read-ahead */
#define BUF_READ_IBUF_PAGES_ONLY 131 #define BUF_READ_IBUF_PAGES_ONLY 131
......
...@@ -63,7 +63,7 @@ dtype_set_mblen( ...@@ -63,7 +63,7 @@ dtype_set_mblen(
ut_ad(type->mbminlen <= type->mbmaxlen); ut_ad(type->mbminlen <= type->mbmaxlen);
#else /* !UNIV_HOTBACKUP */ #else /* !UNIV_HOTBACKUP */
#ifdef notdefined #ifdef notdefined
printf("ibbackup: DEBUG: type->mtype=%lu, type->prtype=%lu\n", printf("ibbackup: DEBUG: type->mtype=%lu, type->prtype=%lu\n",
type->mtype, type->prtype); type->mtype, type->prtype);
#endif #endif
ut_a(type->mtype <= DATA_BINARY); ut_a(type->mtype <= DATA_BINARY);
...@@ -411,8 +411,8 @@ dtype_get_fixed_size( ...@@ -411,8 +411,8 @@ dtype_get_fixed_size(
ulint mbminlen, mbmaxlen; ulint mbminlen, mbmaxlen;
innobase_get_cset_width( innobase_get_cset_width
dtype_get_charset_coll(type->prtype), (dtype_get_charset_coll(type->prtype),
&mbminlen, &mbmaxlen); &mbminlen, &mbmaxlen);
if (UNIV_UNLIKELY(type->mbminlen != mbminlen) if (UNIV_UNLIKELY(type->mbminlen != mbminlen)
...@@ -441,7 +441,8 @@ dtype_get_fixed_size( ...@@ -441,7 +441,8 @@ dtype_get_fixed_size(
case DATA_VARMYSQL: case DATA_VARMYSQL:
case DATA_BLOB: case DATA_BLOB:
return(0); return(0);
default: ut_error; default:
ut_error;
} }
return(0); return(0);
......
...@@ -108,7 +108,8 @@ dict_create(void); ...@@ -108,7 +108,8 @@ dict_create(void);
#define DICT_HDR_TABLE_IDS 36 /* Root of the table index tree */ #define DICT_HDR_TABLE_IDS 36 /* Root of the table index tree */
#define DICT_HDR_COLUMNS 40 /* Root of the column index tree */ #define DICT_HDR_COLUMNS 40 /* Root of the column index tree */
#define DICT_HDR_INDEXES 44 /* Root of the index index tree */ #define DICT_HDR_INDEXES 44 /* Root of the index index tree */
#define DICT_HDR_FIELDS 48 /* Root of the index field index tree */ #define DICT_HDR_FIELDS 48 /* Root of the index field
index tree */
#define DICT_HDR_FSEG_HEADER 56 /* Segment header for the tablespace #define DICT_HDR_FSEG_HEADER 56 /* Segment header for the tablespace
segment into which the dictionary segment into which the dictionary
......
...@@ -324,8 +324,8 @@ dict_index_get_sys_col_pos( ...@@ -324,8 +324,8 @@ dict_index_get_sys_col_pos(
return(col->clust_pos); return(col->clust_pos);
} }
return(dict_index_get_nth_col_pos(index, return(dict_index_get_nth_col_pos
dict_table_get_sys_col_no(index->table, type))); (index, dict_table_get_sys_col_no(index->table, type)));
} }
/************************************************************************* /*************************************************************************
...@@ -366,8 +366,8 @@ dict_index_get_nth_type( ...@@ -366,8 +366,8 @@ dict_index_get_nth_type(
dict_index_t* index, /* in: index */ dict_index_t* index, /* in: index */
ulint pos) /* in: position of the field */ ulint pos) /* in: position of the field */
{ {
return(dict_col_get_type(dict_field_get_col( return(dict_col_get_type(dict_field_get_col
dict_index_get_nth_field(index, pos)))); (dict_index_get_nth_field(index, pos))));
} }
/************************************************************************ /************************************************************************
...@@ -380,8 +380,8 @@ dict_index_get_nth_col_no( ...@@ -380,8 +380,8 @@ dict_index_get_nth_col_no(
dict_index_t* index, /* in: index */ dict_index_t* index, /* in: index */
ulint pos) /* in: position of the field */ ulint pos) /* in: position of the field */
{ {
return(dict_col_get_no(dict_field_get_col( return(dict_col_get_no(dict_field_get_col
dict_index_get_nth_field(index, pos)))); (dict_index_get_nth_field(index, pos))));
} }
/************************************************************************* /*************************************************************************
......
...@@ -165,8 +165,8 @@ ibuf_index_page_calc_free( ...@@ -165,8 +165,8 @@ ibuf_index_page_calc_free(
/* out: value for ibuf bitmap bits */ /* out: value for ibuf bitmap bits */
page_t* page) /* in: non-unique secondary index page */ page_t* page) /* in: non-unique secondary index page */
{ {
return(ibuf_index_page_calc_free_bits( return(ibuf_index_page_calc_free_bits
page_get_max_insert_size_after_reorganize(page, 1))); (page_get_max_insert_size_after_reorganize(page, 1)));
} }
/**************************************************************************** /****************************************************************************
......
...@@ -146,22 +146,10 @@ mach_write_to_4( ...@@ -146,22 +146,10 @@ mach_write_to_4(
{ {
ut_ad(b); ut_ad(b);
#if (0 == 1) && !defined(__STDC__) && defined(UNIV_INTEL) && (UNIV_WORD_SIZE == 4) && defined(UNIV_VISUALC)
/* We do not use this even on Intel, because unaligned accesses may
be slow */
__asm MOV EAX, n
__asm BSWAP EAX /* Intel is little-endian, must swap bytes */
__asm MOV n, EAX
*((ulint*)b) = n;
#else
b[0] = (byte)(n >> 24); b[0] = (byte)(n >> 24);
b[1] = (byte)(n >> 16); b[1] = (byte)(n >> 16);
b[2] = (byte)(n >> 8); b[2] = (byte)(n >> 8);
b[3] = (byte)n; b[3] = (byte)n;
#endif
} }
/************************************************************ /************************************************************
...@@ -174,28 +162,12 @@ mach_read_from_4( ...@@ -174,28 +162,12 @@ mach_read_from_4(
/* out: ulint integer */ /* out: ulint integer */
byte* b) /* in: pointer to four bytes */ byte* b) /* in: pointer to four bytes */
{ {
#if (0 == 1) && !defined(__STDC__) && defined(UNIV_INTEL) && (UNIV_WORD_SIZE == 4) && defined(UNIV_VISUALC)
/* We do not use this even on Intel, because unaligned accesses may
be slow */
ulint res;
ut_ad(b);
__asm MOV EDX, b
__asm MOV ECX, DWORD PTR [EDX]
__asm BSWAP ECX /* Intel is little-endian, must swap bytes */
__asm MOV res, ECX
return(res);
#else
ut_ad(b); ut_ad(b);
return( ((ulint)(b[0]) << 24) return( ((ulint)(b[0]) << 24)
+ ((ulint)(b[1]) << 16) + ((ulint)(b[1]) << 16)
+ ((ulint)(b[2]) << 8) + ((ulint)(b[2]) << 8)
+ (ulint)(b[3]) + (ulint)(b[3])
); );
#endif
} }
/************************************************************* /*************************************************************
......
...@@ -410,7 +410,8 @@ mem_heap_create_func( ...@@ -410,7 +410,8 @@ mem_heap_create_func(
file_name, line); file_name, line);
} else { } else {
block = mem_heap_create_block(NULL, MEM_BLOCK_START_SIZE, block = mem_heap_create_block(NULL, MEM_BLOCK_START_SIZE,
init_block, type, file_name, line); init_block, type,
file_name, line);
} }
if (block == NULL) { if (block == NULL) {
......
...@@ -182,7 +182,7 @@ mlog_write_initial_log_record_fast( ...@@ -182,7 +182,7 @@ mlog_write_initial_log_record_fast(
mtr->n_log_recs++; mtr->n_log_recs++;
#ifdef UNIV_LOG_DEBUG #ifdef UNIV_LOG_DEBUG
/* fprintf(stderr, /* fprintf(stderr,
"Adding to mtr log record type %lu space %lu page no %lu\n", "Adding to mtr log record type %lu space %lu page no %lu\n",
type, space, offset); */ type, space, offset); */
#endif #endif
......
...@@ -70,7 +70,8 @@ flag value must give the length also! */ ...@@ -70,7 +70,8 @@ flag value must give the length also! */
#define MLOG_PAGE_CREATE ((byte)19) /* create an index page */ #define MLOG_PAGE_CREATE ((byte)19) /* create an index page */
#define MLOG_UNDO_INSERT ((byte)20) /* insert entry in an undo #define MLOG_UNDO_INSERT ((byte)20) /* insert entry in an undo
log */ log */
#define MLOG_UNDO_ERASE_END ((byte)21) /* erase an undo log page end */ #define MLOG_UNDO_ERASE_END ((byte)21) /* erase an undo log
page end */
#define MLOG_UNDO_INIT ((byte)22) /* initialize a page in an #define MLOG_UNDO_INIT ((byte)22) /* initialize a page in an
undo log */ undo log */
#define MLOG_UNDO_HDR_DISCARD ((byte)23) /* discard an update undo log #define MLOG_UNDO_HDR_DISCARD ((byte)23) /* discard an update undo log
......
...@@ -723,8 +723,10 @@ This function returns information about the specified file */ ...@@ -723,8 +723,10 @@ This function returns information about the specified file */
ibool ibool
os_file_get_status( os_file_get_status(
/*===============*/ /*===============*/
/* out: TRUE if stat information found */ /* out: TRUE if stat
information found */
const char* path, /* in: pathname of the file */ const char* path, /* in: pathname of the file */
os_file_stat_t* stat_info); /* information of a file in a directory */ os_file_stat_t* stat_info); /* information of a file in a
directory */
#endif #endif
...@@ -430,8 +430,9 @@ page_dir_set_n_heap( ...@@ -430,8 +430,9 @@ page_dir_set_n_heap(
{ {
ut_ad(n_heap < 0x8000); ut_ad(n_heap < 0x8000);
page_header_set_field(page, PAGE_N_HEAP, n_heap | (0x8000 & page_header_set_field(page, PAGE_N_HEAP, n_heap
page_header_get_field(page, PAGE_N_HEAP))); | (0x8000
& page_header_get_field(page, PAGE_N_HEAP)));
} }
/***************************************************************** /*****************************************************************
...@@ -558,13 +559,14 @@ page_rec_get_next( ...@@ -558,13 +559,14 @@ page_rec_get_next(
if (UNIV_UNLIKELY(offs >= UNIV_PAGE_SIZE)) { if (UNIV_UNLIKELY(offs >= UNIV_PAGE_SIZE)) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Next record offset is nonsensical %lu in record at offset %lu\n" "InnoDB: Next record offset is nonsensical %lu"
"InnoDB: rec address %p, first buffer frame %p\n" " in record at offset %lu\n"
"InnoDB: buffer pool high end %p, buf fix count %lu\n", "InnoDB: rec address %p, first buffer frame %p\n"
"InnoDB: buffer pool high end %p, buf fix count %lu\n",
(ulong)offs, (ulong)(rec - page), (ulong)offs, (ulong)(rec - page),
rec, buf_pool->frame_zero, (void*) rec, (void*) buf_pool->frame_zero,
buf_pool->high_end, (void*) buf_pool->high_end,
(ulong)buf_block_align(rec)->buf_fix_count); (ulong) buf_block_align(rec)->buf_fix_count);
buf_page_print(page); buf_page_print(page);
ut_error; ut_error;
...@@ -735,14 +737,16 @@ page_get_max_insert_size( ...@@ -735,14 +737,16 @@ page_get_max_insert_size(
if (page_is_comp(page)) { if (page_is_comp(page)) {
occupied = page_header_get_field(page, PAGE_HEAP_TOP) occupied = page_header_get_field(page, PAGE_HEAP_TOP)
- PAGE_NEW_SUPREMUM_END + page_dir_calc_reserved_space( - PAGE_NEW_SUPREMUM_END
n_recs + page_dir_get_n_heap(page) - 2); + page_dir_calc_reserved_space
(n_recs + page_dir_get_n_heap(page) - 2);
free_space = page_get_free_space_of_empty(TRUE); free_space = page_get_free_space_of_empty(TRUE);
} else { } else {
occupied = page_header_get_field(page, PAGE_HEAP_TOP) occupied = page_header_get_field(page, PAGE_HEAP_TOP)
- PAGE_OLD_SUPREMUM_END + page_dir_calc_reserved_space( - PAGE_OLD_SUPREMUM_END
n_recs + page_dir_get_n_heap(page) - 2); + page_dir_calc_reserved_space
(n_recs + page_dir_get_n_heap(page) - 2);
free_space = page_get_free_space_of_empty(FALSE); free_space = page_get_free_space_of_empty(FALSE);
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment