mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
Split lines before binary operators, not after them.
This commit is contained in:
parent
917941e44c
commit
27dffa4f7d
44 changed files with 340 additions and 344 deletions
|
@ -143,8 +143,8 @@ btr_root_get(
|
||||||
root_page_no = dict_tree_get_page(tree);
|
root_page_no = dict_tree_get_page(tree);
|
||||||
|
|
||||||
root = btr_page_get(space, root_page_no, RW_X_LATCH, mtr);
|
root = btr_page_get(space, root_page_no, RW_X_LATCH, mtr);
|
||||||
ut_a((ibool)!!page_is_comp(root) ==
|
ut_a((ibool)!!page_is_comp(root)
|
||||||
dict_table_is_comp(tree->tree_index->table));
|
== dict_table_is_comp(tree->tree_index->table));
|
||||||
|
|
||||||
return(root);
|
return(root);
|
||||||
}
|
}
|
||||||
|
@ -597,8 +597,8 @@ btr_page_get_father_for_rec(
|
||||||
offsets = rec_get_offsets(node_ptr, index, offsets,
|
offsets = rec_get_offsets(node_ptr, index, offsets,
|
||||||
ULINT_UNDEFINED, &heap);
|
ULINT_UNDEFINED, &heap);
|
||||||
|
|
||||||
if (btr_node_ptr_get_child_page_no(node_ptr, offsets) !=
|
if (UNIV_UNLIKELY(btr_node_ptr_get_child_page_no(node_ptr, offsets)
|
||||||
buf_frame_get_page_no(page)) {
|
!= buf_frame_get_page_no(page))) {
|
||||||
rec_t* print_rec;
|
rec_t* print_rec;
|
||||||
fputs("InnoDB: Dump of the child page:\n", stderr);
|
fputs("InnoDB: Dump of the child page:\n", stderr);
|
||||||
buf_page_print(buf_frame_align(page));
|
buf_page_print(buf_frame_align(page));
|
||||||
|
@ -632,8 +632,8 @@ btr_page_get_father_for_rec(
|
||||||
"Then dump + drop + reimport.\n", stderr);
|
"Then dump + drop + reimport.\n", stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
ut_a(btr_node_ptr_get_child_page_no(node_ptr, offsets) ==
|
ut_a(btr_node_ptr_get_child_page_no(node_ptr, offsets)
|
||||||
buf_frame_get_page_no(page));
|
== buf_frame_get_page_no(page));
|
||||||
mem_heap_free(heap);
|
mem_heap_free(heap);
|
||||||
|
|
||||||
return(node_ptr);
|
return(node_ptr);
|
||||||
|
@ -2599,11 +2599,10 @@ btr_index_rec_validate(
|
||||||
if ((dict_index_get_nth_field(index, i)->prefix_len == 0
|
if ((dict_index_get_nth_field(index, i)->prefix_len == 0
|
||||||
&& len != UNIV_SQL_NULL && fixed_size
|
&& len != UNIV_SQL_NULL && fixed_size
|
||||||
&& len != 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 != UNIV_SQL_NULL
|
&& len
|
||||||
&& len >
|
> dict_index_get_nth_field(index, i)->prefix_len)) {
|
||||||
dict_index_get_nth_field(index, i)->prefix_len)) {
|
|
||||||
|
|
||||||
btr_index_rec_validate_report(page, rec, index);
|
btr_index_rec_validate_report(page, rec, index);
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
@ -2793,8 +2792,9 @@ loop:
|
||||||
left_page_no = btr_page_get_prev(page, &mtr);
|
left_page_no = btr_page_get_prev(page, &mtr);
|
||||||
|
|
||||||
ut_a((page_get_n_recs(page) > 0)
|
ut_a((page_get_n_recs(page) > 0)
|
||||||
|| ((level == 0) &&
|
|| ((level == 0)
|
||||||
(buf_frame_get_page_no(page) == dict_tree_get_page(tree))));
|
&& (buf_frame_get_page_no(page)
|
||||||
|
== dict_tree_get_page(tree))));
|
||||||
|
|
||||||
if (right_page_no != FIL_NULL) {
|
if (right_page_no != FIL_NULL) {
|
||||||
rec_t* right_rec;
|
rec_t* right_rec;
|
||||||
|
@ -2949,11 +2949,11 @@ loop:
|
||||||
} else {
|
} else {
|
||||||
right_node_ptr = btr_page_get_father_node_ptr
|
right_node_ptr = btr_page_get_father_node_ptr
|
||||||
(tree, right_page, &mtr);
|
(tree, right_page, &mtr);
|
||||||
if (page_rec_get_next(node_ptr) !=
|
if (page_rec_get_next(node_ptr)
|
||||||
page_get_supremum_rec(father_page)) {
|
!= page_get_supremum_rec(father_page)) {
|
||||||
|
|
||||||
if (right_node_ptr !=
|
if (right_node_ptr
|
||||||
page_rec_get_next(node_ptr)) {
|
!= page_rec_get_next(node_ptr)) {
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
fputs("InnoDB: node pointer to"
|
fputs("InnoDB: node pointer to"
|
||||||
" the right page is wrong\n",
|
" the right page is wrong\n",
|
||||||
|
|
|
@ -162,8 +162,8 @@ btr_cur_latch_leaves(
|
||||||
== buf_frame_get_page_no(page));
|
== buf_frame_get_page_no(page));
|
||||||
#endif /* UNIV_BTR_DEBUG */
|
#endif /* UNIV_BTR_DEBUG */
|
||||||
ut_a(page_is_comp(get_page) == page_is_comp(page));
|
ut_a(page_is_comp(get_page) == page_is_comp(page));
|
||||||
buf_block_align(get_page)->check_index_page_at_flush =
|
buf_block_align(get_page)->check_index_page_at_flush
|
||||||
TRUE;
|
= TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
get_page = btr_page_get(space, page_no, RW_X_LATCH, mtr);
|
get_page = btr_page_get(space, page_no, RW_X_LATCH, mtr);
|
||||||
|
@ -179,8 +179,8 @@ btr_cur_latch_leaves(
|
||||||
ut_a(btr_page_get_prev(get_page, mtr)
|
ut_a(btr_page_get_prev(get_page, mtr)
|
||||||
== buf_frame_get_page_no(page));
|
== buf_frame_get_page_no(page));
|
||||||
#endif /* UNIV_BTR_DEBUG */
|
#endif /* UNIV_BTR_DEBUG */
|
||||||
buf_block_align(get_page)->check_index_page_at_flush =
|
buf_block_align(get_page)->check_index_page_at_flush
|
||||||
TRUE;
|
= TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (latch_mode == BTR_SEARCH_PREV) {
|
} else if (latch_mode == BTR_SEARCH_PREV) {
|
||||||
|
@ -195,8 +195,8 @@ btr_cur_latch_leaves(
|
||||||
ut_a(btr_page_get_next(cursor->left_page, mtr)
|
ut_a(btr_page_get_next(cursor->left_page, mtr)
|
||||||
== buf_frame_get_page_no(page));
|
== buf_frame_get_page_no(page));
|
||||||
#endif /* UNIV_BTR_DEBUG */
|
#endif /* UNIV_BTR_DEBUG */
|
||||||
ut_a(page_is_comp(cursor->left_page) ==
|
ut_a(page_is_comp(cursor->left_page)
|
||||||
page_is_comp(page));
|
== page_is_comp(page));
|
||||||
buf_block_align(cursor->left_page)
|
buf_block_align(cursor->left_page)
|
||||||
->check_index_page_at_flush = TRUE;
|
->check_index_page_at_flush = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -452,9 +452,9 @@ retry_page_get:
|
||||||
ut_ad(insert_planned);
|
ut_ad(insert_planned);
|
||||||
ut_ad(cursor->thr);
|
ut_ad(cursor->thr);
|
||||||
|
|
||||||
if (ibuf_should_try(index, ignore_sec_unique) &&
|
if (ibuf_should_try(index, ignore_sec_unique)
|
||||||
ibuf_insert(tuple, index, space, page_no,
|
&& ibuf_insert(tuple, index, space, page_no,
|
||||||
cursor->thr)) {
|
cursor->thr)) {
|
||||||
/* Insertion to the insert buffer succeeded */
|
/* Insertion to the insert buffer succeeded */
|
||||||
cursor->flag = BTR_CUR_INSERT_TO_IBUF;
|
cursor->flag = BTR_CUR_INSERT_TO_IBUF;
|
||||||
if (UNIV_LIKELY_NULL(heap)) {
|
if (UNIV_LIKELY_NULL(heap)) {
|
||||||
|
@ -993,9 +993,9 @@ calculate_sizes_again:
|
||||||
/* Calculate the record size when entry is converted to a record */
|
/* Calculate the record size when entry is converted to a record */
|
||||||
rec_size = rec_get_converted_size(index, entry);
|
rec_size = rec_get_converted_size(index, entry);
|
||||||
|
|
||||||
if (rec_size >=
|
if (rec_size
|
||||||
ut_min(page_get_free_space_of_empty(page_is_comp(page)) / 2,
|
>= ut_min(page_get_free_space_of_empty(page_is_comp(page)) / 2,
|
||||||
REC_MAX_DATA_SIZE)) {
|
REC_MAX_DATA_SIZE)) {
|
||||||
|
|
||||||
/* The record is so big that we have to store some fields
|
/* The record is so big that we have to store some fields
|
||||||
externally on separate database pages */
|
externally on separate database pages */
|
||||||
|
@ -1199,9 +1199,9 @@ btr_cur_pessimistic_insert(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rec_get_converted_size(index, entry) >=
|
if (rec_get_converted_size(index, entry)
|
||||||
ut_min(page_get_free_space_of_empty(page_is_comp(page)) / 2,
|
>= ut_min(page_get_free_space_of_empty(page_is_comp(page)) / 2,
|
||||||
REC_MAX_DATA_SIZE)) {
|
REC_MAX_DATA_SIZE)) {
|
||||||
|
|
||||||
/* The record is so big that we have to store some fields
|
/* The record is so big that we have to store some fields
|
||||||
externally on separate database pages */
|
externally on separate database pages */
|
||||||
|
@ -1911,10 +1911,10 @@ btr_cur_pessimistic_update(
|
||||||
ULINT_UNDEFINED, &heap);
|
ULINT_UNDEFINED, &heap);
|
||||||
n_ext_vect = btr_push_update_extern_fields(ext_vect, offsets, update);
|
n_ext_vect = btr_push_update_extern_fields(ext_vect, offsets, update);
|
||||||
|
|
||||||
if (UNIV_UNLIKELY(rec_get_converted_size(index, new_entry) >=
|
if (UNIV_UNLIKELY(rec_get_converted_size(index, new_entry)
|
||||||
ut_min(page_get_free_space_of_empty
|
>= ut_min(page_get_free_space_of_empty
|
||||||
(page_is_comp(page)) / 2,
|
(page_is_comp(page)) / 2,
|
||||||
REC_MAX_DATA_SIZE))) {
|
REC_MAX_DATA_SIZE))) {
|
||||||
|
|
||||||
big_rec_vec = dtuple_convert_big_rec(index, new_entry,
|
big_rec_vec = dtuple_convert_big_rec(index, new_entry,
|
||||||
ext_vect, n_ext_vect);
|
ext_vect, n_ext_vect);
|
||||||
|
@ -2880,8 +2880,8 @@ btr_estimate_number_of_different_key_vals(
|
||||||
ulint* offsets_rec = offsets_rec_;
|
ulint* offsets_rec = offsets_rec_;
|
||||||
ulint* offsets_next_rec= offsets_next_rec_;
|
ulint* offsets_next_rec= offsets_next_rec_;
|
||||||
*offsets_rec_ = (sizeof offsets_rec_) / sizeof *offsets_rec_;
|
*offsets_rec_ = (sizeof offsets_rec_) / sizeof *offsets_rec_;
|
||||||
*offsets_next_rec_ =
|
*offsets_next_rec_
|
||||||
(sizeof offsets_next_rec_) / sizeof *offsets_next_rec_;
|
= (sizeof offsets_next_rec_) / sizeof *offsets_next_rec_;
|
||||||
|
|
||||||
n_cols = dict_index_get_n_unique(index);
|
n_cols = dict_index_get_n_unique(index);
|
||||||
|
|
||||||
|
@ -2974,9 +2974,8 @@ btr_estimate_number_of_different_key_vals(
|
||||||
|
|
||||||
offsets_rec = rec_get_offsets(rec, index, offsets_rec,
|
offsets_rec = rec_get_offsets(rec, index, offsets_rec,
|
||||||
ULINT_UNDEFINED, &heap);
|
ULINT_UNDEFINED, &heap);
|
||||||
total_external_size +=
|
total_external_size += btr_rec_get_externally_stored_len
|
||||||
btr_rec_get_externally_stored_len(rec,
|
(rec, offsets_rec);
|
||||||
offsets_rec);
|
|
||||||
mtr_commit(&mtr);
|
mtr_commit(&mtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2989,16 +2988,16 @@ btr_estimate_number_of_different_key_vals(
|
||||||
included in index->stat_n_leaf_pages) */
|
included in index->stat_n_leaf_pages) */
|
||||||
|
|
||||||
for (j = 0; j <= n_cols; j++) {
|
for (j = 0; j <= n_cols; j++) {
|
||||||
index->stat_n_diff_key_vals[j] =
|
index->stat_n_diff_key_vals[j]
|
||||||
(n_diff[j]
|
= ((n_diff[j]
|
||||||
* (ib_longlong)index->stat_n_leaf_pages
|
* (ib_longlong)index->stat_n_leaf_pages
|
||||||
+ BTR_KEY_VAL_ESTIMATE_N_PAGES - 1
|
+ BTR_KEY_VAL_ESTIMATE_N_PAGES - 1
|
||||||
+ total_external_size
|
+ total_external_size
|
||||||
+ not_empty_flag)
|
+ not_empty_flag)
|
||||||
/ (BTR_KEY_VAL_ESTIMATE_N_PAGES
|
/ (BTR_KEY_VAL_ESTIMATE_N_PAGES
|
||||||
+ total_external_size);
|
+ total_external_size));
|
||||||
|
|
||||||
/* If the tree is small, smaller than <
|
/* If the tree is small, smaller than
|
||||||
10 * BTR_KEY_VAL_ESTIMATE_N_PAGES + total_external_size, then
|
10 * BTR_KEY_VAL_ESTIMATE_N_PAGES + total_external_size, then
|
||||||
the above estimate is ok. For bigger trees it is common that we
|
the above estimate is ok. For bigger trees it is common that we
|
||||||
do not see any borders between key values in the few pages
|
do not see any borders between key values in the few pages
|
||||||
|
@ -3006,9 +3005,9 @@ btr_estimate_number_of_different_key_vals(
|
||||||
different key values, or even more. Let us try to approximate
|
different key values, or even more. Let us try to approximate
|
||||||
that: */
|
that: */
|
||||||
|
|
||||||
add_on = index->stat_n_leaf_pages /
|
add_on = index->stat_n_leaf_pages
|
||||||
(10 * (BTR_KEY_VAL_ESTIMATE_N_PAGES
|
/ (10 * (BTR_KEY_VAL_ESTIMATE_N_PAGES
|
||||||
+ total_external_size));
|
+ total_external_size));
|
||||||
|
|
||||||
if (add_on > BTR_KEY_VAL_ESTIMATE_N_PAGES) {
|
if (add_on > BTR_KEY_VAL_ESTIMATE_N_PAGES) {
|
||||||
add_on = BTR_KEY_VAL_ESTIMATE_N_PAGES;
|
add_on = BTR_KEY_VAL_ESTIMATE_N_PAGES;
|
||||||
|
@ -3292,8 +3291,8 @@ btr_push_update_extern_fields(
|
||||||
|
|
||||||
if (upd_get_nth_field(update, i)->extern_storage) {
|
if (upd_get_nth_field(update, i)->extern_storage) {
|
||||||
|
|
||||||
ext_vect[n_pushed] =
|
ext_vect[n_pushed] = upd_get_nth_field
|
||||||
upd_get_nth_field(update, i)->field_no;
|
(update, i)->field_no;
|
||||||
|
|
||||||
n_pushed++;
|
n_pushed++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,8 +227,8 @@ btr_pcur_restore_position(
|
||||||
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);
|
||||||
|
|
||||||
cursor->block_when_stored =
|
cursor->block_when_stored
|
||||||
buf_block_align(btr_pcur_get_page(cursor));
|
= buf_block_align(btr_pcur_get_page(cursor));
|
||||||
|
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
@ -320,10 +320,10 @@ btr_pcur_restore_position(
|
||||||
the cursor can now be on a different page! But we can retain
|
the cursor can now be on a different page! But we can retain
|
||||||
the value of old_rec */
|
the value of old_rec */
|
||||||
|
|
||||||
cursor->block_when_stored =
|
cursor->block_when_stored = buf_block_align
|
||||||
buf_block_align(btr_pcur_get_page(cursor));
|
(btr_pcur_get_page(cursor));
|
||||||
cursor->modify_clock =
|
cursor->modify_clock = buf_block_get_modify_clock
|
||||||
buf_block_get_modify_clock(cursor->block_when_stored);
|
(cursor->block_when_stored);
|
||||||
cursor->old_stored = BTR_PCUR_OLD_STORED;
|
cursor->old_stored = BTR_PCUR_OLD_STORED;
|
||||||
|
|
||||||
mem_heap_free(heap);
|
mem_heap_free(heap);
|
||||||
|
|
|
@ -160,8 +160,8 @@ and the io-operation for loading the page is queued. The io-handler thread
|
||||||
releases the X-lock on the frame and resets the io_fix field
|
releases the X-lock on the frame and resets the io_fix field
|
||||||
when the io operation completes.
|
when the io operation completes.
|
||||||
|
|
||||||
A thread may request the above operation using the buf_page_get-
|
A thread may request the above operation using the function
|
||||||
function. It may then continue to request a lock on the frame.
|
buf_page_get(). It may then continue to request a lock on the frame.
|
||||||
The lock is granted when the io-handler releases the x-lock.
|
The lock is granted when the io-handler releases the x-lock.
|
||||||
|
|
||||||
Read-ahead
|
Read-ahead
|
||||||
|
@ -371,8 +371,8 @@ buf_page_is_corrupted(
|
||||||
}
|
}
|
||||||
|
|
||||||
checksum = buf_calc_page_new_checksum(read_buf);
|
checksum = buf_calc_page_new_checksum(read_buf);
|
||||||
checksum_field = mach_read_from_4(read_buf +
|
checksum_field = mach_read_from_4(read_buf
|
||||||
FIL_PAGE_SPACE_OR_CHKSUM);
|
+ FIL_PAGE_SPACE_OR_CHKSUM);
|
||||||
|
|
||||||
/* InnoDB versions < 4.0.14 and < 4.1.1 stored the space id
|
/* InnoDB versions < 4.0.14 and < 4.1.1 stored the space id
|
||||||
(always equal to 0), to FIL_PAGE_SPACE_SPACE_OR_CHKSUM */
|
(always equal to 0), to FIL_PAGE_SPACE_SPACE_OR_CHKSUM */
|
||||||
|
@ -659,9 +659,9 @@ buf_pool_init(
|
||||||
the window */
|
the window */
|
||||||
|
|
||||||
os_awe_map_physical_mem_to_window(buf_pool->frame_zero,
|
os_awe_map_physical_mem_to_window(buf_pool->frame_zero,
|
||||||
n_frames *
|
n_frames
|
||||||
(UNIV_PAGE_SIZE
|
* (UNIV_PAGE_SIZE
|
||||||
/ OS_AWE_X86_PAGE_SIZE),
|
/ OS_AWE_X86_PAGE_SIZE),
|
||||||
buf_pool->awe_info);
|
buf_pool->awe_info);
|
||||||
/*----------------------------------------*/
|
/*----------------------------------------*/
|
||||||
}
|
}
|
||||||
|
@ -2112,11 +2112,11 @@ buf_validate(void)
|
||||||
n_lru_flush++;
|
n_lru_flush++;
|
||||||
ut_a(rw_lock_is_locked
|
ut_a(rw_lock_is_locked
|
||||||
(&block->lock, RW_LOCK_SHARED));
|
(&block->lock, RW_LOCK_SHARED));
|
||||||
} else if (block->flush_type ==
|
} else if (block->flush_type
|
||||||
BUF_FLUSH_LIST) {
|
== BUF_FLUSH_LIST) {
|
||||||
n_list_flush++;
|
n_list_flush++;
|
||||||
} else if (block->flush_type ==
|
} else if (block->flush_type
|
||||||
BUF_FLUSH_SINGLE_PAGE) {
|
== BUF_FLUSH_SINGLE_PAGE) {
|
||||||
n_single_flush++;
|
n_single_flush++;
|
||||||
} else {
|
} else {
|
||||||
ut_error;
|
ut_error;
|
||||||
|
|
|
@ -890,9 +890,8 @@ buf_flush_batch(
|
||||||
old_page_count = page_count;
|
old_page_count = page_count;
|
||||||
|
|
||||||
/* Try to flush also all the neighbors */
|
/* Try to flush also all the neighbors */
|
||||||
page_count +=
|
page_count += buf_flush_try_neighbors
|
||||||
buf_flush_try_neighbors(space, offset,
|
(space, offset, flush_type);
|
||||||
flush_type);
|
|
||||||
/* fprintf(stderr,
|
/* fprintf(stderr,
|
||||||
"Flush type %lu, page no %lu, neighb %lu\n",
|
"Flush type %lu, page no %lu, neighb %lu\n",
|
||||||
flush_type, offset,
|
flush_type, offset,
|
||||||
|
|
|
@ -213,8 +213,8 @@ buf_read_ahead_random(
|
||||||
|
|
||||||
mutex_enter(&(buf_pool->mutex));
|
mutex_enter(&(buf_pool->mutex));
|
||||||
|
|
||||||
if (buf_pool->n_pend_reads >
|
if (buf_pool->n_pend_reads
|
||||||
buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
|
> buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
|
||||||
mutex_exit(&(buf_pool->mutex));
|
mutex_exit(&(buf_pool->mutex));
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
@ -426,8 +426,8 @@ buf_read_ahead_linear(
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf_pool->n_pend_reads >
|
if (buf_pool->n_pend_reads
|
||||||
buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
|
> buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
|
||||||
mutex_exit(&(buf_pool->mutex));
|
mutex_exit(&(buf_pool->mutex));
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
@ -463,8 +463,8 @@ buf_read_ahead_linear(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fail_count > BUF_READ_AHEAD_LINEAR_AREA -
|
if (fail_count > BUF_READ_AHEAD_LINEAR_AREA
|
||||||
BUF_READ_AHEAD_LINEAR_THRESHOLD) {
|
- BUF_READ_AHEAD_LINEAR_THRESHOLD) {
|
||||||
/* Too many failures: return */
|
/* Too many failures: return */
|
||||||
|
|
||||||
mutex_exit(&(buf_pool->mutex));
|
mutex_exit(&(buf_pool->mutex));
|
||||||
|
@ -615,8 +615,8 @@ buf_read_ibuf_merge_pages(
|
||||||
#ifdef UNIV_IBUF_DEBUG
|
#ifdef UNIV_IBUF_DEBUG
|
||||||
ut_a(n_stored < UNIV_PAGE_SIZE);
|
ut_a(n_stored < UNIV_PAGE_SIZE);
|
||||||
#endif
|
#endif
|
||||||
while (buf_pool->n_pend_reads >
|
while (buf_pool->n_pend_reads
|
||||||
buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
|
> buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
|
||||||
os_thread_sleep(500000);
|
os_thread_sleep(500000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -565,8 +565,8 @@ dtuple_convert_big_rec(
|
||||||
|
|
||||||
dfield = dtuple_get_nth_field(entry, i);
|
dfield = dtuple_get_nth_field(entry, i);
|
||||||
|
|
||||||
if (dfield->len != UNIV_SQL_NULL &&
|
if (dfield->len != UNIV_SQL_NULL
|
||||||
dfield->len > longest) {
|
&& dfield->len > longest) {
|
||||||
|
|
||||||
longest = dfield->len;
|
longest = dfield->len;
|
||||||
|
|
||||||
|
|
|
@ -768,15 +768,15 @@ dict_init(void)
|
||||||
|
|
||||||
mutex_create(&dict_sys->mutex, SYNC_DICT);
|
mutex_create(&dict_sys->mutex, SYNC_DICT);
|
||||||
|
|
||||||
dict_sys->table_hash = hash_create(buf_pool_get_max_size() /
|
dict_sys->table_hash = hash_create(buf_pool_get_max_size()
|
||||||
(DICT_POOL_PER_TABLE_HASH *
|
/ (DICT_POOL_PER_TABLE_HASH
|
||||||
UNIV_WORD_SIZE));
|
* UNIV_WORD_SIZE));
|
||||||
dict_sys->table_id_hash = hash_create(buf_pool_get_max_size() /
|
dict_sys->table_id_hash = hash_create(buf_pool_get_max_size()
|
||||||
(DICT_POOL_PER_TABLE_HASH *
|
/ (DICT_POOL_PER_TABLE_HASH
|
||||||
UNIV_WORD_SIZE));
|
* UNIV_WORD_SIZE));
|
||||||
dict_sys->col_hash = hash_create(buf_pool_get_max_size() /
|
dict_sys->col_hash = hash_create(buf_pool_get_max_size()
|
||||||
(DICT_POOL_PER_COL_HASH *
|
/ (DICT_POOL_PER_COL_HASH
|
||||||
UNIV_WORD_SIZE));
|
* UNIV_WORD_SIZE));
|
||||||
dict_sys->size = 0;
|
dict_sys->size = 0;
|
||||||
|
|
||||||
UT_LIST_INIT(dict_sys->table_LRU);
|
UT_LIST_INIT(dict_sys->table_LRU);
|
||||||
|
@ -1137,8 +1137,8 @@ dict_table_rename_in_cache(
|
||||||
foreign = UT_LIST_GET_FIRST(table->foreign_list);
|
foreign = UT_LIST_GET_FIRST(table->foreign_list);
|
||||||
|
|
||||||
while (foreign != NULL) {
|
while (foreign != NULL) {
|
||||||
if (ut_strlen(foreign->foreign_table_name) <
|
if (ut_strlen(foreign->foreign_table_name)
|
||||||
ut_strlen(table->name)) {
|
< ut_strlen(table->name)) {
|
||||||
/* Allocate a longer name buffer;
|
/* Allocate a longer name buffer;
|
||||||
TODO: store buf len to save memory */
|
TODO: store buf len to save memory */
|
||||||
|
|
||||||
|
@ -1209,8 +1209,8 @@ dict_table_rename_in_cache(
|
||||||
foreign = UT_LIST_GET_FIRST(table->referenced_list);
|
foreign = UT_LIST_GET_FIRST(table->referenced_list);
|
||||||
|
|
||||||
while (foreign != NULL) {
|
while (foreign != NULL) {
|
||||||
if (ut_strlen(foreign->referenced_table_name) <
|
if (ut_strlen(foreign->referenced_table_name)
|
||||||
ut_strlen(table->name)) {
|
< ut_strlen(table->name)) {
|
||||||
/* Allocate a longer name buffer;
|
/* Allocate a longer name buffer;
|
||||||
TODO: store buf len to save memory */
|
TODO: store buf len to save memory */
|
||||||
|
|
||||||
|
@ -1544,10 +1544,10 @@ dict_index_add_to_cache(
|
||||||
|
|
||||||
if (!UNIV_UNLIKELY(new_index->type & DICT_UNIVERSAL)) {
|
if (!UNIV_UNLIKELY(new_index->type & DICT_UNIVERSAL)) {
|
||||||
|
|
||||||
new_index->stat_n_diff_key_vals =
|
new_index->stat_n_diff_key_vals = mem_heap_alloc
|
||||||
mem_heap_alloc(new_index->heap,
|
(new_index->heap,
|
||||||
(1 + dict_index_get_n_unique(new_index))
|
(1 + dict_index_get_n_unique(new_index))
|
||||||
* sizeof(ib_longlong));
|
* sizeof(ib_longlong));
|
||||||
/* Give some sensible values to stat_n_... in case we do
|
/* Give some sensible values to stat_n_... in case we do
|
||||||
not calculate statistics quickly enough */
|
not calculate statistics quickly enough */
|
||||||
|
|
||||||
|
@ -2142,9 +2142,9 @@ dict_foreign_find_index(
|
||||||
ulint n_cols, /* in: number of columns */
|
ulint n_cols, /* in: number of columns */
|
||||||
dict_index_t* types_idx, /* in: NULL or an index to whose types the
|
dict_index_t* types_idx, /* in: NULL or an index to whose types the
|
||||||
column types must match */
|
column types must match */
|
||||||
ibool check_charsets) /* in: whether to check charsets.
|
ibool check_charsets)
|
||||||
only has an effect if types_idx !=
|
/* in: whether to check charsets.
|
||||||
NULL. */
|
only has an effect if types_idx != NULL */
|
||||||
{
|
{
|
||||||
dict_index_t* index;
|
dict_index_t* index;
|
||||||
const char* col_name;
|
const char* col_name;
|
||||||
|
@ -2777,8 +2777,8 @@ scan_more:
|
||||||
/* Starting quote: remember the quote character. */
|
/* Starting quote: remember the quote character. */
|
||||||
quote = *sptr;
|
quote = *sptr;
|
||||||
} else if (*sptr == '#'
|
} else if (*sptr == '#'
|
||||||
|| (sptr[0] == '-' && sptr[1] == '-' &&
|
|| (sptr[0] == '-' && sptr[1] == '-'
|
||||||
sptr[2] == ' ')) {
|
&& sptr[2] == ' ')) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
/* In Unix a newline is 0x0A while in Windows
|
/* In Unix a newline is 0x0A while in Windows
|
||||||
it is 0x0D followed by 0x0A */
|
it is 0x0D followed by 0x0A */
|
||||||
|
@ -3193,8 +3193,8 @@ col_loop1:
|
||||||
foreign->foreign_col_names = mem_heap_alloc(foreign->heap,
|
foreign->foreign_col_names = mem_heap_alloc(foreign->heap,
|
||||||
i * sizeof(void*));
|
i * sizeof(void*));
|
||||||
for (i = 0; i < foreign->n_fields; i++) {
|
for (i = 0; i < foreign->n_fields; i++) {
|
||||||
foreign->foreign_col_names[i] =
|
foreign->foreign_col_names[i] = mem_heap_strdup
|
||||||
mem_heap_strdup(foreign->heap, columns[i]->name);
|
(foreign->heap, columns[i]->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = dict_scan_table_name(cs, ptr, &referenced_table, name,
|
ptr = dict_scan_table_name(cs, ptr, &referenced_table, name,
|
||||||
|
@ -3842,8 +3842,8 @@ dict_tree_build_node_ptr(
|
||||||
dtype_set(dfield_get_type(field), DATA_SYS_CHILD, DATA_NOT_NULL, 4, 0);
|
dtype_set(dfield_get_type(field), DATA_SYS_CHILD, DATA_NOT_NULL, 4, 0);
|
||||||
|
|
||||||
rec_copy_prefix_to_dtuple(tuple, rec, ind, n_unique, heap);
|
rec_copy_prefix_to_dtuple(tuple, rec, ind, n_unique, heap);
|
||||||
dtuple_set_info_bits(tuple, dtuple_get_info_bits(tuple) |
|
dtuple_set_info_bits(tuple, dtuple_get_info_bits(tuple)
|
||||||
REC_STATUS_NODE_PTR);
|
| REC_STATUS_NODE_PTR);
|
||||||
|
|
||||||
ut_ad(dtuple_check_typed(tuple));
|
ut_ad(dtuple_check_typed(tuple));
|
||||||
|
|
||||||
|
|
|
@ -1013,8 +1013,8 @@ static
|
||||||
void
|
void
|
||||||
dict_load_foreign_cols(
|
dict_load_foreign_cols(
|
||||||
/*===================*/
|
/*===================*/
|
||||||
const char* id, /* in: foreign constraint id as a null-
|
const char* id, /* in: foreign constraint id as a
|
||||||
terminated string */
|
null-terminated string */
|
||||||
dict_foreign_t* foreign)/* in: foreign constraint object */
|
dict_foreign_t* foreign)/* in: foreign constraint object */
|
||||||
{
|
{
|
||||||
dict_table_t* sys_foreign_cols;
|
dict_table_t* sys_foreign_cols;
|
||||||
|
@ -1067,12 +1067,12 @@ dict_load_foreign_cols(
|
||||||
ut_a(i == mach_read_from_4(field));
|
ut_a(i == mach_read_from_4(field));
|
||||||
|
|
||||||
field = rec_get_nth_field_old(rec, 4, &len);
|
field = rec_get_nth_field_old(rec, 4, &len);
|
||||||
foreign->foreign_col_names[i] =
|
foreign->foreign_col_names[i] = mem_heap_strdupl
|
||||||
mem_heap_strdupl(foreign->heap, (char*) field, len);
|
(foreign->heap, (char*) field, len);
|
||||||
|
|
||||||
field = rec_get_nth_field_old(rec, 5, &len);
|
field = rec_get_nth_field_old(rec, 5, &len);
|
||||||
foreign->referenced_col_names[i] =
|
foreign->referenced_col_names[i] = mem_heap_strdupl
|
||||||
mem_heap_strdupl(foreign->heap, (char*) field, len);
|
(foreign->heap, (char*) field, len);
|
||||||
|
|
||||||
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
|
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
|
||||||
}
|
}
|
||||||
|
@ -1165,8 +1165,8 @@ dict_load_foreign(
|
||||||
|
|
||||||
foreign = dict_mem_foreign_create();
|
foreign = dict_mem_foreign_create();
|
||||||
|
|
||||||
foreign->n_fields =
|
foreign->n_fields = mach_read_from_4
|
||||||
mach_read_from_4(rec_get_nth_field_old(rec, 5, &len));
|
(rec_get_nth_field_old(rec, 5, &len));
|
||||||
|
|
||||||
ut_a(len == 4);
|
ut_a(len == 4);
|
||||||
|
|
||||||
|
@ -1178,12 +1178,12 @@ dict_load_foreign(
|
||||||
foreign->id = mem_heap_strdup(foreign->heap, id);
|
foreign->id = mem_heap_strdup(foreign->heap, id);
|
||||||
|
|
||||||
field = rec_get_nth_field_old(rec, 3, &len);
|
field = rec_get_nth_field_old(rec, 3, &len);
|
||||||
foreign->foreign_table_name =
|
foreign->foreign_table_name = mem_heap_strdupl
|
||||||
mem_heap_strdupl(foreign->heap, (char*) field, len);
|
(foreign->heap, (char*) field, len);
|
||||||
|
|
||||||
field = rec_get_nth_field_old(rec, 4, &len);
|
field = rec_get_nth_field_old(rec, 4, &len);
|
||||||
foreign->referenced_table_name =
|
foreign->referenced_table_name = mem_heap_strdupl
|
||||||
mem_heap_strdupl(foreign->heap, (char*) field, len);
|
(foreign->heap, (char*) field, len);
|
||||||
|
|
||||||
btr_pcur_close(&pcur);
|
btr_pcur_close(&pcur);
|
||||||
mtr_commit(&mtr);
|
mtr_commit(&mtr);
|
||||||
|
|
|
@ -333,10 +333,10 @@ eval_predefined_2(
|
||||||
ut_ad(len2 >= len1);
|
ut_ad(len2 >= len1);
|
||||||
|
|
||||||
if (len2 > len1) {
|
if (len2 > len1) {
|
||||||
int_val = (lint)(len1 +
|
int_val = (lint) (len1
|
||||||
(eval_rnd % (len2 - len1 + 1)));
|
+ (eval_rnd % (len2 - len1 + 1)));
|
||||||
} else {
|
} else {
|
||||||
int_val = (lint)len1;
|
int_val = (lint) len1;
|
||||||
}
|
}
|
||||||
|
|
||||||
eval_rnd = ut_rnd_gen_next_ulint(eval_rnd);
|
eval_rnd = ut_rnd_gen_next_ulint(eval_rnd);
|
||||||
|
|
|
@ -3237,8 +3237,8 @@ fil_load_single_table_tablespaces(void)
|
||||||
|
|
||||||
/* We found a symlink or a file */
|
/* We found a symlink or a file */
|
||||||
if (strlen(fileinfo.name) > 4
|
if (strlen(fileinfo.name) > 4
|
||||||
&& 0 == strcmp(fileinfo.name +
|
&& 0 == strcmp(fileinfo.name
|
||||||
strlen(fileinfo.name) - 4,
|
+ strlen(fileinfo.name) - 4,
|
||||||
".ibd")) {
|
".ibd")) {
|
||||||
/* The name ends in .ibd; try opening
|
/* The name ends in .ibd; try opening
|
||||||
the file */
|
the file */
|
||||||
|
@ -3684,8 +3684,8 @@ fil_extend_space_to_desired_size(
|
||||||
/* Keep the last data file size info up to date, rounded to
|
/* Keep the last data file size info up to date, rounded to
|
||||||
full megabytes */
|
full megabytes */
|
||||||
|
|
||||||
srv_data_file_sizes[srv_n_data_files - 1] =
|
srv_data_file_sizes[srv_n_data_files - 1]
|
||||||
(node->size / pages_per_mb) * pages_per_mb;
|
= (node->size / pages_per_mb) * pages_per_mb;
|
||||||
}
|
}
|
||||||
#endif /* !UNIV_HOTBACKUP */
|
#endif /* !UNIV_HOTBACKUP */
|
||||||
|
|
||||||
|
@ -4129,8 +4129,8 @@ fil_io(
|
||||||
offset_low = ((block_offset << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL)
|
offset_low = ((block_offset << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL)
|
||||||
+ byte_offset;
|
+ byte_offset;
|
||||||
|
|
||||||
ut_a(node->size - block_offset >=
|
ut_a(node->size - block_offset
|
||||||
(byte_offset + len + (UNIV_PAGE_SIZE - 1)) / UNIV_PAGE_SIZE);
|
>= (byte_offset + len + (UNIV_PAGE_SIZE - 1)) / UNIV_PAGE_SIZE);
|
||||||
|
|
||||||
/* Do aio */
|
/* Do aio */
|
||||||
|
|
||||||
|
|
|
@ -630,8 +630,8 @@ xdes_calc_descriptor_index(
|
||||||
/* out: descriptor index */
|
/* out: descriptor index */
|
||||||
ulint offset) /* in: page offset */
|
ulint offset) /* in: page offset */
|
||||||
{
|
{
|
||||||
return(ut_2pow_remainder(offset, XDES_DESCRIBED_PER_PAGE) /
|
return(ut_2pow_remainder(offset, XDES_DESCRIBED_PER_PAGE)
|
||||||
FSP_EXTENT_SIZE);
|
/ FSP_EXTENT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
@ -2259,8 +2259,8 @@ fseg_fill_free_list(
|
||||||
for (i = 0; i < FSEG_FREE_LIST_MAX_LEN; i++) {
|
for (i = 0; i < FSEG_FREE_LIST_MAX_LEN; i++) {
|
||||||
descr = xdes_get_descriptor(space, hint, mtr);
|
descr = xdes_get_descriptor(space, hint, mtr);
|
||||||
|
|
||||||
if ((descr == NULL) ||
|
if ((descr == NULL)
|
||||||
(XDES_FREE != xdes_get_state(descr, mtr))) {
|
|| (XDES_FREE != xdes_get_state(descr, mtr))) {
|
||||||
|
|
||||||
/* We cannot allocate the desired extent: stop */
|
/* We cannot allocate the desired extent: stop */
|
||||||
|
|
||||||
|
@ -2364,8 +2364,8 @@ fseg_alloc_free_page_low(
|
||||||
|
|
||||||
ut_ad(mtr);
|
ut_ad(mtr);
|
||||||
ut_ad((direction >= FSP_UP) && (direction <= FSP_NO_DIR));
|
ut_ad((direction >= FSP_UP) && (direction <= FSP_NO_DIR));
|
||||||
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N) ==
|
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N)
|
||||||
FSEG_MAGIC_N_VALUE);
|
== FSEG_MAGIC_N_VALUE);
|
||||||
seg_id = mtr_read_dulint(seg_inode + FSEG_ID, mtr);
|
seg_id = mtr_read_dulint(seg_inode + FSEG_ID, mtr);
|
||||||
|
|
||||||
ut_ad(ut_dulint_cmp(seg_id, ut_dulint_zero) > 0);
|
ut_ad(ut_dulint_cmp(seg_id, ut_dulint_zero) > 0);
|
||||||
|
@ -2421,8 +2421,8 @@ fseg_alloc_free_page_low(
|
||||||
} else if ((direction != FSP_NO_DIR)
|
} else if ((direction != FSP_NO_DIR)
|
||||||
&& ((reserved - used) < reserved / FSEG_FILLFACTOR)
|
&& ((reserved - used) < reserved / FSEG_FILLFACTOR)
|
||||||
&& (used >= FSEG_FRAG_LIMIT)
|
&& (used >= FSEG_FRAG_LIMIT)
|
||||||
&& (!!(ret_descr =
|
&& (!!(ret_descr
|
||||||
fseg_alloc_free_extent(seg_inode, space, mtr)))) {
|
= fseg_alloc_free_extent(seg_inode, space, mtr)))) {
|
||||||
|
|
||||||
/* 3. We take any free extent (which was already assigned above
|
/* 3. We take any free extent (which was already assigned above
|
||||||
===============================================================
|
===============================================================
|
||||||
|
@ -2926,8 +2926,8 @@ fseg_mark_page_used(
|
||||||
|
|
||||||
descr = xdes_get_descriptor(space, page, mtr);
|
descr = xdes_get_descriptor(space, page, mtr);
|
||||||
|
|
||||||
ut_ad(mtr_read_ulint(seg_inode + FSEG_ID, MLOG_4BYTES, mtr) ==
|
ut_ad(mtr_read_ulint(seg_inode + FSEG_ID, MLOG_4BYTES, mtr)
|
||||||
mtr_read_ulint(descr + XDES_ID, MLOG_4BYTES, mtr));
|
== mtr_read_ulint(descr + XDES_ID, MLOG_4BYTES, mtr));
|
||||||
|
|
||||||
if (xdes_is_free(descr, mtr)) {
|
if (xdes_is_free(descr, mtr)) {
|
||||||
/* We move the extent from the free list to the
|
/* We move the extent from the free list to the
|
||||||
|
@ -2981,8 +2981,8 @@ fseg_free_page_low(
|
||||||
ulint i;
|
ulint i;
|
||||||
|
|
||||||
ut_ad(seg_inode && mtr);
|
ut_ad(seg_inode && mtr);
|
||||||
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N) ==
|
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N)
|
||||||
FSEG_MAGIC_N_VALUE);
|
== FSEG_MAGIC_N_VALUE);
|
||||||
|
|
||||||
/* Drop search system page hash index if the page is found in
|
/* Drop search system page hash index if the page is found in
|
||||||
the pool and is hashed */
|
the pool and is hashed */
|
||||||
|
@ -3656,8 +3656,8 @@ fsp_validate(
|
||||||
frag_n_used = mtr_read_ulint(header + FSP_FRAG_N_USED,
|
frag_n_used = mtr_read_ulint(header + FSP_FRAG_N_USED,
|
||||||
MLOG_4BYTES, &mtr);
|
MLOG_4BYTES, &mtr);
|
||||||
|
|
||||||
n_full_frag_pages = FSP_EXTENT_SIZE *
|
n_full_frag_pages = FSP_EXTENT_SIZE
|
||||||
flst_get_len(header + FSP_FULL_FRAG, &mtr);
|
* flst_get_len(header + FSP_FULL_FRAG, &mtr);
|
||||||
|
|
||||||
ut_a(free_limit <= size || (space != 0 && size < FSP_EXTENT_SIZE));
|
ut_a(free_limit <= size || (space != 0 && size < FSP_EXTENT_SIZE));
|
||||||
|
|
||||||
|
|
|
@ -2001,10 +2001,10 @@ ibuf_get_merge_page_nos(
|
||||||
if ((prev_page_no == first_page_no
|
if ((prev_page_no == first_page_no
|
||||||
&& prev_space_id == first_space_id)
|
&& prev_space_id == first_space_id)
|
||||||
|| contract
|
|| contract
|
||||||
|| (volume_for_page >
|
|| (volume_for_page
|
||||||
((IBUF_MERGE_THRESHOLD - 1)
|
> ((IBUF_MERGE_THRESHOLD - 1)
|
||||||
* 4 * UNIV_PAGE_SIZE
|
* 4 * UNIV_PAGE_SIZE
|
||||||
/ IBUF_PAGE_SIZE_PER_FREE_SPACE)
|
/ IBUF_PAGE_SIZE_PER_FREE_SPACE)
|
||||||
/ IBUF_MERGE_THRESHOLD)) {
|
/ IBUF_MERGE_THRESHOLD)) {
|
||||||
|
|
||||||
space_ids[*n_stored] = prev_space_id;
|
space_ids[*n_stored] = prev_space_id;
|
||||||
|
|
|
@ -280,8 +280,8 @@ mem_heap_free_heap_top(
|
||||||
/* If free == start, we may free the block if it is not the first
|
/* If free == start, we may free the block if it is not the first
|
||||||
one */
|
one */
|
||||||
|
|
||||||
if ((heap != block) && (mem_block_get_free(block) ==
|
if ((heap != block) && (mem_block_get_free(block)
|
||||||
mem_block_get_start(block))) {
|
== mem_block_get_start(block))) {
|
||||||
mem_heap_block_free(heap, block);
|
mem_heap_block_free(heap, block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -366,8 +366,8 @@ mem_heap_free_top(
|
||||||
/* If free == start, we may free the block if it is not the first
|
/* If free == start, we may free the block if it is not the first
|
||||||
one */
|
one */
|
||||||
|
|
||||||
if ((heap != block) && (mem_block_get_free(block) ==
|
if ((heap != block) && (mem_block_get_free(block)
|
||||||
mem_block_get_start(block))) {
|
== mem_block_get_start(block))) {
|
||||||
mem_heap_block_free(heap, block);
|
mem_heap_block_free(heap, block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1441,11 +1441,11 @@ rec_get_converted_size(
|
||||||
ut_ad(dtuple_check_typed(dtuple));
|
ut_ad(dtuple_check_typed(dtuple));
|
||||||
|
|
||||||
ut_ad(index->type & DICT_UNIVERSAL
|
ut_ad(index->type & DICT_UNIVERSAL
|
||||||
|| dtuple_get_n_fields(dtuple) ==
|
|| dtuple_get_n_fields(dtuple)
|
||||||
(((dtuple_get_info_bits(dtuple) & REC_NEW_STATUS_MASK)
|
== (((dtuple_get_info_bits(dtuple) & REC_NEW_STATUS_MASK)
|
||||||
== REC_STATUS_NODE_PTR)
|
== REC_STATUS_NODE_PTR)
|
||||||
? dict_index_get_n_unique_in_tree(index) + 1
|
? dict_index_get_n_unique_in_tree(index) + 1
|
||||||
: dict_index_get_n_fields(index)));
|
: dict_index_get_n_fields(index)));
|
||||||
|
|
||||||
if (dict_table_is_comp(index->table)) {
|
if (dict_table_is_comp(index->table)) {
|
||||||
return(rec_get_converted_size_new(index, dtuple));
|
return(rec_get_converted_size_new(index, dtuple));
|
||||||
|
|
|
@ -72,8 +72,8 @@ trx_rsegf_get_nth_undo(
|
||||||
ut_error;
|
ut_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(mtr_read_ulint(rsegf + TRX_RSEG_UNDO_SLOTS +
|
return(mtr_read_ulint(rsegf + TRX_RSEG_UNDO_SLOTS
|
||||||
n * TRX_RSEG_SLOT_SIZE, MLOG_4BYTES, mtr));
|
+ n * TRX_RSEG_SLOT_SIZE, MLOG_4BYTES, mtr));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
|
|
|
@ -327,8 +327,8 @@ trx_is_active(
|
||||||
}
|
}
|
||||||
|
|
||||||
trx = trx_get_on_id(trx_id);
|
trx = trx_get_on_id(trx_id);
|
||||||
if (trx && (trx->conc_state == TRX_ACTIVE ||
|
if (trx && (trx->conc_state == TRX_ACTIVE
|
||||||
trx->conc_state == TRX_PREPARED)) {
|
|| trx->conc_state == TRX_PREPARED)) {
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,8 +71,7 @@ ut_rnd_gen_ulint(void)
|
||||||
|
|
||||||
n_bits = 8 * sizeof(ulint);
|
n_bits = 8 * sizeof(ulint);
|
||||||
|
|
||||||
ut_rnd_ulint_counter =
|
ut_rnd_ulint_counter = UT_RND1 * ut_rnd_ulint_counter + UT_RND2;
|
||||||
UT_RND1 * ut_rnd_ulint_counter + UT_RND2;
|
|
||||||
|
|
||||||
rnd = ut_rnd_gen_next_ulint(ut_rnd_ulint_counter);
|
rnd = ut_rnd_gen_next_ulint(ut_rnd_ulint_counter);
|
||||||
|
|
||||||
|
|
|
@ -676,8 +676,8 @@ lock_get_src_table(
|
||||||
} else if (!src) {
|
} else if (!src) {
|
||||||
/* This presumably is the source table. */
|
/* This presumably is the source table. */
|
||||||
src = tab_lock->table;
|
src = tab_lock->table;
|
||||||
if (UT_LIST_GET_LEN(src->locks) != 1 ||
|
if (UT_LIST_GET_LEN(src->locks) != 1
|
||||||
UT_LIST_GET_FIRST(src->locks) != lock) {
|
|| UT_LIST_GET_FIRST(src->locks) != lock) {
|
||||||
/* We only support the case when
|
/* We only support the case when
|
||||||
there is only one lock on this table. */
|
there is only one lock on this table. */
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
@ -1563,8 +1563,9 @@ lock_rec_other_has_expl_req(
|
||||||
|
|
||||||
while (lock) {
|
while (lock) {
|
||||||
if (lock->trx != trx
|
if (lock->trx != trx
|
||||||
&& (gap ||
|
&& (gap
|
||||||
!(lock_rec_get_gap(lock) || page_rec_is_supremum(rec)))
|
|| !(lock_rec_get_gap(lock)
|
||||||
|
|| page_rec_is_supremum(rec)))
|
||||||
&& (wait || !lock_get_wait(lock))
|
&& (wait || !lock_get_wait(lock))
|
||||||
&& lock_mode_stronger_or_eq(lock_get_mode(lock), mode)) {
|
&& lock_mode_stronger_or_eq(lock_get_mode(lock), mode)) {
|
||||||
|
|
||||||
|
@ -2491,8 +2492,8 @@ lock_rec_inherit_to_gap(
|
||||||
while (lock != NULL) {
|
while (lock != NULL) {
|
||||||
if (!lock_rec_get_insert_intention(lock)
|
if (!lock_rec_get_insert_intention(lock)
|
||||||
&& !((srv_locks_unsafe_for_binlog
|
&& !((srv_locks_unsafe_for_binlog
|
||||||
|| lock->trx->isolation_level ==
|
|| lock->trx->isolation_level
|
||||||
TRX_ISO_READ_COMMITTED)
|
== TRX_ISO_READ_COMMITTED)
|
||||||
&& lock_get_mode(lock) == LOCK_X)) {
|
&& lock_get_mode(lock) == LOCK_X)) {
|
||||||
|
|
||||||
lock_rec_add_to_queue(LOCK_REC | lock_get_mode(lock)
|
lock_rec_add_to_queue(LOCK_REC | lock_get_mode(lock)
|
||||||
|
@ -3954,8 +3955,8 @@ lock_release_off_kernel(
|
||||||
|
|
||||||
table = lock->un_member.tab_lock.table;
|
table = lock->un_member.tab_lock.table;
|
||||||
|
|
||||||
table->query_cache_inv_trx_id =
|
table->query_cache_inv_trx_id
|
||||||
trx_sys->max_trx_id;
|
= trx_sys->max_trx_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock_table_dequeue(lock);
|
lock_table_dequeue(lock);
|
||||||
|
|
|
@ -710,8 +710,7 @@ log_calc_max_ages(void)
|
||||||
log_sys->max_archived_lsn_age = smallest_archive_margin;
|
log_sys->max_archived_lsn_age = smallest_archive_margin;
|
||||||
|
|
||||||
log_sys->max_archived_lsn_age_async = smallest_archive_margin
|
log_sys->max_archived_lsn_age_async = smallest_archive_margin
|
||||||
- smallest_archive_margin /
|
- smallest_archive_margin / LOG_ARCHIVE_RATIO_ASYNC;
|
||||||
LOG_ARCHIVE_RATIO_ASYNC;
|
|
||||||
#endif /* UNIV_LOG_ARCHIVE */
|
#endif /* UNIV_LOG_ARCHIVE */
|
||||||
failure:
|
failure:
|
||||||
mutex_exit(&(log_sys->mutex));
|
mutex_exit(&(log_sys->mutex));
|
||||||
|
@ -3298,8 +3297,8 @@ log_check_log_recs(
|
||||||
ut_memcpy(scan_buf, start, end - start);
|
ut_memcpy(scan_buf, start, end - start);
|
||||||
|
|
||||||
recv_scan_log_recs(TRUE,
|
recv_scan_log_recs(TRUE,
|
||||||
(buf_pool->n_frames -
|
(buf_pool->n_frames
|
||||||
recv_n_pool_free_frames) * UNIV_PAGE_SIZE,
|
- recv_n_pool_free_frames) * UNIV_PAGE_SIZE,
|
||||||
FALSE, scan_buf, end - start,
|
FALSE, scan_buf, end - start,
|
||||||
ut_dulint_align_down(buf_start_lsn,
|
ut_dulint_align_down(buf_start_lsn,
|
||||||
OS_FILE_LOG_BLOCK_SIZE),
|
OS_FILE_LOG_BLOCK_SIZE),
|
||||||
|
|
|
@ -2271,10 +2271,10 @@ recv_scan_log_recs(
|
||||||
/* We found a point from which to start the parsing
|
/* We found a point from which to start the parsing
|
||||||
of log records */
|
of log records */
|
||||||
|
|
||||||
recv_sys->parse_start_lsn =
|
recv_sys->parse_start_lsn
|
||||||
ut_dulint_add(scanned_lsn,
|
= ut_dulint_add(scanned_lsn,
|
||||||
log_block_get_first_rec_group
|
log_block_get_first_rec_group
|
||||||
(log_block));
|
(log_block));
|
||||||
recv_sys->scanned_lsn = recv_sys->parse_start_lsn;
|
recv_sys->scanned_lsn = recv_sys->parse_start_lsn;
|
||||||
recv_sys->recovered_lsn = recv_sys->parse_start_lsn;
|
recv_sys->recovered_lsn = recv_sys->parse_start_lsn;
|
||||||
}
|
}
|
||||||
|
@ -2302,8 +2302,8 @@ recv_scan_log_recs(
|
||||||
}
|
}
|
||||||
|
|
||||||
recv_sys->scanned_lsn = scanned_lsn;
|
recv_sys->scanned_lsn = scanned_lsn;
|
||||||
recv_sys->scanned_checkpoint_no =
|
recv_sys->scanned_checkpoint_no
|
||||||
log_block_get_checkpoint_no(log_block);
|
= log_block_get_checkpoint_no(log_block);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data_len < OS_FILE_LOG_BLOCK_SIZE) {
|
if (data_len < OS_FILE_LOG_BLOCK_SIZE) {
|
||||||
|
|
|
@ -103,8 +103,8 @@ mem_field_trailer_set_check(byte* field, ulint check)
|
||||||
ulint
|
ulint
|
||||||
mem_field_trailer_get_check(byte* field)
|
mem_field_trailer_get_check(byte* field)
|
||||||
{
|
{
|
||||||
return(mach_read_from_4(field +
|
return(mach_read_from_4(field
|
||||||
mem_field_header_get_len(field)));
|
+ mem_field_header_get_len(field)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
@ -486,8 +486,8 @@ mem_heap_validate_or_print(
|
||||||
total_len += len;
|
total_len += len;
|
||||||
check_field = mem_field_header_get_check(user_field);
|
check_field = mem_field_header_get_check(user_field);
|
||||||
|
|
||||||
if (check_field !=
|
if (check_field
|
||||||
mem_field_trailer_get_check(user_field)) {
|
!= mem_field_trailer_get_check(user_field)) {
|
||||||
/* error */
|
/* error */
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
|
|
@ -285,9 +285,9 @@ mtr_read_ulint(
|
||||||
{
|
{
|
||||||
ut_ad(mtr->state == MTR_ACTIVE);
|
ut_ad(mtr->state == MTR_ACTIVE);
|
||||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(ptr),
|
ut_ad(mtr_memo_contains(mtr, buf_block_align(ptr),
|
||||||
MTR_MEMO_PAGE_S_FIX) ||
|
MTR_MEMO_PAGE_S_FIX)
|
||||||
mtr_memo_contains(mtr, buf_block_align(ptr),
|
|| mtr_memo_contains(mtr, buf_block_align(ptr),
|
||||||
MTR_MEMO_PAGE_X_FIX));
|
MTR_MEMO_PAGE_X_FIX));
|
||||||
if (type == MLOG_1BYTE) {
|
if (type == MLOG_1BYTE) {
|
||||||
return(mach_read_from_1(ptr));
|
return(mach_read_from_1(ptr));
|
||||||
} else if (type == MLOG_2BYTES) {
|
} else if (type == MLOG_2BYTES) {
|
||||||
|
@ -312,9 +312,9 @@ mtr_read_dulint(
|
||||||
ut_ad(mtr->state == MTR_ACTIVE);
|
ut_ad(mtr->state == MTR_ACTIVE);
|
||||||
ut_ad(ptr && mtr);
|
ut_ad(ptr && mtr);
|
||||||
ut_ad(mtr_memo_contains(mtr, buf_block_align(ptr),
|
ut_ad(mtr_memo_contains(mtr, buf_block_align(ptr),
|
||||||
MTR_MEMO_PAGE_S_FIX) ||
|
MTR_MEMO_PAGE_S_FIX)
|
||||||
mtr_memo_contains(mtr, buf_block_align(ptr),
|
|| mtr_memo_contains(mtr, buf_block_align(ptr),
|
||||||
MTR_MEMO_PAGE_X_FIX));
|
MTR_MEMO_PAGE_X_FIX));
|
||||||
return(mach_read_from_8(ptr));
|
return(mach_read_from_8(ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
29
os/os0file.c
29
os/os0file.c
|
@ -843,8 +843,9 @@ os_file_create_directory(
|
||||||
BOOL rcode;
|
BOOL rcode;
|
||||||
|
|
||||||
rcode = CreateDirectory((LPCTSTR) pathname, NULL);
|
rcode = CreateDirectory((LPCTSTR) pathname, NULL);
|
||||||
if (!(rcode != 0 ||
|
if (!(rcode != 0
|
||||||
(GetLastError() == ERROR_ALREADY_EXISTS && !fail_if_exists))) {
|
|| (GetLastError() == ERROR_ALREADY_EXISTS
|
||||||
|
&& !fail_if_exists))) {
|
||||||
/* failure */
|
/* failure */
|
||||||
os_file_handle_error(pathname, "CreateDirectory");
|
os_file_handle_error(pathname, "CreateDirectory");
|
||||||
|
|
||||||
|
@ -1190,8 +1191,8 @@ try_again:
|
||||||
/* Do not use unbuffered i/o to log files because
|
/* Do not use unbuffered i/o to log files because
|
||||||
value 2 denotes that we do not flush the log at every
|
value 2 denotes that we do not flush the log at every
|
||||||
commit, but only once per second */
|
commit, but only once per second */
|
||||||
} else if (srv_win_file_flush_method ==
|
} else if (srv_win_file_flush_method
|
||||||
SRV_WIN_IO_UNBUFFERED) {
|
== SRV_WIN_IO_UNBUFFERED) {
|
||||||
attributes = attributes | FILE_FLAG_NO_BUFFERING;
|
attributes = attributes | FILE_FLAG_NO_BUFFERING;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1202,8 +1203,8 @@ try_again:
|
||||||
/* Do not use unbuffered i/o to log files because
|
/* Do not use unbuffered i/o to log files because
|
||||||
value 2 denotes that we do not flush the log at every
|
value 2 denotes that we do not flush the log at every
|
||||||
commit, but only once per second */
|
commit, but only once per second */
|
||||||
} else if (srv_win_file_flush_method ==
|
} else if (srv_win_file_flush_method
|
||||||
SRV_WIN_IO_UNBUFFERED) {
|
== SRV_WIN_IO_UNBUFFERED) {
|
||||||
attributes = attributes | FILE_FLAG_NO_BUFFERING;
|
attributes = attributes | FILE_FLAG_NO_BUFFERING;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -3004,14 +3005,14 @@ os_aio_get_segment_no_from_slot(
|
||||||
segment = 1;
|
segment = 1;
|
||||||
|
|
||||||
} else if (array == os_aio_read_array) {
|
} else if (array == os_aio_read_array) {
|
||||||
seg_len = os_aio_read_array->n_slots /
|
seg_len = os_aio_read_array->n_slots
|
||||||
os_aio_read_array->n_segments;
|
/ os_aio_read_array->n_segments;
|
||||||
|
|
||||||
segment = 2 + slot->pos / seg_len;
|
segment = 2 + slot->pos / seg_len;
|
||||||
} else {
|
} else {
|
||||||
ut_a(array == os_aio_write_array);
|
ut_a(array == os_aio_write_array);
|
||||||
seg_len = os_aio_write_array->n_slots /
|
seg_len = os_aio_write_array->n_slots
|
||||||
os_aio_write_array->n_segments;
|
/ os_aio_write_array->n_segments;
|
||||||
|
|
||||||
segment = os_aio_read_array->n_segments + 2
|
segment = os_aio_read_array->n_segments + 2
|
||||||
+ slot->pos / seg_len;
|
+ slot->pos / seg_len;
|
||||||
|
@ -3219,8 +3220,8 @@ loop:
|
||||||
control->aio_offset = offset;
|
control->aio_offset = offset;
|
||||||
control->aio_reqprio = 0;
|
control->aio_reqprio = 0;
|
||||||
control->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
|
control->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
|
||||||
control->aio_sigevent.sigev_signo =
|
control->aio_sigevent.sigev_signo
|
||||||
SIGRTMIN + 1 + os_aio_get_array_no(array);
|
= SIGRTMIN + 1 + os_aio_get_array_no(array);
|
||||||
/* TODO: How to choose the signal numbers? */
|
/* TODO: How to choose the signal numbers? */
|
||||||
/*
|
/*
|
||||||
fprintf(stderr, "AIO signal number %lu\n",
|
fprintf(stderr, "AIO signal number %lu\n",
|
||||||
|
@ -4285,8 +4286,8 @@ loop:
|
||||||
if (os_n_file_reads == os_n_file_reads_old) {
|
if (os_n_file_reads == os_n_file_reads_old) {
|
||||||
avg_bytes_read = 0.0;
|
avg_bytes_read = 0.0;
|
||||||
} else {
|
} else {
|
||||||
avg_bytes_read = (double) os_bytes_read_since_printout /
|
avg_bytes_read = (double) os_bytes_read_since_printout
|
||||||
(os_n_file_reads - os_n_file_reads_old);
|
/ (os_n_file_reads - os_n_file_reads_old);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(file,
|
fprintf(file,
|
||||||
|
|
|
@ -411,8 +411,8 @@ os_awe_map_physical_mem_to_window(
|
||||||
ut_a(ptr >= os_awe_simulate_window);
|
ut_a(ptr >= os_awe_simulate_window);
|
||||||
ut_a(ptr < os_awe_simulate_window + os_awe_simulate_window_size);
|
ut_a(ptr < os_awe_simulate_window + os_awe_simulate_window_size);
|
||||||
ut_a(page_info >= os_awe_simulate_page_info);
|
ut_a(page_info >= os_awe_simulate_page_info);
|
||||||
ut_a(page_info < os_awe_simulate_page_info +
|
ut_a(page_info < os_awe_simulate_page_info
|
||||||
(os_awe_simulate_mem_size / 4096));
|
+ (os_awe_simulate_mem_size / 4096));
|
||||||
|
|
||||||
/* First look if some other 'physical pages' are mapped at ptr,
|
/* First look if some other 'physical pages' are mapped at ptr,
|
||||||
and copy them back to where they were if yes */
|
and copy them back to where they were if yes */
|
||||||
|
|
|
@ -629,8 +629,8 @@ page_cur_insert_rec_write_log(
|
||||||
log_end = &log_ptr[5 + 1 + 5 + 5 + MLOG_BUF_MARGIN];
|
log_end = &log_ptr[5 + 1 + 5 + 5 + MLOG_BUF_MARGIN];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rec_get_info_and_status_bits(insert_rec, comp) !=
|
if ((rec_get_info_and_status_bits(insert_rec, comp)
|
||||||
rec_get_info_and_status_bits(cursor_rec, comp))
|
!= rec_get_info_and_status_bits(cursor_rec, comp))
|
||||||
|| (extra_size != cur_extra_size)
|
|| (extra_size != cur_extra_size)
|
||||||
|| (rec_size != cur_rec_size)) {
|
|| (rec_size != cur_rec_size)) {
|
||||||
|
|
||||||
|
|
|
@ -389,8 +389,8 @@ page_create(
|
||||||
|
|
||||||
infimum_rec = rec_convert_dtuple_to_rec(heap_top, index, tuple);
|
infimum_rec = rec_convert_dtuple_to_rec(heap_top, index, tuple);
|
||||||
|
|
||||||
ut_a(infimum_rec ==
|
ut_a(infimum_rec == page
|
||||||
page + (comp ? PAGE_NEW_INFIMUM : PAGE_OLD_INFIMUM));
|
+ (comp ? PAGE_NEW_INFIMUM : PAGE_OLD_INFIMUM));
|
||||||
|
|
||||||
rec_set_n_owned(infimum_rec, comp, 1);
|
rec_set_n_owned(infimum_rec, comp, 1);
|
||||||
rec_set_heap_no(infimum_rec, comp, 0);
|
rec_set_heap_no(infimum_rec, comp, 0);
|
||||||
|
@ -411,8 +411,8 @@ page_create(
|
||||||
|
|
||||||
supremum_rec = rec_convert_dtuple_to_rec(heap_top, index, tuple);
|
supremum_rec = rec_convert_dtuple_to_rec(heap_top, index, tuple);
|
||||||
|
|
||||||
ut_a(supremum_rec ==
|
ut_a(supremum_rec == page
|
||||||
page + (comp ? PAGE_NEW_SUPREMUM : PAGE_OLD_SUPREMUM));
|
+ (comp ? PAGE_NEW_SUPREMUM : PAGE_OLD_SUPREMUM));
|
||||||
|
|
||||||
rec_set_n_owned(supremum_rec, comp, 1);
|
rec_set_n_owned(supremum_rec, comp, 1);
|
||||||
rec_set_heap_no(supremum_rec, comp, 1);
|
rec_set_heap_no(supremum_rec, comp, 1);
|
||||||
|
@ -421,8 +421,8 @@ page_create(
|
||||||
ULINT_UNDEFINED, &heap);
|
ULINT_UNDEFINED, &heap);
|
||||||
heap_top = rec_get_end(supremum_rec, offsets);
|
heap_top = rec_get_end(supremum_rec, offsets);
|
||||||
|
|
||||||
ut_ad(heap_top ==
|
ut_ad(heap_top == page
|
||||||
page + (comp ? PAGE_NEW_SUPREMUM_END : PAGE_OLD_SUPREMUM_END));
|
+ (comp ? PAGE_NEW_SUPREMUM_END : PAGE_OLD_SUPREMUM_END));
|
||||||
|
|
||||||
mem_heap_free(heap);
|
mem_heap_free(heap);
|
||||||
|
|
||||||
|
@ -1791,8 +1791,8 @@ page_validate(
|
||||||
|
|
||||||
n_slots = page_dir_get_n_slots(page);
|
n_slots = page_dir_get_n_slots(page);
|
||||||
|
|
||||||
if (!(page_header_get_ptr(page, PAGE_HEAP_TOP) <=
|
if (!(page_header_get_ptr(page, PAGE_HEAP_TOP)
|
||||||
page_dir_get_nth_slot(page, n_slots - 1))) {
|
<= page_dir_get_nth_slot(page, n_slots - 1))) {
|
||||||
|
|
||||||
fputs("InnoDB: Record heap and dir overlap on a page ",
|
fputs("InnoDB: Record heap and dir overlap on a page ",
|
||||||
stderr);
|
stderr);
|
||||||
|
|
|
@ -1805,14 +1805,14 @@ pars_get_lex_chars(
|
||||||
len = 5;
|
len = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite(pars_sym_tab_global->sql_string +
|
fwrite(pars_sym_tab_global->sql_string
|
||||||
pars_sym_tab_global->next_char_pos,
|
+ pars_sym_tab_global->next_char_pos,
|
||||||
1, len, stderr);
|
1, len, stderr);
|
||||||
}
|
}
|
||||||
#endif /* UNIV_SQL_DEBUG */
|
#endif /* UNIV_SQL_DEBUG */
|
||||||
|
|
||||||
ut_memcpy(buf, pars_sym_tab_global->sql_string +
|
ut_memcpy(buf, pars_sym_tab_global->sql_string
|
||||||
pars_sym_tab_global->next_char_pos, len);
|
+ pars_sym_tab_global->next_char_pos, len);
|
||||||
*result = len;
|
*result = len;
|
||||||
|
|
||||||
pars_sym_tab_global->next_char_pos += len;
|
pars_sym_tab_global->next_char_pos += len;
|
||||||
|
|
|
@ -325,8 +325,8 @@ cmp_data_data_slow(
|
||||||
if (cur_type->mtype >= DATA_FLOAT
|
if (cur_type->mtype >= DATA_FLOAT
|
||||||
|| (cur_type->mtype == DATA_BLOB
|
|| (cur_type->mtype == DATA_BLOB
|
||||||
&& 0 == (cur_type->prtype & DATA_BINARY_TYPE)
|
&& 0 == (cur_type->prtype & DATA_BINARY_TYPE)
|
||||||
&& dtype_get_charset_coll(cur_type->prtype) !=
|
&& dtype_get_charset_coll(cur_type->prtype)
|
||||||
DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL)) {
|
!= DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL)) {
|
||||||
|
|
||||||
return(cmp_whole_field(cur_type,
|
return(cmp_whole_field(cur_type,
|
||||||
data1, (unsigned) len1,
|
data1, (unsigned) len1,
|
||||||
|
@ -527,8 +527,8 @@ cmp_dtuple_rec_with_match(
|
||||||
if (cur_type->mtype >= DATA_FLOAT
|
if (cur_type->mtype >= DATA_FLOAT
|
||||||
|| (cur_type->mtype == DATA_BLOB
|
|| (cur_type->mtype == DATA_BLOB
|
||||||
&& 0 == (cur_type->prtype & DATA_BINARY_TYPE)
|
&& 0 == (cur_type->prtype & DATA_BINARY_TYPE)
|
||||||
&& dtype_get_charset_coll(cur_type->prtype) !=
|
&& dtype_get_charset_coll(cur_type->prtype)
|
||||||
DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL)) {
|
!= DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL)) {
|
||||||
|
|
||||||
ret = cmp_whole_field(cur_type,
|
ret = cmp_whole_field(cur_type,
|
||||||
dfield_get_data(dtuple_field),
|
dfield_get_data(dtuple_field),
|
||||||
|
@ -591,8 +591,7 @@ cmp_dtuple_rec_with_match(
|
||||||
|
|
||||||
if (cur_type->mtype <= DATA_CHAR
|
if (cur_type->mtype <= DATA_CHAR
|
||||||
|| (cur_type->mtype == DATA_BLOB
|
|| (cur_type->mtype == DATA_BLOB
|
||||||
&& 0 ==
|
&& !(cur_type->prtype & DATA_BINARY_TYPE))) {
|
||||||
(cur_type->prtype & DATA_BINARY_TYPE))) {
|
|
||||||
|
|
||||||
rec_byte = cmp_collate(rec_byte);
|
rec_byte = cmp_collate(rec_byte);
|
||||||
dtuple_byte = cmp_collate(dtuple_byte);
|
dtuple_byte = cmp_collate(dtuple_byte);
|
||||||
|
@ -838,8 +837,8 @@ cmp_rec_rec_with_match(
|
||||||
if (cur_type->mtype >= DATA_FLOAT
|
if (cur_type->mtype >= DATA_FLOAT
|
||||||
|| (cur_type->mtype == DATA_BLOB
|
|| (cur_type->mtype == DATA_BLOB
|
||||||
&& 0 == (cur_type->prtype & DATA_BINARY_TYPE)
|
&& 0 == (cur_type->prtype & DATA_BINARY_TYPE)
|
||||||
&& dtype_get_charset_coll(cur_type->prtype) !=
|
&& dtype_get_charset_coll(cur_type->prtype)
|
||||||
DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL)) {
|
!= DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL)) {
|
||||||
|
|
||||||
ret = cmp_whole_field(cur_type,
|
ret = cmp_whole_field(cur_type,
|
||||||
rec1_b_ptr,
|
rec1_b_ptr,
|
||||||
|
@ -901,8 +900,7 @@ cmp_rec_rec_with_match(
|
||||||
|
|
||||||
if (cur_type->mtype <= DATA_CHAR
|
if (cur_type->mtype <= DATA_CHAR
|
||||||
|| (cur_type->mtype == DATA_BLOB
|
|| (cur_type->mtype == DATA_BLOB
|
||||||
&& 0 ==
|
&& !(cur_type->prtype & DATA_BINARY_TYPE))) {
|
||||||
(cur_type->prtype & DATA_BINARY_TYPE))) {
|
|
||||||
|
|
||||||
rec1_byte = cmp_collate(rec1_byte);
|
rec1_byte = cmp_collate(rec1_byte);
|
||||||
rec2_byte = cmp_collate(rec2_byte);
|
rec2_byte = cmp_collate(rec2_byte);
|
||||||
|
|
|
@ -176,13 +176,13 @@ rec_init_offsets(
|
||||||
case REC_STATUS_INFIMUM:
|
case REC_STATUS_INFIMUM:
|
||||||
case REC_STATUS_SUPREMUM:
|
case REC_STATUS_SUPREMUM:
|
||||||
/* the field is 8 bytes long */
|
/* the field is 8 bytes long */
|
||||||
rec_offs_base(offsets)[0] =
|
rec_offs_base(offsets)[0]
|
||||||
REC_N_NEW_EXTRA_BYTES | REC_OFFS_COMPACT;
|
= REC_N_NEW_EXTRA_BYTES | REC_OFFS_COMPACT;
|
||||||
rec_offs_base(offsets)[1] = 8;
|
rec_offs_base(offsets)[1] = 8;
|
||||||
return;
|
return;
|
||||||
case REC_STATUS_NODE_PTR:
|
case REC_STATUS_NODE_PTR:
|
||||||
n_node_ptr_field =
|
n_node_ptr_field
|
||||||
dict_index_get_n_unique_in_tree(index);
|
= dict_index_get_n_unique_in_tree(index);
|
||||||
break;
|
break;
|
||||||
case REC_STATUS_ORDINARY:
|
case REC_STATUS_ORDINARY:
|
||||||
break;
|
break;
|
||||||
|
@ -258,8 +258,8 @@ resolved:
|
||||||
rec_offs_base(offsets)[i + 1] = len;
|
rec_offs_base(offsets)[i + 1] = len;
|
||||||
} while (++i < rec_offs_n_fields(offsets));
|
} while (++i < rec_offs_n_fields(offsets));
|
||||||
|
|
||||||
*rec_offs_base(offsets) =
|
*rec_offs_base(offsets)
|
||||||
(rec - (lens + 1)) | REC_OFFS_COMPACT;
|
= (rec - (lens + 1)) | REC_OFFS_COMPACT;
|
||||||
} else {
|
} else {
|
||||||
/* Old-style record: determine extra size and end offsets */
|
/* Old-style record: determine extra size and end offsets */
|
||||||
offs = REC_N_OLD_EXTRA_BYTES;
|
offs = REC_N_OLD_EXTRA_BYTES;
|
||||||
|
@ -349,8 +349,8 @@ rec_get_offsets_func(
|
||||||
|
|
||||||
size = n + (1 + REC_OFFS_HEADER_SIZE);
|
size = n + (1 + REC_OFFS_HEADER_SIZE);
|
||||||
|
|
||||||
if (UNIV_UNLIKELY(!offsets) ||
|
if (UNIV_UNLIKELY(!offsets)
|
||||||
UNIV_UNLIKELY(rec_offs_get_n_alloc(offsets) < size)) {
|
|| UNIV_UNLIKELY(rec_offs_get_n_alloc(offsets) < size)) {
|
||||||
if (!*heap) {
|
if (!*heap) {
|
||||||
*heap = mem_heap_create_func(size * sizeof(ulint),
|
*heap = mem_heap_create_func(size * sizeof(ulint),
|
||||||
NULL, MEM_HEAP_DYNAMIC,
|
NULL, MEM_HEAP_DYNAMIC,
|
||||||
|
@ -474,8 +474,8 @@ rec_get_converted_size_new(
|
||||||
ulint len = dtuple_get_nth_field(dtuple, i)->len;
|
ulint len = dtuple_get_nth_field(dtuple, i)->len;
|
||||||
field = dict_index_get_nth_field(index, i);
|
field = dict_index_get_nth_field(index, i);
|
||||||
type = dict_col_get_type(dict_field_get_col(field));
|
type = dict_col_get_type(dict_field_get_col(field));
|
||||||
ut_ad(len != UNIV_SQL_NULL ||
|
ut_ad(len != UNIV_SQL_NULL
|
||||||
!(dtype_get_prtype(type) & DATA_NOT_NULL));
|
|| !(dtype_get_prtype(type) & DATA_NOT_NULL));
|
||||||
|
|
||||||
if (len == UNIV_SQL_NULL) {
|
if (len == UNIV_SQL_NULL) {
|
||||||
/* No length is stored for NULL fields. */
|
/* No length is stored for NULL fields. */
|
||||||
|
|
|
@ -531,14 +531,13 @@ row_ins_cascade_calc_update_vec(
|
||||||
|
|
||||||
char* pad_start;
|
char* pad_start;
|
||||||
const char* pad_end;
|
const char* pad_end;
|
||||||
ufield->new_val.data =
|
ufield->new_val.data = mem_heap_alloc
|
||||||
mem_heap_alloc(heap,
|
(heap, min_size);
|
||||||
min_size);
|
pad_start = ((char*) ufield
|
||||||
pad_start =
|
->new_val.data)
|
||||||
((char*) ufield->new_val.data)
|
|
||||||
+ ufield->new_val.len;
|
+ ufield->new_val.len;
|
||||||
pad_end =
|
pad_end = ((char*) ufield
|
||||||
((char*) ufield->new_val.data)
|
->new_val.data)
|
||||||
+ min_size;
|
+ min_size;
|
||||||
ufield->new_val.len = min_size;
|
ufield->new_val.len = min_size;
|
||||||
ut_memcpy(ufield->new_val.data,
|
ut_memcpy(ufield->new_val.data,
|
||||||
|
@ -805,9 +804,9 @@ row_ins_foreign_check_on_constraint(
|
||||||
|
|
||||||
node = thr->run_node;
|
node = thr->run_node;
|
||||||
|
|
||||||
if (node->is_delete && 0 == (foreign->type &
|
if (node->is_delete && 0 == (foreign->type
|
||||||
(DICT_FOREIGN_ON_DELETE_CASCADE
|
& (DICT_FOREIGN_ON_DELETE_CASCADE
|
||||||
| DICT_FOREIGN_ON_DELETE_SET_NULL))) {
|
| DICT_FOREIGN_ON_DELETE_SET_NULL))) {
|
||||||
|
|
||||||
row_ins_foreign_report_err("Trying to delete",
|
row_ins_foreign_report_err("Trying to delete",
|
||||||
thr, foreign,
|
thr, foreign,
|
||||||
|
@ -816,9 +815,9 @@ row_ins_foreign_check_on_constraint(
|
||||||
return(DB_ROW_IS_REFERENCED);
|
return(DB_ROW_IS_REFERENCED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!node->is_delete && 0 == (foreign->type &
|
if (!node->is_delete && 0 == (foreign->type
|
||||||
(DICT_FOREIGN_ON_UPDATE_CASCADE
|
& (DICT_FOREIGN_ON_UPDATE_CASCADE
|
||||||
| DICT_FOREIGN_ON_UPDATE_SET_NULL))) {
|
| DICT_FOREIGN_ON_UPDATE_SET_NULL))) {
|
||||||
|
|
||||||
/* This is an UPDATE */
|
/* This is an UPDATE */
|
||||||
|
|
||||||
|
|
|
@ -406,8 +406,8 @@ row_mysql_convert_row_to_innobase(
|
||||||
if (templ->mysql_null_bit_mask != 0) {
|
if (templ->mysql_null_bit_mask != 0) {
|
||||||
/* Column may be SQL NULL */
|
/* Column may be SQL NULL */
|
||||||
|
|
||||||
if (mysql_rec[templ->mysql_null_byte_offset] &
|
if (mysql_rec[templ->mysql_null_byte_offset]
|
||||||
(byte) (templ->mysql_null_bit_mask)) {
|
& (byte) (templ->mysql_null_bit_mask)) {
|
||||||
|
|
||||||
/* It is SQL NULL */
|
/* It is SQL NULL */
|
||||||
|
|
||||||
|
@ -707,11 +707,11 @@ row_prebuilt_free(
|
||||||
for (i = 0; i < MYSQL_FETCH_CACHE_SIZE; i++) {
|
for (i = 0; i < MYSQL_FETCH_CACHE_SIZE; i++) {
|
||||||
if (prebuilt->fetch_cache[i] != NULL) {
|
if (prebuilt->fetch_cache[i] != NULL) {
|
||||||
|
|
||||||
if ((ROW_PREBUILT_FETCH_MAGIC_N !=
|
if ((ROW_PREBUILT_FETCH_MAGIC_N != mach_read_from_4
|
||||||
mach_read_from_4((prebuilt->fetch_cache[i]) - 4))
|
((prebuilt->fetch_cache[i]) - 4))
|
||||||
|| (ROW_PREBUILT_FETCH_MAGIC_N !=
|
|| (ROW_PREBUILT_FETCH_MAGIC_N != mach_read_from_4
|
||||||
mach_read_from_4((prebuilt->fetch_cache[i])
|
((prebuilt->fetch_cache[i])
|
||||||
+ prebuilt->mysql_row_len))) {
|
+ prebuilt->mysql_row_len))) {
|
||||||
fputs("InnoDB: Error: trying to free"
|
fputs("InnoDB: Error: trying to free"
|
||||||
" a corrupt fetch buffer.\n", stderr);
|
" a corrupt fetch buffer.\n", stderr);
|
||||||
|
|
||||||
|
@ -3037,9 +3037,9 @@ check_next_foreign:
|
||||||
foreign = UT_LIST_GET_NEXT(referenced_list, foreign);
|
foreign = UT_LIST_GET_NEXT(referenced_list, foreign);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (foreign && trx->check_foreigns &&
|
if (foreign && trx->check_foreigns
|
||||||
!(drop_db && dict_tables_have_same_db
|
&& !(drop_db && dict_tables_have_same_db
|
||||||
(name, foreign->foreign_table_name))) {
|
(name, foreign->foreign_table_name))) {
|
||||||
FILE* ef = dict_foreign_err_file;
|
FILE* ef = dict_foreign_err_file;
|
||||||
|
|
||||||
/* We only allow dropping a referenced table if
|
/* We only allow dropping a referenced table if
|
||||||
|
@ -3232,8 +3232,8 @@ check_next_foreign:
|
||||||
space_id = table->space;
|
space_id = table->space;
|
||||||
|
|
||||||
if (table->dir_path_of_temp_table != NULL) {
|
if (table->dir_path_of_temp_table != NULL) {
|
||||||
dir_path_of_temp_table =
|
dir_path_of_temp_table = mem_strdup
|
||||||
mem_strdup(table->dir_path_of_temp_table);
|
(table->dir_path_of_temp_table);
|
||||||
is_path = TRUE;
|
is_path = TRUE;
|
||||||
name_or_path = dir_path_of_temp_table;
|
name_or_path = dir_path_of_temp_table;
|
||||||
} else {
|
} else {
|
||||||
|
@ -3927,8 +3927,9 @@ not_ok:
|
||||||
is_ok = FALSE;
|
is_ok = FALSE;
|
||||||
} else if ((index->type & DICT_UNIQUE)
|
} else if ((index->type & DICT_UNIQUE)
|
||||||
&& !contains_null
|
&& !contains_null
|
||||||
&& matched_fields >=
|
&& matched_fields
|
||||||
dict_index_get_n_ordering_defined_by_user(index)) {
|
>= dict_index_get_n_ordering_defined_by_user
|
||||||
|
(index)) {
|
||||||
|
|
||||||
fputs("InnoDB: duplicate key in ", stderr);
|
fputs("InnoDB: duplicate key in ", stderr);
|
||||||
goto not_ok;
|
goto not_ok;
|
||||||
|
|
|
@ -424,8 +424,8 @@ row_build_row_ref(
|
||||||
column, or the full column, and we must adjust the length
|
column, or the full column, and we must adjust the length
|
||||||
accordingly. */
|
accordingly. */
|
||||||
|
|
||||||
clust_col_prefix_len =
|
clust_col_prefix_len = dict_index_get_nth_field
|
||||||
dict_index_get_nth_field(clust_index, i)->prefix_len;
|
(clust_index, i)->prefix_len;
|
||||||
|
|
||||||
if (clust_col_prefix_len > 0) {
|
if (clust_col_prefix_len > 0) {
|
||||||
if (len != UNIV_SQL_NULL) {
|
if (len != UNIV_SQL_NULL) {
|
||||||
|
@ -521,8 +521,8 @@ notfound:
|
||||||
column, or the full column, and we must adjust the length
|
column, or the full column, and we must adjust the length
|
||||||
accordingly. */
|
accordingly. */
|
||||||
|
|
||||||
clust_col_prefix_len =
|
clust_col_prefix_len = dict_index_get_nth_field
|
||||||
dict_index_get_nth_field(clust_index, i)->prefix_len;
|
(clust_index, i)->prefix_len;
|
||||||
|
|
||||||
if (clust_col_prefix_len > 0) {
|
if (clust_col_prefix_len > 0) {
|
||||||
if (len != UNIV_SQL_NULL) {
|
if (len != UNIV_SQL_NULL) {
|
||||||
|
|
|
@ -1951,8 +1951,8 @@ row_sel_step(
|
||||||
fetches (currently, we copy them also for non-explicit
|
fetches (currently, we copy them also for non-explicit
|
||||||
cursors) */
|
cursors) */
|
||||||
|
|
||||||
if (node->explicit_cursor &&
|
if (node->explicit_cursor
|
||||||
UT_LIST_GET_FIRST(node->copy_variables)) {
|
&& UT_LIST_GET_FIRST(node->copy_variables)) {
|
||||||
|
|
||||||
row_sel_copy_input_variable_vals(node);
|
row_sel_copy_input_variable_vals(node);
|
||||||
}
|
}
|
||||||
|
@ -2014,8 +2014,8 @@ fetch_step(
|
||||||
(sel_node, node->func->arg);
|
(sel_node, node->func->arg);
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
sel_node->state =
|
sel_node->state
|
||||||
SEL_NODE_NO_MORE_ROWS;
|
= SEL_NODE_NO_MORE_ROWS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2620,8 +2620,8 @@ row_sel_store_mysql_rec(
|
||||||
|
|
||||||
heap = prebuilt->blob_heap;
|
heap = prebuilt->blob_heap;
|
||||||
} else {
|
} else {
|
||||||
extern_field_heap =
|
extern_field_heap
|
||||||
mem_heap_create(UNIV_PAGE_SIZE);
|
= mem_heap_create(UNIV_PAGE_SIZE);
|
||||||
|
|
||||||
heap = extern_field_heap;
|
heap = extern_field_heap;
|
||||||
}
|
}
|
||||||
|
@ -2656,8 +2656,8 @@ row_sel_store_mysql_rec(
|
||||||
if (templ->mysql_null_bit_mask) {
|
if (templ->mysql_null_bit_mask) {
|
||||||
/* It is a nullable column with a non-NULL
|
/* It is a nullable column with a non-NULL
|
||||||
value */
|
value */
|
||||||
mysql_rec[templ->mysql_null_byte_offset] &=
|
mysql_rec[templ->mysql_null_byte_offset]
|
||||||
~(byte) (templ->mysql_null_bit_mask);
|
&= ~(byte) templ->mysql_null_bit_mask;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* MySQL seems to assume the field for an SQL NULL
|
/* MySQL seems to assume the field for an SQL NULL
|
||||||
|
@ -2667,8 +2667,8 @@ row_sel_store_mysql_rec(
|
||||||
and DISTINCT could treat NULL values inequal. */
|
and DISTINCT could treat NULL values inequal. */
|
||||||
int pad_char;
|
int pad_char;
|
||||||
|
|
||||||
mysql_rec[templ->mysql_null_byte_offset] |=
|
mysql_rec[templ->mysql_null_byte_offset]
|
||||||
(byte) (templ->mysql_null_bit_mask);
|
|= (byte) templ->mysql_null_bit_mask;
|
||||||
switch (templ->type) {
|
switch (templ->type) {
|
||||||
case DATA_VARCHAR:
|
case DATA_VARCHAR:
|
||||||
case DATA_BINARY:
|
case DATA_BINARY:
|
||||||
|
@ -2908,8 +2908,8 @@ row_sel_get_clust_rec_for_mysql(
|
||||||
clust_rec = NULL;
|
clust_rec = NULL;
|
||||||
} else {
|
} else {
|
||||||
#ifdef UNIV_SEARCH_DEBUG
|
#ifdef UNIV_SEARCH_DEBUG
|
||||||
ut_a(clust_rec == NULL ||
|
ut_a(clust_rec == NULL
|
||||||
row_sel_sec_rec_is_for_clust_rec
|
|| row_sel_sec_rec_is_for_clust_rec
|
||||||
(rec, sec_index, clust_rec, clust_index));
|
(rec, sec_index, clust_rec, clust_index));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -3018,8 +3018,8 @@ row_sel_pop_cached_row_for_mysql(
|
||||||
if (UNIV_UNLIKELY(prebuilt->keep_other_fields_on_keyread)) {
|
if (UNIV_UNLIKELY(prebuilt->keep_other_fields_on_keyread)) {
|
||||||
/* Copy cache record field by field, don't touch fields that
|
/* Copy cache record field by field, don't touch fields that
|
||||||
are not covered by current key */
|
are not covered by current key */
|
||||||
cached_rec =
|
cached_rec = prebuilt->fetch_cache
|
||||||
prebuilt->fetch_cache[prebuilt->fetch_cache_first];
|
[prebuilt->fetch_cache_first];
|
||||||
|
|
||||||
for (i = 0; i < prebuilt->n_template; i++) {
|
for (i = 0; i < prebuilt->n_template; i++) {
|
||||||
templ = prebuilt->mysql_template + i;
|
templ = prebuilt->mysql_template + i;
|
||||||
|
@ -3397,13 +3397,13 @@ row_search_for_mysql(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In a search where at most one record in the index may match, we
|
/* In a search where at most one record in the index may match, we
|
||||||
can use a LOCK_REC_NOT_GAP type record lock when locking a non-delete-
|
can use a LOCK_REC_NOT_GAP type record lock when locking a
|
||||||
marked matching record.
|
non-delete-marked matching record.
|
||||||
|
|
||||||
Note that in a unique secondary index there may be different delete-
|
Note that in a unique secondary index there may be different
|
||||||
marked versions of a record where only the primary key values differ:
|
delete-marked versions of a record where only the primary key
|
||||||
thus in a secondary index we must use next-key locks when locking
|
values differ: thus in a secondary index we must use next-key
|
||||||
delete-marked records. */
|
locks when locking delete-marked records. */
|
||||||
|
|
||||||
if (match_mode == ROW_SEL_EXACT
|
if (match_mode == ROW_SEL_EXACT
|
||||||
&& index->type & DICT_UNIQUE
|
&& index->type & DICT_UNIQUE
|
||||||
|
@ -3425,8 +3425,8 @@ row_search_for_mysql(
|
||||||
1 column. Return immediately if this is not a HANDLER
|
1 column. Return immediately if this is not a HANDLER
|
||||||
command. */
|
command. */
|
||||||
|
|
||||||
if (UNIV_UNLIKELY(direction != 0 &&
|
if (UNIV_UNLIKELY(direction != 0
|
||||||
!prebuilt->used_in_HANDLER)) {
|
&& !prebuilt->used_in_HANDLER)) {
|
||||||
|
|
||||||
err = DB_RECORD_NOT_FOUND;
|
err = DB_RECORD_NOT_FOUND;
|
||||||
goto func_exit;
|
goto func_exit;
|
||||||
|
|
|
@ -833,8 +833,8 @@ row_upd_build_difference_binary(
|
||||||
|
|
||||||
extern_bit = upd_ext_vec_contains(ext_vec, n_ext_vec, i);
|
extern_bit = upd_ext_vec_contains(ext_vec, n_ext_vec, i);
|
||||||
|
|
||||||
if (UNIV_UNLIKELY(extern_bit ==
|
if (UNIV_UNLIKELY(extern_bit
|
||||||
(ibool)!rec_offs_nth_extern(offsets, i))
|
== (ibool)!rec_offs_nth_extern(offsets, i))
|
||||||
|| !dfield_data_is_binary_equal(dfield, len, data)) {
|
|| !dfield_data_is_binary_equal(dfield, len, data)) {
|
||||||
|
|
||||||
upd_field = upd_get_nth_field(update, n_diff);
|
upd_field = upd_get_nth_field(update, n_diff);
|
||||||
|
|
|
@ -1506,8 +1506,8 @@ srv_suspend_mysql_thread(
|
||||||
|
|
||||||
mutex_exit(&kernel_mutex);
|
mutex_exit(&kernel_mutex);
|
||||||
|
|
||||||
if (srv_lock_wait_timeout < 100000000 &&
|
if (srv_lock_wait_timeout < 100000000
|
||||||
wait_time > (double)srv_lock_wait_timeout) {
|
&& wait_time > (double)srv_lock_wait_timeout) {
|
||||||
|
|
||||||
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
|
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
@ -1972,9 +1972,9 @@ loop:
|
||||||
|
|
||||||
wait_time = ut_difftime(ut_time(), slot->suspend_time);
|
wait_time = ut_difftime(ut_time(), slot->suspend_time);
|
||||||
|
|
||||||
if (srv_lock_wait_timeout < 100000000 &&
|
if (srv_lock_wait_timeout < 100000000
|
||||||
(wait_time > (double) srv_lock_wait_timeout
|
&& (wait_time > (double) srv_lock_wait_timeout
|
||||||
|| wait_time < 0)) {
|
|| wait_time < 0)) {
|
||||||
|
|
||||||
/* Timeout exceeded or a wrap-around in system
|
/* Timeout exceeded or a wrap-around in system
|
||||||
time counter: cancel the lock request queued
|
time counter: cancel the lock request queued
|
||||||
|
@ -2285,8 +2285,8 @@ loop:
|
||||||
log_buffer_flush_to_disk();
|
log_buffer_flush_to_disk();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf_get_modified_ratio_pct() >
|
if (UNIV_UNLIKELY(buf_get_modified_ratio_pct()
|
||||||
srv_max_buf_pool_modified_pct) {
|
> srv_max_buf_pool_modified_pct)) {
|
||||||
|
|
||||||
/* Try to keep the number of modified pages in the
|
/* Try to keep the number of modified pages in the
|
||||||
buffer pool under the limit wished by the user */
|
buffer pool under the limit wished by the user */
|
||||||
|
@ -2493,8 +2493,8 @@ flush_loop:
|
||||||
srv_main_thread_op_info = "flushing buffer pool pages";
|
srv_main_thread_op_info = "flushing buffer pool pages";
|
||||||
|
|
||||||
if (srv_fast_shutdown < 2) {
|
if (srv_fast_shutdown < 2) {
|
||||||
n_pages_flushed =
|
n_pages_flushed = buf_flush_batch
|
||||||
buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max);
|
(BUF_FLUSH_LIST, 100, ut_dulint_max);
|
||||||
} else {
|
} else {
|
||||||
/* In the fastest shutdown we do not flush the buffer pool
|
/* In the fastest shutdown we do not flush the buffer pool
|
||||||
to data files: we set n_pages_flushed to 0 artificially. */
|
to data files: we set n_pages_flushed to 0 artificially. */
|
||||||
|
@ -2560,8 +2560,8 @@ flush_loop:
|
||||||
|
|
||||||
goto background_loop;
|
goto background_loop;
|
||||||
}
|
}
|
||||||
} else if (n_tables_to_drop +
|
} else if (n_tables_to_drop
|
||||||
n_pages_purged + n_bytes_merged + n_pages_flushed
|
+ n_pages_purged + n_bytes_merged + n_pages_flushed
|
||||||
+ n_bytes_archived != 0) {
|
+ n_bytes_archived != 0) {
|
||||||
/* In a 'slow' shutdown we run purge and the insert buffer
|
/* In a 'slow' shutdown we run purge and the insert buffer
|
||||||
merge to completion */
|
merge to completion */
|
||||||
|
|
|
@ -560,8 +560,8 @@ open_or_create_log_file(
|
||||||
srv_log_group_home_dirs[k] = srv_add_path_separator_if_needed
|
srv_log_group_home_dirs[k] = srv_add_path_separator_if_needed
|
||||||
(srv_log_group_home_dirs[k]);
|
(srv_log_group_home_dirs[k]);
|
||||||
|
|
||||||
ut_a(strlen(srv_log_group_home_dirs[k]) <
|
ut_a(strlen(srv_log_group_home_dirs[k])
|
||||||
(sizeof name) - 10 - sizeof "ib_logfile");
|
< (sizeof name) - 10 - sizeof "ib_logfile");
|
||||||
sprintf(name, "%s%s%lu", srv_log_group_home_dirs[k],
|
sprintf(name, "%s%s%lu", srv_log_group_home_dirs[k],
|
||||||
"ib_logfile", (ulong) i);
|
"ib_logfile", (ulong) i);
|
||||||
|
|
||||||
|
@ -833,8 +833,7 @@ open_or_create_data_files(
|
||||||
if (i == srv_n_data_files - 1
|
if (i == srv_n_data_files - 1
|
||||||
&& srv_auto_extend_last_data_file) {
|
&& srv_auto_extend_last_data_file) {
|
||||||
|
|
||||||
if (srv_data_file_sizes[i] >
|
if (srv_data_file_sizes[i] > rounded_size_pages
|
||||||
rounded_size_pages
|
|
||||||
|| (srv_last_file_size_max > 0
|
|| (srv_last_file_size_max > 0
|
||||||
&& srv_last_file_size_max
|
&& srv_last_file_size_max
|
||||||
< rounded_size_pages)) {
|
< rounded_size_pages)) {
|
||||||
|
@ -1629,8 +1628,8 @@ innobase_start_or_create_for_mysql(void)
|
||||||
/* Create the master thread which does purge and other utility
|
/* Create the master thread which does purge and other utility
|
||||||
operations */
|
operations */
|
||||||
|
|
||||||
os_thread_create(&srv_master_thread, NULL, thread_ids + 1 +
|
os_thread_create(&srv_master_thread, NULL, thread_ids
|
||||||
SRV_MAX_N_IO_THREADS);
|
+ (1 + SRV_MAX_N_IO_THREADS));
|
||||||
#ifdef UNIV_DEBUG
|
#ifdef UNIV_DEBUG
|
||||||
/* buf_debug_prints = TRUE; */
|
/* buf_debug_prints = TRUE; */
|
||||||
#endif /* UNIV_DEBUG */
|
#endif /* UNIV_DEBUG */
|
||||||
|
|
|
@ -902,11 +902,11 @@ sync_array_signal_object(
|
||||||
sync_cell_t** old_cell_ptr = cell_ptr;
|
sync_cell_t** old_cell_ptr = cell_ptr;
|
||||||
size_t old_size, new_size;
|
size_t old_size, new_size;
|
||||||
|
|
||||||
old_size = cell_max_count *
|
old_size = cell_max_count
|
||||||
sizeof(sync_cell_t*);
|
* sizeof(sync_cell_t*);
|
||||||
cell_max_count *= 2;
|
cell_max_count *= 2;
|
||||||
new_size = cell_max_count *
|
new_size = cell_max_count
|
||||||
sizeof(sync_cell_t*);
|
* sizeof(sync_cell_t*);
|
||||||
|
|
||||||
cell_ptr = malloc(new_size);
|
cell_ptr = malloc(new_size);
|
||||||
ut_a(cell_ptr);
|
ut_a(cell_ptr);
|
||||||
|
|
|
@ -284,8 +284,8 @@ trx_purge_add_update_undo_to_history(
|
||||||
|
|
||||||
hist_size = mtr_read_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE,
|
hist_size = mtr_read_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE,
|
||||||
MLOG_4BYTES, mtr);
|
MLOG_4BYTES, mtr);
|
||||||
ut_ad(undo->size ==
|
ut_ad(undo->size == flst_get_len
|
||||||
flst_get_len(seg_header + TRX_UNDO_PAGE_LIST, mtr));
|
(seg_header + TRX_UNDO_PAGE_LIST, mtr));
|
||||||
|
|
||||||
mlog_write_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE,
|
mlog_write_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE,
|
||||||
hist_size + undo->size, MLOG_4BYTES, mtr);
|
hist_size + undo->size, MLOG_4BYTES, mtr);
|
||||||
|
|
|
@ -1286,9 +1286,9 @@ trx_undo_prev_version_build(
|
||||||
ut_ad(rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
|
ut_ad(rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
|
||||||
#endif /* UNIV_SYNC_DEBUG */
|
#endif /* UNIV_SYNC_DEBUG */
|
||||||
ut_ad(mtr_memo_contains(index_mtr, buf_block_align(index_rec),
|
ut_ad(mtr_memo_contains(index_mtr, buf_block_align(index_rec),
|
||||||
MTR_MEMO_PAGE_S_FIX) ||
|
MTR_MEMO_PAGE_S_FIX)
|
||||||
mtr_memo_contains(index_mtr, buf_block_align(index_rec),
|
|| mtr_memo_contains(index_mtr, buf_block_align(index_rec),
|
||||||
MTR_MEMO_PAGE_X_FIX));
|
MTR_MEMO_PAGE_X_FIX));
|
||||||
ut_ad(rec_offs_validate(rec, index, offsets));
|
ut_ad(rec_offs_validate(rec, index, offsets));
|
||||||
|
|
||||||
if (!(index->type & DICT_CLUSTERED)) {
|
if (!(index->type & DICT_CLUSTERED)) {
|
||||||
|
|
|
@ -201,10 +201,10 @@ start_again:
|
||||||
"InnoDB: Doublewrite buffer not found:"
|
"InnoDB: Doublewrite buffer not found:"
|
||||||
" creating new\n");
|
" creating new\n");
|
||||||
|
|
||||||
if (buf_pool_get_curr_size() <
|
if (buf_pool_get_curr_size()
|
||||||
(2 * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE
|
< ((2 * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE
|
||||||
+ FSP_EXTENT_SIZE / 2 + 100)
|
+ FSP_EXTENT_SIZE / 2 + 100)
|
||||||
* UNIV_PAGE_SIZE) {
|
* UNIV_PAGE_SIZE)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"InnoDB: Cannot create doublewrite buffer:"
|
"InnoDB: Cannot create doublewrite buffer:"
|
||||||
" you must\n"
|
" you must\n"
|
||||||
|
|
|
@ -563,8 +563,8 @@ trx_lists_init_at_db_start(void)
|
||||||
|
|
||||||
if (srv_force_recovery == 0) {
|
if (srv_force_recovery == 0) {
|
||||||
|
|
||||||
trx->conc_state =
|
trx->conc_state
|
||||||
TRX_PREPARED;
|
= TRX_PREPARED;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"InnoDB: Since"
|
"InnoDB: Since"
|
||||||
|
@ -577,8 +577,8 @@ trx_lists_init_at_db_start(void)
|
||||||
= TRX_ACTIVE;
|
= TRX_ACTIVE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
trx->conc_state =
|
trx->conc_state
|
||||||
TRX_COMMITTED_IN_MEMORY;
|
= TRX_COMMITTED_IN_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We give a dummy value for the trx
|
/* We give a dummy value for the trx
|
||||||
|
@ -599,8 +599,8 @@ trx_lists_init_at_db_start(void)
|
||||||
trx_list_insert_ordered(trx);
|
trx_list_insert_ordered(trx);
|
||||||
|
|
||||||
if (undo->dict_operation) {
|
if (undo->dict_operation) {
|
||||||
trx->dict_operation =
|
trx->dict_operation
|
||||||
undo->dict_operation;
|
= undo->dict_operation;
|
||||||
trx->table_id = undo->table_id;
|
trx->table_id = undo->table_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1757,8 +1757,8 @@ trx_print(
|
||||||
fprintf(f, "que state %lu ", (ulong) trx->que_state);
|
fprintf(f, "que state %lu ", (ulong) trx->que_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 < UT_LIST_GET_LEN(trx->trx_locks) ||
|
if (0 < UT_LIST_GET_LEN(trx->trx_locks)
|
||||||
mem_heap_get_size(trx->lock_heap) > 400) {
|
|| mem_heap_get_size(trx->lock_heap) > 400) {
|
||||||
newline = TRUE;
|
newline = TRUE;
|
||||||
|
|
||||||
fprintf(f, "%lu lock struct(s), heap size %lu",
|
fprintf(f, "%lu lock struct(s), heap size %lu",
|
||||||
|
|
|
@ -585,10 +585,10 @@ trx_undo_read_xid(
|
||||||
{
|
{
|
||||||
xid->formatID = (long)mach_read_from_4(log_hdr + TRX_UNDO_XA_FORMAT);
|
xid->formatID = (long)mach_read_from_4(log_hdr + TRX_UNDO_XA_FORMAT);
|
||||||
|
|
||||||
xid->gtrid_length =
|
xid->gtrid_length
|
||||||
(long)mach_read_from_4(log_hdr + TRX_UNDO_XA_TRID_LEN);
|
= (long) mach_read_from_4(log_hdr + TRX_UNDO_XA_TRID_LEN);
|
||||||
xid->bqual_length =
|
xid->bqual_length
|
||||||
(long)mach_read_from_4(log_hdr + TRX_UNDO_XA_BQUAL_LEN);
|
= (long) mach_read_from_4(log_hdr + TRX_UNDO_XA_BQUAL_LEN);
|
||||||
|
|
||||||
memcpy(xid->data, log_hdr + TRX_UNDO_XA_XID, XIDDATASIZE);
|
memcpy(xid->data, log_hdr + TRX_UNDO_XA_XID, XIDDATASIZE);
|
||||||
}
|
}
|
||||||
|
@ -1639,8 +1639,8 @@ trx_undo_mark_as_dict_operation(
|
||||||
|
|
||||||
hdr_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
|
hdr_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
|
||||||
|
|
||||||
mlog_write_ulint(hdr_page + undo->hdr_offset +
|
mlog_write_ulint(hdr_page + undo->hdr_offset
|
||||||
TRX_UNDO_DICT_TRANS,
|
+ TRX_UNDO_DICT_TRANS,
|
||||||
trx->dict_operation, MLOG_1BYTE, mtr);
|
trx->dict_operation, MLOG_1BYTE, mtr);
|
||||||
|
|
||||||
mlog_write_dulint(hdr_page + undo->hdr_offset + TRX_UNDO_TABLE_ID,
|
mlog_write_dulint(hdr_page + undo->hdr_offset + TRX_UNDO_TABLE_ID,
|
||||||
|
|
|
@ -454,8 +454,9 @@ ut_copy_file(
|
||||||
|
|
||||||
rewind(src);
|
rewind(src);
|
||||||
do {
|
do {
|
||||||
size_t maxs =
|
size_t maxs = len < (long) sizeof buf
|
||||||
len < (long) sizeof buf ? (size_t) len : sizeof buf;
|
? (size_t) len
|
||||||
|
: sizeof buf;
|
||||||
size_t size = fread(buf, 1, maxs, src);
|
size_t size = fread(buf, 1, maxs, src);
|
||||||
fwrite(buf, 1, size, dest);
|
fwrite(buf, 1, size, dest);
|
||||||
len -= (long) size;
|
len -= (long) size;
|
||||||
|
|
Loading…
Add table
Reference in a new issue