Commit ac69f8c2 authored by osku's avatar osku

Style cleanups: Convert spaces to tabs, remove trailing whitespace, other

misc cleanups.
parent 9596f6d8
......@@ -1416,15 +1416,12 @@ btr_insert_on_non_leaf_level(
first parameter for btr_cur_search_to_nth_level. */
btr_cur_search_to_nth_level(UT_LIST_GET_FIRST(tree->tree_indexes),
level, tuple, PAGE_CUR_LE,
BTR_CONT_MODIFY_TREE,
level, tuple, PAGE_CUR_LE, BTR_CONT_MODIFY_TREE,
&cursor, 0, mtr);
err = btr_cur_pessimistic_insert(BTR_NO_LOCKING_FLAG
| BTR_KEEP_SYS_FLAG
| BTR_NO_UNDO_LOG_FLAG,
&cursor, tuple,
&rec, &dummy_big_rec, NULL, mtr);
| BTR_KEEP_SYS_FLAG | BTR_NO_UNDO_LOG_FLAG,
&cursor, tuple, &rec, &dummy_big_rec, NULL, mtr);
ut_a(err == DB_SUCCESS);
}
......
......@@ -798,8 +798,8 @@ btr_search_guess_on_hash(
record to determine if our guess for the cursor position is
right. */
if (UNIV_EXPECT(ut_dulint_cmp(tree_id, btr_page_get_index_id(page)), 0)
|| !btr_search_check_guess(cursor, can_only_compare_to_cursor_rec,
tuple, mode, mtr)) {
|| !btr_search_check_guess(cursor,
can_only_compare_to_cursor_rec, tuple, mode, mtr)) {
if (UNIV_LIKELY(!has_search_latch)) {
btr_leaf_page_release(page, latch_mode, mtr);
}
......
......@@ -335,10 +335,10 @@ buf_page_is_corrupted(
}
#endif
/* If we use checksums validation, make additional check before returning
TRUE to ensure that the checksum is not equal to BUF_NO_CHECKSUM_MAGIC which
might be stored by InnoDB with checksums disabled.
Otherwise, skip checksum calculation and return FALSE */
/* If we use checksums validation, make additional check before
returning TRUE to ensure that the checksum is not equal to
BUF_NO_CHECKSUM_MAGIC which might be stored by InnoDB with checksums
disabled. Otherwise, skip checksum calculation and return FALSE */
if (srv_use_checksums) {
old_checksum = buf_calc_page_old_checksum(read_buf);
......@@ -347,11 +347,15 @@ buf_page_is_corrupted(
- FIL_PAGE_END_LSN_OLD_CHKSUM);
/* There are 2 valid formulas for old_checksum_field:
1. Very old versions of InnoDB only stored 8 byte lsn to the start
and the end of the page.
2. Newer InnoDB versions store the old formula checksum there. */
if (old_checksum_field != mach_read_from_4(read_buf + FIL_PAGE_LSN)
1. Very old versions of InnoDB only stored 8 byte lsn to the
start and the end of the page.
2. Newer InnoDB versions store the old formula checksum
there. */
if (old_checksum_field != mach_read_from_4(read_buf
+ FIL_PAGE_LSN)
&& old_checksum_field != old_checksum
&& old_checksum_field != BUF_NO_CHECKSUM_MAGIC) {
......@@ -359,7 +363,8 @@ buf_page_is_corrupted(
}
checksum = buf_calc_page_new_checksum(read_buf);
checksum_field = mach_read_from_4(read_buf + FIL_PAGE_SPACE_OR_CHKSUM);
checksum_field = mach_read_from_4(read_buf +
FIL_PAGE_SPACE_OR_CHKSUM);
/* InnoDB versions < 4.0.14 and < 4.1.1 stored the space id
(always equal to 0), to FIL_PAGE_SPACE_SPACE_OR_CHKSUM */
......@@ -2338,9 +2343,8 @@ buf_print_io(
if (buf_pool->n_page_gets > buf_pool->n_page_gets_old) {
fprintf(file, "Buffer pool hit rate %lu / 1000\n",
(ulong) (1000
- ((1000 *
(buf_pool->n_pages_read - buf_pool->n_pages_read_old))
(ulong) (1000 -
((1000 * (buf_pool->n_pages_read - buf_pool->n_pages_read_old))
/ (buf_pool->n_page_gets - buf_pool->n_page_gets_old))));
} else {
fputs("No buffer pool page gets since the last printout\n",
......
......@@ -357,7 +357,8 @@ buf_flush_buffered_writes(void)
"InnoDB: The lsn fields do not match! 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->io_fix,
(ulong)block->buf_fix_count,
(ulong)block->io_fix,
(ulong)block->state);
}
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
......
......@@ -458,7 +458,8 @@ buf_read_ahead_linear(
/* Not accessed */
fail_count++;
} else if (pred_block && (ut_ulint_cmp(block->LRU_position,
} else if (pred_block
&& (ut_ulint_cmp(block->LRU_position,
pred_block->LRU_position)
!= asc_or_desc)) {
/* Accesses not in the right order */
......
......@@ -238,8 +238,7 @@ dict_boot(void)
dict_sys->row_id = ut_dulint_add(
ut_dulint_align_up(
mtr_read_dulint(dict_hdr + DICT_HDR_ROW_ID,
&mtr),
mtr_read_dulint(dict_hdr + DICT_HDR_ROW_ID, &mtr),
DICT_HDR_ROW_ID_WRITE_MARGIN),
DICT_HDR_ROW_ID_WRITE_MARGIN);
......
......@@ -1324,7 +1324,7 @@ dict_create_add_foreigns_to_dictionary(
if (NULL == dict_table_get_low("SYS_FOREIGN")) {
fprintf(stderr,
"InnoDB: table SYS_FOREIGN not found from internal data dictionary\n");
"InnoDB: table SYS_FOREIGN not found from internal data dictionary\n");
return(DB_ERROR);
}
......
......@@ -1739,9 +1739,7 @@ dict_index_build_internal_clust(
/* Create a new index object with certainly enough fields */
new_index = dict_mem_index_create(table->name,
index->name,
table->space,
index->type,
index->name, table->space, index->type,
index->n_fields + table->n_cols);
/* Copy other relevant data from the old index struct to the new
......@@ -1922,11 +1920,8 @@ dict_index_build_internal_non_clust(
/* Create a new index */
new_index = dict_mem_index_create(table->name,
index->name,
index->space,
index->type,
index->n_fields
+ 1 + clust_index->n_uniq);
index->name, index->space, index->type,
index->n_fields + 1 + clust_index->n_uniq);
/* Copy other relevant data from the old index
struct to the new struct: it inherits the values */
......
......@@ -3124,7 +3124,7 @@ fil_load_single_table_tablespaces(void)
&fileinfo);
while (ret == 0) {
/* printf(
" Looking at file %s\n", fileinfo.name); */
" Looking at file %s\n", fileinfo.name); */
if (fileinfo.type == OS_FILE_TYPE_DIR) {
......@@ -3612,8 +3612,8 @@ fil_extend_tablespaces_to_stored_len(void)
ut_a(space->purpose == FIL_TABLESPACE);
mutex_exit(&(system->mutex)); /* no need to protect with a
mutex, because this is a single-
threaded operation */
mutex, because this is a
single-threaded operation */
error = fil_read(TRUE, space->id, 0, 0, UNIV_PAGE_SIZE, buf,
NULL);
ut_a(error == DB_SUCCESS);
......@@ -4297,8 +4297,8 @@ fil_flush_file_spaces(
while (space) {
if (space->purpose == purpose && !space->is_being_deleted) {
space->n_pending_flushes++; /* prevent dropping of the
space while we are
space->n_pending_flushes++; /* prevent dropping of
the space while we are
flushing */
mutex_exit(&(system->mutex));
......
......@@ -941,8 +941,8 @@ fsp_header_get_space_id(
if (id != fsp_id) {
fprintf(stderr,
"InnoDB: Error: space id in fsp header %lu, but in the page header %lu\n",
(ulong) fsp_id,
(ulong) id);
(ulong) fsp_id, (ulong) id);
return(ULINT_UNDEFINED);
}
......@@ -2857,8 +2857,9 @@ fsp_get_available_space_in_free_extents(
if (size < FSP_EXTENT_SIZE) {
ut_a(space != 0); /* This must be a single-table
tablespace */
return(0); /* TODO: count free frag pages and return
a value based on that */
return(0); /* TODO: count free frag pages and
return a value based on that */
}
/* Below we play safe when counting free extents above the free limit:
......@@ -3734,18 +3735,22 @@ fsp_validate(
mtr_start(&mtr);
mtr_x_lock(fil_space_get_latch(space), &mtr);
seg_inode_page = fut_get_ptr(space, node_addr, RW_X_LATCH,
&mtr) - FSEG_INODE_PAGE_NODE;
seg_inode_page = fut_get_ptr(space, node_addr,
RW_X_LATCH, &mtr) - FSEG_INODE_PAGE_NODE;
seg_inode = fsp_seg_inode_page_get_nth_inode(seg_inode_page,
n, &mtr);
ut_a(ut_dulint_cmp(mach_read_from_8(seg_inode + FSEG_ID),
seg_inode = fsp_seg_inode_page_get_nth_inode(
seg_inode_page, n, &mtr);
ut_a(ut_dulint_cmp(
mach_read_from_8(seg_inode + FSEG_ID),
ut_dulint_zero) != 0);
fseg_validate_low(seg_inode, &mtr);
descr_count += flst_get_len(seg_inode + FSEG_FREE, &mtr);
descr_count += flst_get_len(seg_inode + FSEG_FULL, &mtr);
descr_count += flst_get_len(seg_inode + FSEG_NOT_FULL, &mtr);
descr_count += flst_get_len(seg_inode + FSEG_FREE,
&mtr);
descr_count += flst_get_len(seg_inode + FSEG_FULL,
&mtr);
descr_count += flst_get_len(seg_inode + FSEG_NOT_FULL,
&mtr);
n_used2 += fseg_get_n_frag_pages(seg_inode, &mtr);
......@@ -3775,22 +3780,24 @@ fsp_validate(
mtr_start(&mtr);
mtr_x_lock(fil_space_get_latch(space), &mtr);
seg_inode_page = fut_get_ptr(space, node_addr, RW_X_LATCH,
&mtr) - FSEG_INODE_PAGE_NODE;
seg_inode_page = fut_get_ptr(space, node_addr,
RW_X_LATCH, &mtr) - FSEG_INODE_PAGE_NODE;
seg_inode = fsp_seg_inode_page_get_nth_inode(seg_inode_page,
n, &mtr);
if (ut_dulint_cmp(mach_read_from_8(seg_inode + FSEG_ID),
seg_inode = fsp_seg_inode_page_get_nth_inode(
seg_inode_page, n, &mtr);
if (ut_dulint_cmp(mach_read_from_8(
seg_inode + FSEG_ID),
ut_dulint_zero) != 0) {
fseg_validate_low(seg_inode, &mtr);
descr_count += flst_get_len(seg_inode + FSEG_FREE,
&mtr);
descr_count += flst_get_len(seg_inode + FSEG_FULL,
&mtr);
descr_count += flst_get_len(seg_inode + FSEG_NOT_FULL,
&mtr);
n_used2 += fseg_get_n_frag_pages(seg_inode, &mtr);
descr_count += flst_get_len(
seg_inode + FSEG_FREE, &mtr);
descr_count += flst_get_len(
seg_inode + FSEG_FULL, &mtr);
descr_count += flst_get_len(
seg_inode + FSEG_NOT_FULL, &mtr);
n_used2 += fseg_get_n_frag_pages(
seg_inode, &mtr);
}
next_node_addr = flst_get_next_addr(seg_inode_page
......@@ -3809,6 +3816,7 @@ fsp_validate(
ut_a(frag_n_used == n_used);
mtr_commit(&mtr2);
return(TRUE);
}
......@@ -3897,12 +3905,13 @@ fsp_print(
mtr_start(&mtr);
mtr_x_lock(fil_space_get_latch(space), &mtr);
seg_inode_page = fut_get_ptr(space, node_addr, RW_X_LATCH,
&mtr) - FSEG_INODE_PAGE_NODE;
seg_inode_page = fut_get_ptr(space, node_addr,
RW_X_LATCH, &mtr) - FSEG_INODE_PAGE_NODE;
seg_inode = fsp_seg_inode_page_get_nth_inode(seg_inode_page,
n, &mtr);
ut_a(ut_dulint_cmp(mach_read_from_8(seg_inode + FSEG_ID),
seg_inode = fsp_seg_inode_page_get_nth_inode(
seg_inode_page, n, &mtr);
ut_a(ut_dulint_cmp(mach_read_from_8(
seg_inode + FSEG_ID),
ut_dulint_zero) != 0);
fseg_print_low(seg_inode, &mtr);
......@@ -3932,12 +3941,13 @@ fsp_print(
mtr_start(&mtr);
mtr_x_lock(fil_space_get_latch(space), &mtr);
seg_inode_page = fut_get_ptr(space, node_addr, RW_X_LATCH,
&mtr) - FSEG_INODE_PAGE_NODE;
seg_inode_page = fut_get_ptr(space, node_addr,
RW_X_LATCH, &mtr) - FSEG_INODE_PAGE_NODE;
seg_inode = fsp_seg_inode_page_get_nth_inode(seg_inode_page,
n, &mtr);
if (ut_dulint_cmp(mach_read_from_8(seg_inode + FSEG_ID),
seg_inode = fsp_seg_inode_page_get_nth_inode(
seg_inode_page, n, &mtr);
if (ut_dulint_cmp(mach_read_from_8(
seg_inode + FSEG_ID),
ut_dulint_zero) != 0) {
fseg_print_low(seg_inode, &mtr);
......
This diff is collapsed.
......@@ -233,10 +233,11 @@ extern my_bool innobase_log_archive,
innobase_file_per_table, innobase_locks_unsafe_for_binlog,
innobase_create_status_file;
extern my_bool innobase_very_fast_shutdown; /* set this to 1 just before
calling innobase_end() if you want
InnoDB to shut down without
flushing the buffer pool: this
is equivalent to a 'crash' */
calling innobase_end() if
you want InnoDB to shut down
without flushing the buffer
pool: this is equivalent to
a 'crash' */
extern "C" {
extern ulong srv_max_buf_pool_modified_pct;
extern ulong srv_max_purge_lag;
......
......@@ -621,8 +621,9 @@ ibuf_bitmap_page_get_bits(
page_t* page, /* in: bitmap page */
ulint page_no,/* in: page whose bits to get */
ulint bit, /* in: IBUF_BITMAP_FREE, IBUF_BITMAP_BUFFERED, ... */
mtr_t* mtr __attribute__((unused))) /* in: mtr containing an x-latch
to the bitmap page */
mtr_t* mtr __attribute__((unused))) /* in: mtr containing an
x-latch to the bitmap
page */
{
ulint byte_offset;
ulint bit_offset;
......@@ -681,7 +682,8 @@ ibuf_bitmap_page_set_bits(
MTR_MEMO_PAGE_X_FIX));
#ifdef UNIV_IBUF_DEBUG
ut_a((bit != IBUF_BITMAP_BUFFERED) || (val != FALSE)
|| (0 == ibuf_count_get(buf_frame_get_space_id(page), page_no)));
|| (0 == ibuf_count_get(buf_frame_get_space_id(page),
page_no)));
#endif
bit_offset = (page_no % XDES_DESCRIBED_PER_PAGE) * IBUF_BITS_PER_PAGE
+ bit;
......
......@@ -82,7 +82,8 @@ buf_pool_is_block(
void* ptr) /* in: pointer to memory */
{
if ((buf_pool->blocks <= (buf_block_t*)ptr)
&& ((buf_block_t*)ptr < buf_pool->blocks + buf_pool->max_size)) {
&& ((buf_block_t*)ptr < buf_pool->blocks
+ buf_pool->max_size)) {
return(TRUE);
}
......
......@@ -147,7 +147,8 @@ dfield_datas_are_binary_equal(
if ((len != field2->len)
|| ((len != UNIV_SQL_NULL)
&& (0 != ut_memcmp(field1->data, field2->data, len)))) {
&& (0 != ut_memcmp(field1->data, field2->data,
len)))) {
return(FALSE);
}
......
......@@ -42,7 +42,7 @@ Created 5/24/1996 Heikki Tuuri
#define DB_CANNOT_ADD_CONSTRAINT 38 /* adding a foreign key constraint
to a table failed */
#define DB_CORRUPTION 39 /* data structure corruption noticed */
#define DB_COL_APPEARS_TWICE_IN_INDEX 40 /* InnoDB cannot handle an index
#define DB_COL_APPEARS_TWICE_IN_INDEX 40/* InnoDB cannot handle an index
where same column appears twice */
#define DB_CANNOT_DROP_CONSTRAINT 41 /* dropping a foreign key constraint
from a table failed */
......
......@@ -25,8 +25,7 @@ UNIV_MEM_ALIGNMENT. In the debug version there are also
check fields at the both ends of the field. */
#ifdef UNIV_MEM_DEBUG
#define MEM_SPACE_NEEDED(N) ut_calc_align((N) + MEM_FIELD_HEADER_SIZE\
+ MEM_FIELD_TRAILER_SIZE,\
UNIV_MEM_ALIGNMENT)
+ MEM_FIELD_TRAILER_SIZE, UNIV_MEM_ALIGNMENT)
#else
#define MEM_SPACE_NEEDED(N) ut_calc_align((N), UNIV_MEM_ALIGNMENT)
#endif
......
......@@ -68,22 +68,19 @@ Use this macro instead of the corresponding function! Macro for memory
heap creation. */
#define mem_heap_create(N) mem_heap_create_func(\
(N), NULL, MEM_HEAP_DYNAMIC,\
__FILE__, __LINE__)
(N), NULL, MEM_HEAP_DYNAMIC, __FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
heap creation. */
#define mem_heap_create_in_buffer(N) mem_heap_create_func(\
(N), NULL, MEM_HEAP_BUFFER,\
__FILE__, __LINE__)
(N), NULL, MEM_HEAP_BUFFER, __FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
heap creation. */
#define mem_heap_create_in_btr_search(N) mem_heap_create_func(\
(N), NULL, MEM_HEAP_BTR_SEARCH |\
MEM_HEAP_BUFFER,\
(N), NULL, MEM_HEAP_BTR_SEARCH | MEM_HEAP_BUFFER,\
__FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function! Macro for fast
......@@ -92,8 +89,7 @@ caller, N is its size, and this memory block is not freed by
mem_heap_free. See the parameter comment in mem_heap_create_func below. */
#define mem_heap_fast_create(N, B) mem_heap_create_func(\
(N), (B), MEM_HEAP_DYNAMIC,\
__FILE__, __LINE__)
(N), (B), MEM_HEAP_DYNAMIC, __FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
......
......@@ -119,10 +119,11 @@ os_mem_alloc_large(
/*===============*/
/* out: allocated memory */
ulint n, /* in: number of bytes */
ibool set_to_zero, /* in: TRUE if allocated memory should be set
to zero if UNIV_SET_MEM_TO_ZERO is defined */
ibool assert_on_error); /* in: if TRUE, we crash mysqld if the memory
cannot be allocated */
ibool set_to_zero, /* in: TRUE if allocated memory
should be set to zero if
UNIV_SET_MEM_TO_ZERO is defined */
ibool assert_on_error);/* in: if TRUE, we crash mysqld if
the memory cannot be allocated */
/********************************************************************
Frees large pages memory. */
......
......@@ -233,6 +233,7 @@ que_thr_peek_stop(
|| trx->que_state == TRX_QUE_LOCK_WAIT
|| (UT_LIST_GET_LEN(trx->signals) > 0
&& trx->que_state == TRX_QUE_RUNNING)) {
return(TRUE);
}
......
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