Commit 747c8fad authored by marko's avatar marko

branches/zip: Merge revisions 200:236 from trunk.

parent f5f0847a
......@@ -1489,16 +1489,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, 0, NULL, mtr);
| BTR_KEEP_SYS_FLAG | BTR_NO_UNDO_LOG_FLAG,
&cursor, tuple, &rec, &dummy_big_rec, NULL, 0, NULL, mtr);
ut_a(err == DB_SUCCESS);
}
......@@ -2561,6 +2557,7 @@ btr_print_tree(
}
#endif /* UNIV_BTR_PRINT */
#ifdef UNIV_DEBUG
/****************************************************************
Checks that the node pointer to a page is appropriate. */
......@@ -2606,6 +2603,7 @@ btr_check_node_ptr(
return(TRUE);
}
#endif /* UNIV_DEBUG */
/****************************************************************
Display identification information for a record. */
......@@ -2629,7 +2627,7 @@ the index. */
ibool
btr_index_rec_validate(
/*====================*/
/*===================*/
/* out: TRUE if ok */
rec_t* rec, /* in: index record */
dict_index_t* index, /* in: index */
......@@ -2696,11 +2694,10 @@ btr_index_rec_validate(
if ((dict_index_get_nth_field(index, i)->prefix_len == 0
&& len != UNIV_SQL_NULL && fixed_size
&& len != fixed_size)
||
(dict_index_get_nth_field(index, i)->prefix_len > 0
|| (dict_index_get_nth_field(index, i)->prefix_len > 0
&& len != UNIV_SQL_NULL
&& len >
dict_index_get_nth_field(index, i)->prefix_len)) {
&& len
> dict_index_get_nth_field(index, i)->prefix_len)) {
btr_index_rec_validate_report(page, rec, index);
fprintf(stderr,
......@@ -2945,7 +2942,8 @@ loop:
if (btr_node_ptr_get_child_page_no(node_ptr, offsets) !=
buf_frame_get_page_no(page)
|| node_ptr != btr_page_get_father_for_rec(tree, page,
|| node_ptr
!= btr_page_get_father_for_rec(tree, page,
page_rec_get_prev(page_get_supremum_rec(page)),
&mtr)) {
btr_validate_report1(index, level, page);
......
......@@ -1026,7 +1026,6 @@ calculate_sizes_again:
/* The record is so big that we have to store some fields
externally on separate database pages */
big_rec_vec = dtuple_convert_big_rec(index, entry, ext, n_ext);
if (big_rec_vec == NULL) {
......@@ -1836,6 +1835,8 @@ btr_cur_optimistic_update(
lock_rec_restore_from_page_infimum(rec, page);
page_cur_move_to_next(page_cursor);
mem_heap_free(heap);
return(DB_SUCCESS);
......@@ -2684,7 +2685,8 @@ btr_cur_pessimistic_delete(
a node pointer nor in two-byte format.
This condition avoids an unnecessary loop. */
if (page_is_leaf(page)
&& (page_is_comp(page) || !rec_get_1byte_offs_flag(rec))) {
&& (page_is_comp(page)
|| !rec_get_1byte_offs_flag(rec))) {
btr_rec_free_externally_stored_fields(cursor->index, rec,
offsets, page_zip, in_rollback, mtr);
}
......@@ -2864,12 +2866,12 @@ btr_estimate_n_rows_in_range(
/* We have the path information for the range in path1 and path2 */
n_rows = 1;
diverged = FALSE; /* This becomes true when the path is not
the same any more */
diverged = FALSE; /* This becomes true when the path is
not the same any more */
diverged_lot = FALSE; /* This becomes true when the paths are
not the same or adjacent any more */
divergence_level = 1000000; /* This is the level where paths diverged
a lot */
divergence_level = 1000000; /* This is the level where paths
diverged a lot */
for (i = 0; ; i++) {
ut_ad(i < BTR_PATH_ARRAY_N_SLOTS);
......@@ -3105,8 +3107,9 @@ btr_estimate_number_of_different_key_vals(
different key values, or even more. Let us try to approximate
that: */
add_on = index->stat_n_leaf_pages /
(10 * (BTR_KEY_VAL_ESTIMATE_N_PAGES + total_external_size));
add_on = index->stat_n_leaf_pages
/ (10 * (BTR_KEY_VAL_ESTIMATE_N_PAGES
+ total_external_size));
if (add_on > BTR_KEY_VAL_ESTIMATE_N_PAGES) {
add_on = BTR_KEY_VAL_ESTIMATE_N_PAGES;
......@@ -3578,6 +3581,9 @@ btr_store_big_rec_extern_fields(
return(DB_OUT_OF_FILE_SPACE);
}
mlog_write_ulint(page + FIL_PAGE_TYPE,
FIL_PAGE_TYPE_BLOB, MLOG_2BYTES, &mtr);
page_no = buf_frame_get_page_no(page);
if (prev_page_no != FIL_NULL) {
......
......@@ -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);
}
......
......@@ -336,10 +336,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);
......@@ -348,11 +348,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) {
......@@ -360,7 +364,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 */
......@@ -428,7 +433,8 @@ buf_page_print(
"InnoDB: Page may be an update undo log page\n");
}
if (fil_page_get_type(read_buf) == FIL_PAGE_INDEX) {
switch (fil_page_get_type(read_buf)) {
case FIL_PAGE_INDEX:
fprintf(stderr,
"InnoDB: Page may be an index page where index id is %lu %lu\n",
(ulong) ut_dulint_get_high(btr_page_get_index_id(read_buf)),
......@@ -447,11 +453,42 @@ buf_page_print(
fputs(")\n", stderr);
}
}
} else if (fil_page_get_type(read_buf) == FIL_PAGE_INODE) {
break;
case FIL_PAGE_INODE:
fputs("InnoDB: Page may be an 'inode' page\n", stderr);
} else if (fil_page_get_type(read_buf) == FIL_PAGE_IBUF_FREE_LIST) {
break;
case FIL_PAGE_IBUF_FREE_LIST:
fputs("InnoDB: Page may be an insert buffer free list page\n",
stderr);
break;
case FIL_PAGE_TYPE_ALLOCATED:
fputs("InnoDB: Page may be a freshly allocated page\n",
stderr);
break;
case FIL_PAGE_IBUF_BITMAP:
fputs("InnoDB: Page may be an insert buffer bitmap page\n",
stderr);
break;
case FIL_PAGE_TYPE_SYS:
fputs("InnoDB: Page may be a system page\n",
stderr);
break;
case FIL_PAGE_TYPE_TRX_SYS:
fputs("InnoDB: Page may be a transaction system page\n",
stderr);
break;
case FIL_PAGE_TYPE_FSP_HDR:
fputs("InnoDB: Page may be a file space header page\n",
stderr);
break;
case FIL_PAGE_TYPE_XDES:
fputs("InnoDB: Page may be an extent descriptor page\n",
stderr);
break;
case FIL_PAGE_TYPE_BLOB:
fputs("InnoDB: Page may be a BLOB page\n",
stderr);
break;
}
}
......@@ -537,7 +574,7 @@ buf_pool_init(
buf_pool = mem_alloc(sizeof(buf_pool_t));
/* 1. Initialize general fields
---------------------------- */
------------------------------- */
mutex_create(&(buf_pool->mutex));
mutex_set_level(&(buf_pool->mutex), SYNC_BUF_POOL);
......@@ -664,7 +701,7 @@ buf_pool_init(
buf_pool->n_pages_awe_remapped_old = 0;
/* 2. Initialize flushing fields
---------------------------- */
-------------------------------- */
UT_LIST_INIT(buf_pool->flush_list);
for (i = BUF_FLUSH_LRU; i <= BUF_FLUSH_LIST; i++) {
......@@ -679,7 +716,7 @@ buf_pool_init(
buf_pool->freed_page_clock = 0;
/* 3. Initialize LRU fields
---------------------------- */
--------------------------- */
UT_LIST_INIT(buf_pool->LRU);
buf_pool->LRU_old = NULL;
......@@ -847,7 +884,7 @@ the buffer pool. */
void
buf_page_make_young(
/*=================*/
/*================*/
buf_frame_t* frame) /* in: buffer frame of a file page */
{
buf_block_t* block;
......@@ -1787,6 +1824,10 @@ buf_page_create(
frame = block->frame;
memset(frame + FIL_PAGE_PREV, 0xff, 4);
memset(frame + FIL_PAGE_NEXT, 0xff, 4);
mach_write_to_2(frame + FIL_PAGE_TYPE, FIL_PAGE_TYPE_ALLOCATED);
/* Reset to zero the file flush lsn field in the page; if the first
page of an ibdata file is 'created' in this function into the buffer
pool then we lose the original contents of the file flush lsn stamp.
......@@ -2305,9 +2346,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",
......
......@@ -365,7 +365,8 @@ corrupted_page:
"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);
......@@ -929,8 +930,9 @@ buf_flush_batch(
}
#endif /* UNIV_DEBUG */
if (page_count != ULINT_UNDEFINED)
srv_buf_pool_flushed+= page_count;
if (page_count != ULINT_UNDEFINED) {
srv_buf_pool_flushed += page_count;
}
return(page_count);
}
......
......@@ -133,8 +133,7 @@ buf_read_page_low(
if (buf_debug_prints) {
fprintf(stderr,
"Posting read request for page %lu, sync %lu\n",
(ulong) offset,
(ulong) sync);
(ulong) offset, (ulong) sync);
}
#endif
......@@ -458,7 +457,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 */
......
......@@ -18,10 +18,10 @@ Created 5/30/1994 Heikki Tuuri
#include "dict0dict.h"
#include "btr0cur.h"
#ifdef UNIV_DEBUG
byte data_error; /* data pointers of tuple fields are initialized
to point here for error checking */
#ifdef UNIV_DEBUG
ulint data_dummy; /* this is used to fool the compiler in
dtuple_validate */
#endif /* UNIV_DEBUG */
......
......@@ -252,7 +252,7 @@ dtype_print(
} else if (prtype == DATA_ENGLISH) {
fputs("DATA_ENGLISH", stderr);
} else {
fprintf(stderr, "prtype %lu", (ulong) mtype);
fprintf(stderr, "prtype %lu", (ulong) prtype);
}
}
......
......@@ -243,8 +243,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);
......@@ -270,7 +269,7 @@ dict_boot(void)
index = dict_mem_index_create("SYS_TABLES", "CLUST_IND",
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 1);
dict_mem_index_add_field(index, "NAME", 0, 0);
dict_mem_index_add_field(index, "NAME", 0);
index->id = DICT_TABLES_ID;
......@@ -280,7 +279,7 @@ dict_boot(void)
/*-------------------------*/
index = dict_mem_index_create("SYS_TABLES", "ID_IND",
DICT_HDR_SPACE, DICT_UNIQUE, 1);
dict_mem_index_add_field(index, "ID", 0, 0);
dict_mem_index_add_field(index, "ID", 0);
index->id = DICT_TABLE_IDS_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
......@@ -305,8 +304,8 @@ dict_boot(void)
index = dict_mem_index_create("SYS_COLUMNS", "CLUST_IND",
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, "TABLE_ID", 0, 0);
dict_mem_index_add_field(index, "POS", 0, 0);
dict_mem_index_add_field(index, "TABLE_ID", 0);
dict_mem_index_add_field(index, "POS", 0);
index->id = DICT_COLUMNS_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
......@@ -341,8 +340,8 @@ dict_boot(void)
index = dict_mem_index_create("SYS_INDEXES", "CLUST_IND",
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, "TABLE_ID", 0, 0);
dict_mem_index_add_field(index, "ID", 0, 0);
dict_mem_index_add_field(index, "TABLE_ID", 0);
dict_mem_index_add_field(index, "ID", 0);
index->id = DICT_INDEXES_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
......@@ -362,8 +361,8 @@ dict_boot(void)
index = dict_mem_index_create("SYS_FIELDS", "CLUST_IND",
DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, "INDEX_ID", 0, 0);
dict_mem_index_add_field(index, "POS", 0, 0);
dict_mem_index_add_field(index, "INDEX_ID", 0);
dict_mem_index_add_field(index, "POS", 0);
index->id = DICT_FIELDS_ID;
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
......
......@@ -1334,7 +1334,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);
}
......
......@@ -191,6 +191,7 @@ FILE* dict_foreign_err_file = NULL;
mutex_t dict_foreign_err_mutex; /* mutex protecting the foreign
and unique error buffers */
#ifndef UNIV_HOTBACKUP
/**********************************************************************
Makes all characters in a NUL-terminated UTF-8 string lower case. */
......@@ -201,6 +202,7 @@ dict_casedn_str(
{
innobase_casedn_str(a);
}
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Checks if the database name in two table names is the same. */
......@@ -1597,12 +1599,11 @@ dict_index_add_col(
/*===============*/
dict_index_t* index, /* in: index */
dict_col_t* col, /* in: column */
ulint order, /* in: order criterion */
ulint prefix_len) /* in: column prefix length */
{
dict_field_t* field;
dict_mem_index_add_field(index, col->name, order, prefix_len);
dict_mem_index_add_field(index, col->name, prefix_len);
field = dict_index_get_nth_field(index, index->n_def - 1);
......@@ -1645,8 +1646,7 @@ dict_index_copy(
for (i = start; i < end; i++) {
field = dict_index_get_nth_field(index2, i);
dict_index_add_col(index1, field->col, field->order,
field->prefix_len);
dict_index_add_col(index1, field->col, field->prefix_len);
}
}
......@@ -1731,9 +1731,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
......@@ -1750,7 +1748,7 @@ dict_index_build_internal_clust(
/* Add the mix id column */
dict_index_add_col(new_index,
dict_table_get_sys_col(table, DATA_MIX_ID), 0, 0);
dict_table_get_sys_col(table, DATA_MIX_ID), 0);
/* Copy the rest of fields */
dict_index_copy(new_index, index, table->mix_len,
......@@ -1794,15 +1792,15 @@ dict_index_build_internal_clust(
if (!(index->type & DICT_UNIQUE)) {
dict_index_add_col(new_index,
dict_table_get_sys_col(table, DATA_ROW_ID), 0, 0);
dict_table_get_sys_col(table, DATA_ROW_ID), 0);
trx_id_pos++;
}
dict_index_add_col(new_index,
dict_table_get_sys_col(table, DATA_TRX_ID), 0, 0);
dict_table_get_sys_col(table, DATA_TRX_ID), 0);
dict_index_add_col(new_index,
dict_table_get_sys_col(table, DATA_ROLL_PTR), 0, 0);
dict_table_get_sys_col(table, DATA_ROLL_PTR), 0);
for (i = 0; i < trx_id_pos; i++) {
......@@ -1856,7 +1854,7 @@ dict_index_build_internal_clust(
ut_ad(col->type.mtype != DATA_SYS);
if (col->aux == ULINT_UNDEFINED) {
dict_index_add_col(new_index, col, 0, 0);
dict_index_add_col(new_index, col, 0);
}
}
......@@ -1914,11 +1912,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 */
......@@ -1960,7 +1955,7 @@ dict_index_build_internal_non_clust(
field = dict_index_get_nth_field(clust_index, i);
if (field->col->aux == ULINT_UNDEFINED) {
dict_index_add_col(new_index, field->col, 0,
dict_index_add_col(new_index, field->col,
field->prefix_len);
}
}
......@@ -2093,9 +2088,8 @@ dict_foreign_find_index(
ulint n_cols, /* in: number of columns */
dict_index_t* types_idx, /* in: NULL or an index to whose types the
column types must match */
ibool check_charsets) /* in: whether to check charsets.
only has an effect if types_idx !=
NULL. */
ibool check_charsets)/* in: whether to check charsets.
only has an effect if types_idx != NULL. */
{
#ifndef UNIV_HOTBACKUP
dict_index_t* index;
......@@ -2148,6 +2142,7 @@ dict_foreign_find_index(
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
return(NULL);
#endif /* UNIV_HOTBACKUP */
}
......@@ -2545,6 +2540,7 @@ dict_scan_col(
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
return(NULL);
#endif /* UNIV_HOTBACKUP */
}
......@@ -2650,6 +2646,7 @@ dict_scan_table_name(
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
return(NULL);
#endif /* UNIV_HOTBACKUP */
}
......
......@@ -533,7 +533,7 @@ dict_load_fields(
field = rec_get_nth_field_old(rec, 4, &len);
dict_mem_index_add_field(index,
mem_heap_strdupl(heap, (char*) field, len), 0, prefix_len);
mem_heap_strdupl(heap, (char*) field, len), prefix_len);
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
}
......
......@@ -262,8 +262,6 @@ dict_mem_index_add_field(
/*=====================*/
dict_index_t* index, /* in: index */
const char* name, /* in: column name */
ulint order, /* in: order criterion; 0 means an
ascending order */
ulint prefix_len) /* in: 0 or the column prefix length
in a MySQL index like
INDEX (textcol(25)) */
......@@ -278,8 +276,6 @@ dict_mem_index_add_field(
field = dict_index_get_nth_field(index, index->n_def - 1);
field->name = name;
field->order = order;
field->prefix_len = prefix_len;
}
......
......@@ -510,10 +510,12 @@ fil_node_open_file(
ulint size_low;
ulint size_high;
ibool ret;
ibool success;
#ifndef UNIV_HOTBACKUP
byte* buf2;
byte* page;
ibool success;
ulint space_id;
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(system->mutex)));
......@@ -546,9 +548,6 @@ fil_node_open_file(
ut_a(0);
}
ut_a(space->purpose != FIL_LOG);
ut_a(space->id != 0);
os_file_get_size(node->handle, &size_low, &size_high);
size_bytes = (((ib_longlong)size_high) << 32)
......@@ -557,6 +556,9 @@ fil_node_open_file(
node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE);
#else
ut_a(space->purpose != FIL_LOG);
ut_a(space->id != 0);
if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
fprintf(stderr,
"InnoDB: Error: the size of single-table tablespace file %s\n"
......@@ -1642,7 +1644,7 @@ Decrements the count of pending insert buffer page merges. */
void
fil_decr_pending_ibuf_merges(
/*========================*/
/*=========================*/
ulint id) /* in: space id */
{
fil_system_t* system = fil_system;
......@@ -2805,6 +2807,7 @@ fil_load_single_table_tablespace(
filename);
srv_normalize_path_for_win(filepath);
#ifdef __WIN__
# ifndef UNIV_HOTBACKUP
/* If lower_case_table_names is 0 or 2, then MySQL allows database
directory names with upper case letters. On Windows, all table and
database names in InnoDB are internally always in lower case. Put the
......@@ -2812,6 +2815,7 @@ fil_load_single_table_tablespace(
internal data dictionary. */
dict_casedn_str(filepath);
# endif /* !UNIV_HOTBACKUP */
#endif
file = os_file_create_simple_no_error_handling(filepath, OS_FILE_OPEN,
OS_FILE_READ_ONLY, &success);
......@@ -3120,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) {
......@@ -3608,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);
......@@ -4293,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));
......
......@@ -791,7 +791,7 @@ Inits a file page whose prior contents should be ignored. */
static
void
fsp_init_file_page_low(
/*=====================*/
/*===================*/
byte* ptr) /* in: pointer to a page */
{
page_t* page;
......@@ -809,7 +809,6 @@ fsp_init_file_page_low(
/***************************************************************
Inits a file page whose prior contents should be ignored. */
static
void
fsp_init_file_page(
......@@ -893,9 +892,13 @@ fsp_header_init(
fsp_init_file_page(page, mtr);
mlog_write_ulint(page + FIL_PAGE_TYPE, FIL_PAGE_TYPE_FSP_HDR,
MLOG_2BYTES, mtr);
header = FSP_HEADER_OFFSET + page;
mlog_write_ulint(header + FSP_SPACE_ID, space, MLOG_4BYTES, mtr);
mlog_write_ulint(header + FSP_NOT_USED, 0, MLOG_4BYTES, mtr);
mlog_write_ulint(header + FSP_SIZE, size, MLOG_4BYTES, mtr);
mlog_write_ulint(header + FSP_FREE_LIMIT, 0, MLOG_4BYTES, mtr);
......@@ -938,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);
}
......@@ -1255,6 +1258,8 @@ fsp_fill_free_list(
SYNC_FSP_PAGE);
#endif /* UNIV_SYNC_DEBUG */
fsp_init_file_page(descr_page, mtr);
mlog_write_ulint(descr_page + FIL_PAGE_TYPE,
FIL_PAGE_TYPE_XDES, MLOG_2BYTES, mtr);
}
/* Initialize the ibuf bitmap page in a separate
......@@ -1721,7 +1726,8 @@ fsp_alloc_seg_inode_page(
buf_block_align(page)->check_index_page_at_flush = FALSE;
fil_page_set_type(page, FIL_PAGE_INODE);
mlog_write_ulint(page + FIL_PAGE_TYPE, FIL_PAGE_INODE,
MLOG_2BYTES, mtr);
#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_FSP_PAGE);
#endif /* UNIV_SYNC_DEBUG */
......@@ -2092,6 +2098,8 @@ fseg_create_general(
header = byte_offset
+ buf_page_get(space, page, RW_X_LATCH, mtr);
mlog_write_ulint(header - byte_offset + FIL_PAGE_TYPE,
FIL_PAGE_TYPE_SYS, MLOG_2BYTES, mtr);
}
mlog_write_ulint(header + FSEG_HDR_OFFSET,
......@@ -2849,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:
......@@ -3726,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);
......@@ -3767,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
......@@ -3801,6 +3816,7 @@ fsp_validate(
ut_a(frag_n_used == n_used);
mtr_commit(&mtr2);
return(TRUE);
}
......@@ -3889,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);
......@@ -3924,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;
......
......@@ -140,8 +140,7 @@ access order rules. */
/* The insert buffer control structure */
ibuf_t* ibuf = NULL;
static
ulint ibuf_rnd = 986058871;
static ulint ibuf_rnd = 986058871;
ulint ibuf_flush_count = 0;
......@@ -545,8 +544,8 @@ ibuf_data_init_for_space(
index = dict_mem_index_create(buf, "CLUST_IND", space,
DICT_CLUSTERED | DICT_UNIVERSAL | DICT_IBUF,2);
dict_mem_index_add_field(index, "PAGE_NO", 0, 0);
dict_mem_index_add_field(index, "TYPES", 0, 0);
dict_mem_index_add_field(index, "PAGE_NO", 0);
dict_mem_index_add_field(index, "TYPES", 0);
index->id = ut_dulint_add(DICT_IBUF_ID_MIN, space);
......@@ -574,18 +573,18 @@ ibuf_bitmap_page_init(
{
ulint bit_offset;
ulint byte_offset;
ulint i;
/* Write all zeros to the bitmap */
bit_offset = XDES_DESCRIBED_PER_PAGE * IBUF_BITS_PER_PAGE;
byte_offset = bit_offset / 8 + 1;
byte_offset = bit_offset / 8 + 1; /* better: (bit_offset + 7) / 8 */
for (i = IBUF_BITMAP; i < IBUF_BITMAP + byte_offset; i++) {
fil_page_set_type(page, FIL_PAGE_IBUF_BITMAP);
*(page + i) = (byte)0;
}
memset(page + IBUF_BITMAP, 0, byte_offset);
/* The remaining area (up to the page trailer) is uninitialized. */
mlog_write_initial_log_record(page, MLOG_IBUF_BITMAP_INIT, mtr);
}
......@@ -621,8 +620,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 +681,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;
......@@ -1140,7 +1141,7 @@ Add a column to the dummy index */
static
void
ibuf_dummy_index_add_col(
/*====================*/
/*=====================*/
dict_index_t* index, /* in: dummy index */
dtype_t* type, /* in: the data type of the column */
ulint len) /* in: length of the column */
......@@ -1152,7 +1153,7 @@ ibuf_dummy_index_add_col(
dtype_get_len(type),
dtype_get_prec(type));
dict_index_add_col(index,
dict_table_get_nth_col(index->table, i), 0, len);
dict_table_get_nth_col(index->table, i), len);
}
/************************************************************************
Deallocates a dummy index for inserting a record to a non-clustered index.
......@@ -1160,7 +1161,7 @@ Deallocates a dummy index for inserting a record to a non-clustered index.
static
void
ibuf_dummy_index_free(
/*====================*/
/*==================*/
dict_index_t* index) /* in: dummy index */
{
dict_table_t* table = index->table;
......@@ -1680,7 +1681,8 @@ ibuf_add_free_page(
flst_add_last(root + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,
page + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST_NODE, &mtr);
fil_page_set_type(page, FIL_PAGE_IBUF_FREE_LIST);
mlog_write_ulint(page + FIL_PAGE_TYPE, FIL_PAGE_IBUF_FREE_LIST,
MLOG_2BYTES, &mtr);
ibuf_data->seg_size++;
ibuf_data->free_list_len++;
......
......@@ -282,6 +282,7 @@ btr_node_ptr_delete(
dict_tree_t* tree, /* in: index tree */
page_t* page, /* in: page whose node pointer is deleted */
mtr_t* mtr); /* in: mtr */
#ifdef UNIV_DEBUG
/****************************************************************
Checks that the node pointer to a page is appropriate. */
......@@ -292,6 +293,7 @@ btr_check_node_ptr(
dict_tree_t* tree, /* in: index tree */
page_t* page, /* in: index page */
mtr_t* mtr); /* in: mtr */
#endif /* UNIV_DEBUG */
/*****************************************************************
Tries to merge the page first to the left immediate brother if such a
brother exists, and the node pointers to the current page and to the
......@@ -420,7 +422,7 @@ the index. */
ibool
btr_index_rec_validate(
/*====================*/
/*===================*/
/* out: TRUE if ok */
rec_t* rec, /* in: index record */
dict_index_t* index, /* in: index */
......
......@@ -267,7 +267,7 @@ the buffer pool. */
void
buf_page_make_young(
/*=================*/
/*================*/
buf_frame_t* frame); /* in: buffer frame of a file page */
/************************************************************************
Returns TRUE if the page can be found in the buffer pool hash table. NOTE
......
......@@ -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);
}
......
......@@ -9,7 +9,9 @@ Created 5/30/1994 Heikki Tuuri
#include "mem0mem.h"
#include "ut0rnd.h"
#ifdef UNIV_DEBUG
extern byte data_error;
#endif /* UNIV_DEBUG */
/*************************************************************************
Gets pointer to the type struct of SQL data field. */
......@@ -145,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);
}
......
......@@ -8,6 +8,7 @@ Created 1/16/1996 Heikki Tuuri
#include "mach0data.h"
#ifndef UNIV_HOTBACKUP
/**********************************************************************
Get the variable length bounds of the given character set.
......@@ -20,6 +21,7 @@ innobase_get_cset_width(
ulint cset, /* in: MySQL charset-collation code */
ulint* mbminlen, /* out: minimum length of a char (in bytes) */
ulint* mbmaxlen); /* out: maximum length of a char (in bytes) */
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Gets the MySQL charset-collation code for MySQL string types. */
......@@ -55,9 +57,21 @@ dtype_set_mblen(
{
ut_ad(type);
if (dtype_is_string_type(type->mtype)) {
#ifndef UNIV_HOTBACKUP
innobase_get_cset_width(dtype_get_charset_coll(type->prtype),
&type->mbminlen, &type->mbmaxlen);
ut_ad(type->mbminlen <= type->mbmaxlen);
#else /* !UNIV_HOTBACKUP */
#ifdef notdefined
printf("ibbackup: DEBUG: type->mtype=%lu, type->prtype=%lu\n",
type->mtype, type->prtype);
#endif
ut_a(type->mtype <= DATA_BINARY);
#ifdef notdefined
ut_a(type->prtype == (DATA_BINARY | DATA_NOT_NULL));
#endif
type->mbminlen = type->mbmaxlen = 1;
#endif /* !UNIV_HOTBACKUP */
} else {
type->mbminlen = type->mbmaxlen = 0;
}
......@@ -338,7 +352,6 @@ dtype_new_read_for_order_and_null_size(
dtype_set_mblen(type);
}
#ifndef UNIV_HOTBACKUP
/***************************************************************************
Returns the size of a fixed size data type, 0 if not a fixed size type. */
UNIV_INLINE
......@@ -383,6 +396,11 @@ dtype_get_fixed_size(
if (type->prtype & DATA_BINARY_TYPE) {
return(dtype_get_len(type));
} else {
#ifdef UNIV_HOTBACKUP
if (type->mbminlen == type->mbmaxlen) {
return(dtype_get_len(type));
}
#else /* UNIV_HOTBACKUP */
/* We play it safe here and ask MySQL for
mbminlen and mbmaxlen. Although
type->mbminlen and type->mbmaxlen are
......@@ -414,6 +432,7 @@ dtype_get_fixed_size(
if (mbminlen == mbmaxlen) {
return(dtype_get_len(type));
}
#endif /* !UNIV_HOTBACKUP */
}
/* fall through for variable-length charsets */
case DATA_VARCHAR:
......@@ -485,7 +504,6 @@ dtype_get_min_size(
return(0);
}
#endif /* !UNIV_HOTBACKUP */
/***************************************************************************
Returns a stored SQL NULL size for a type. For fixed length types it is
......
......@@ -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 */
......
......@@ -26,6 +26,7 @@ Created 1/8/1996 Heikki Tuuri
#include "ut0byte.h"
#include "trx0types.h"
#ifndef UNIV_HOTBACKUP
/**********************************************************************
Makes all characters in a NUL-terminated UTF-8 string lower case. */
......@@ -33,6 +34,7 @@ void
dict_casedn_str(
/*============*/
char* a); /* in/out: string to put in lower case */
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Get the database name length in a table name. */
......@@ -306,7 +308,7 @@ Checks if a table is in the dictionary cache. */
UNIV_INLINE
dict_table_t*
dict_table_check_if_in_cache_low(
/*==============================*/
/*=============================*/
/* out: table, NULL if not found */
const char* table_name); /* in: table name */
/**************************************************************************
......@@ -668,7 +670,6 @@ dict_index_add_col(
/*===============*/
dict_index_t* index, /* in: index */
dict_col_t* col, /* in: column */
ulint order, /* in: order criterion */
ulint prefix_len); /* in: column prefix length */
/***********************************************************************
Copies types of fields contained in index to tuple. */
......@@ -688,13 +689,6 @@ dict_index_get_tree(
/* out: index tree */
dict_index_t* index); /* in: index */
/*************************************************************************
Gets the field order criterion. */
UNIV_INLINE
ulint
dict_field_get_order(
/*=================*/
dict_field_t* field);
/*************************************************************************
Gets the field column. */
UNIV_INLINE
dict_col_t*
......
......@@ -326,19 +326,6 @@ dict_index_get_tree(
return(index->tree);
}
/*************************************************************************
Gets the field order criterion. */
UNIV_INLINE
ulint
dict_field_get_order(
/*=================*/
dict_field_t* field)
{
ut_ad(field);
return(field->order);
}
/*************************************************************************
Gets the field column. */
UNIV_INLINE
......@@ -494,7 +481,7 @@ Checks if a table is in the dictionary cache. */
UNIV_INLINE
dict_table_t*
dict_table_check_if_in_cache_low(
/*==============================*/
/*=============================*/
/* out: table, NULL if not found */
const char* table_name) /* in: table name */
{
......
......@@ -33,9 +33,6 @@ combination of types */
other index */
#define DICT_IBUF 8 /* insert buffer tree */
/* Flags for ordering an index field: OR'ing of the flags allowed */
#define DICT_DESCEND 1 /* in descending order (default ascending) */
/* Types for a table object */
#define DICT_TABLE_ORDINARY 1
#define DICT_TABLE_CLUSTER_MEMBER 2
......@@ -116,8 +113,6 @@ dict_mem_index_add_field(
/*=====================*/
dict_index_t* index, /* in: index */
const char* name, /* in: column name */
ulint order, /* in: order criterion; 0 means an
ascending order */
ulint prefix_len); /* in: 0 or the column prefix length
in a MySQL index like
INDEX (textcol(25)) */
......@@ -163,8 +158,6 @@ UTF-8 charset. In that charset, a character may take at most 3 bytes. */
struct dict_field_struct{
dict_col_t* col; /* pointer to the table column */
const char* name; /* name of the column */
ulint order; /* flags for ordering this field:
DICT_DESCEND, ... */
ulint prefix_len; /* 0 or the length of the column
prefix in bytes in a MySQL index of
type, e.g., INDEX (textcol(25));
......
......@@ -77,7 +77,7 @@ Gets a iboolean value from a query node. */
UNIV_INLINE
ibool
eval_node_get_ibool_val(
/*===================*/
/*====================*/
/* out: iboolean value */
que_node_t* node); /* in: query graph node */
/*********************************************************************
......
......@@ -149,7 +149,7 @@ Gets a iboolean value from a query node. */
UNIV_INLINE
ibool
eval_node_get_ibool_val(
/*===================*/
/*====================*/
/* out: iboolean value */
que_node_t* node) /* in: query graph node */
{
......@@ -170,7 +170,7 @@ Sets a iboolean value as the value of a function node. */
UNIV_INLINE
void
eval_node_set_ibool_val(
/*===================*/
/*====================*/
func_node_t* func_node, /* in: function node */
ibool val) /* in: value to set */
{
......
......@@ -63,7 +63,20 @@ extern fil_addr_t fil_addr_null;
#define FIL_PAGE_LSN 16 /* lsn of the end of the newest
modification log record to the page */
#define FIL_PAGE_TYPE 24 /* file page type: FIL_PAGE_INDEX,...,
2 bytes */
2 bytes.
The contents of this field can only
be trusted in the following case:
if the page is an uncompressed
B-tree index page, then it is
guaranteed that the value is
FIL_PAGE_INDEX.
The opposite does not hold.
In tablespaces created by
MySQL/InnoDB 5.1.7 or later, the
contents of this field is valid
for all uncompressed pages. */
#define FIL_PAGE_FILE_FLUSH_LSN 26 /* this is only defined for the
first page in a data file: the file
has been flushed to disk at least up
......@@ -79,11 +92,19 @@ extern fil_addr_t fil_addr_null;
to the last 4 bytes of FIL_PAGE_LSN */
#define FIL_PAGE_DATA_END 8
/* File page types */
#define FIL_PAGE_INDEX 17855
#define FIL_PAGE_UNDO_LOG 2
#define FIL_PAGE_INODE 3
#define FIL_PAGE_IBUF_FREE_LIST 4
/* File page types (values of FIL_PAGE_TYPE) */
#define FIL_PAGE_INDEX 17855 /* B-tree node */
#define FIL_PAGE_UNDO_LOG 2 /* Undo log page */
#define FIL_PAGE_INODE 3 /* Index node */
#define FIL_PAGE_IBUF_FREE_LIST 4 /* Insert buffer free list */
/* File page types introduced in MySQL/InnoDB 5.1.7 */
#define FIL_PAGE_TYPE_ALLOCATED 0 /* Freshly allocated page */
#define FIL_PAGE_IBUF_BITMAP 5 /* Insert buffer bitmap */
#define FIL_PAGE_TYPE_SYS 6 /* System page */
#define FIL_PAGE_TYPE_TRX_SYS 7 /* Transaction system data */
#define FIL_PAGE_TYPE_FSP_HDR 8 /* File space header */
#define FIL_PAGE_TYPE_XDES 9 /* Extent descriptor page */
#define FIL_PAGE_TYPE_BLOB 10 /* Uncompressed BLOB page */
/* Space types */
#define FIL_TABLESPACE 501
......@@ -271,7 +292,7 @@ Decrements the count of pending insert buffer page merges. */
void
fil_decr_pending_ibuf_merges(
/*========================*/
/*=========================*/
ulint id); /* in: space id */
/***********************************************************************
Parses the body of a log record written about an .ibd file operation. That is,
......
......@@ -477,7 +477,7 @@ searching for a lock in the hash table. */
UNIV_INLINE
ulint
lock_rec_fold(
/*===========*/
/*==========*/
/* out: folded value */
ulint space, /* in: space */
ulint page_no);/* in: page number */
......
......@@ -281,7 +281,7 @@ Reads a float. It is stored in a little-endian format. */
UNIV_INLINE
float
mach_float_read(
/*=============*/
/*============*/
/* out: float read */
byte* b); /* in: pointer to memory from where to read */
/*************************************************************
......@@ -289,7 +289,7 @@ Writes a float. It is stored in a little-endian format. */
UNIV_INLINE
void
mach_float_write(
/*==============*/
/*=============*/
byte* b, /* in: pointer to memory where to write */
float d); /* in: float */
/*************************************************************
......
......@@ -578,7 +578,7 @@ Reads a float. It is stored in a little-endian format. */
UNIV_INLINE
float
mach_float_read(
/*=============*/
/*============*/
/* out: float read */
byte* b) /* in: pointer to memory from where to read */
{
......@@ -604,7 +604,7 @@ Writes a float. It is stored in a little-endian format. */
UNIV_INLINE
void
mach_float_write(
/*==============*/
/*=============*/
byte* b, /* in: pointer to memory where to write */
float d) /* in: float */
{
......
......@@ -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
......
......@@ -237,7 +237,7 @@ Reads 8 bytes from a file page buffered in the buffer pool. */
dulint
mtr_read_dulint(
/*===========*/
/*============*/
/* out: value read */
byte* ptr, /* in: pointer from where to read */
mtr_t* mtr); /* in: mini-transaction handle */
......
......@@ -183,7 +183,10 @@ void
os_io_init_simple(void);
/*===================*/
/***************************************************************************
Creates a temporary file. */
Creates a temporary file. This function is like tmpfile(3), but
the temporary file is created in the MySQL temporary directory.
On Netware, this function is like tmpfile(3), because the C run-time
library of Netware does not expose the delete-on-close flag. */
FILE*
os_file_create_tmpfile(void);
......
......@@ -116,19 +116,20 @@ Allocates large pages memory. */
void*
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. */
void
os_mem_free_large(
/*=================*/
/*==============*/
void *ptr); /* in: number of bytes */
/********************************************************************
Sets the priority boost for threads released from waiting within the current
......
......@@ -80,7 +80,7 @@ os_thread_create(
thread */
int
os_thread_join(
/*=============*/
/*===========*/
os_thread_id_t thread_id); /* in: id of the thread to join */
/*********************************************************************
Exits the current thread. */
......
......@@ -461,7 +461,7 @@ TRUE if the record is the infimum record on a page. */
UNIV_INLINE
ibool
page_rec_is_infimum_low(
/*=====================*/
/*====================*/
/* out: TRUE if the infimum record */
ulint offset);/* in: record offset on page */
......@@ -798,7 +798,7 @@ debugging purposes. */
void
page_print(
/*======*/
/*=======*/
page_t* page, /* in: index page */
dict_index_t* index, /* in: dictionary index of the page */
ulint dn, /* in: print dn first and last entries
......
......@@ -314,7 +314,7 @@ TRUE if the record is the infimum record on a page. */
UNIV_INLINE
ibool
page_rec_is_infimum_low(
/*=====================*/
/*====================*/
/* out: TRUE if the infimum record */
ulint offset) /* in: record offset on page */
{
......
......@@ -343,8 +343,10 @@ pars_column_def(
sym_node_t* sym_node, /* in: column node in the
symbol table */
pars_res_word_t* type, /* in: data type */
sym_node_t* len); /* in: length of column, or
sym_node_t* len, /* in: length of column, or
NULL */
void* is_not_null); /* in: if not NULL, column
is of type NOT NULL. */
/*************************************************************************
Parses a table creation operation. */
......
......@@ -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.
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