Commit ac69f8c2 authored by osku's avatar osku

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

misc cleanups.
parent 9596f6d8
This diff is collapsed.
This diff is collapsed.
...@@ -30,7 +30,7 @@ btr_pcur_create_for_mysql(void) ...@@ -30,7 +30,7 @@ btr_pcur_create_for_mysql(void)
pcur->btr_cur.index = NULL; pcur->btr_cur.index = NULL;
btr_pcur_init(pcur); btr_pcur_init(pcur);
return(pcur); return(pcur);
} }
...@@ -53,7 +53,7 @@ btr_pcur_free_for_mysql( ...@@ -53,7 +53,7 @@ btr_pcur_free_for_mysql(
cursor->old_rec = NULL; cursor->old_rec = NULL;
cursor->old_n_fields = 0; cursor->old_n_fields = 0;
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED; cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
cursor->latch_mode = BTR_NO_LATCHES; cursor->latch_mode = BTR_NO_LATCHES;
cursor->pos_state = BTR_PCUR_NOT_POSITIONED; cursor->pos_state = BTR_PCUR_NOT_POSITIONED;
...@@ -79,7 +79,7 @@ btr_pcur_store_position( ...@@ -79,7 +79,7 @@ btr_pcur_store_position(
dict_tree_t* tree; dict_tree_t* tree;
page_t* page; page_t* page;
ulint offs; ulint offs;
ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
ut_ad(cursor->latch_mode != BTR_NO_LATCHES); ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
...@@ -92,9 +92,9 @@ btr_pcur_store_position( ...@@ -92,9 +92,9 @@ btr_pcur_store_position(
offs = ut_align_offset(rec, UNIV_PAGE_SIZE); offs = ut_align_offset(rec, UNIV_PAGE_SIZE);
ut_ad(mtr_memo_contains(mtr, buf_block_align(page), ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
MTR_MEMO_PAGE_S_FIX) MTR_MEMO_PAGE_S_FIX)
|| mtr_memo_contains(mtr, buf_block_align(page), || mtr_memo_contains(mtr, buf_block_align(page),
MTR_MEMO_PAGE_X_FIX)); MTR_MEMO_PAGE_X_FIX));
ut_a(cursor->latch_mode != BTR_NO_LATCHES); ut_a(cursor->latch_mode != BTR_NO_LATCHES);
if (UNIV_UNLIKELY(page_get_n_recs(page) == 0)) { if (UNIV_UNLIKELY(page_get_n_recs(page) == 0)) {
...@@ -115,7 +115,7 @@ btr_pcur_store_position( ...@@ -115,7 +115,7 @@ btr_pcur_store_position(
} }
return; return;
} }
if (page_rec_is_supremum_low(offs)) { if (page_rec_is_supremum_low(offs)) {
...@@ -138,7 +138,7 @@ btr_pcur_store_position( ...@@ -138,7 +138,7 @@ btr_pcur_store_position(
&cursor->old_rec_buf, &cursor->old_rec_buf,
&cursor->buf_size); &cursor->buf_size);
cursor->block_when_stored = buf_block_align(page); cursor->block_when_stored = buf_block_align(page);
cursor->modify_clock = buf_block_get_modify_clock( cursor->modify_clock = buf_block_get_modify_clock(
cursor->block_when_stored); cursor->block_when_stored);
} }
...@@ -163,12 +163,12 @@ btr_pcur_copy_stored_position( ...@@ -163,12 +163,12 @@ btr_pcur_copy_stored_position(
if (pcur_donate->old_rec_buf) { if (pcur_donate->old_rec_buf) {
pcur_receive->old_rec_buf = mem_alloc(pcur_donate->buf_size); pcur_receive->old_rec_buf = mem_alloc(pcur_donate->buf_size);
ut_memcpy(pcur_receive->old_rec_buf, pcur_donate->old_rec_buf, ut_memcpy(pcur_receive->old_rec_buf, pcur_donate->old_rec_buf,
pcur_donate->buf_size); pcur_donate->buf_size);
pcur_receive->old_rec = pcur_receive->old_rec_buf pcur_receive->old_rec = pcur_receive->old_rec_buf
+ (pcur_donate->old_rec - pcur_donate->old_rec_buf); + (pcur_donate->old_rec - pcur_donate->old_rec_buf);
} }
pcur_receive->old_n_fields = pcur_donate->old_n_fields; pcur_receive->old_n_fields = pcur_donate->old_n_fields;
} }
...@@ -195,7 +195,7 @@ btr_pcur_restore_position( ...@@ -195,7 +195,7 @@ btr_pcur_restore_position(
whose ordering fields are identical to whose ordering fields are identical to
the ones of the original user record */ the ones of the original user record */
ulint latch_mode, /* in: BTR_SEARCH_LEAF, ... */ ulint latch_mode, /* in: BTR_SEARCH_LEAF, ... */
btr_pcur_t* cursor, /* in: detached persistent cursor */ btr_pcur_t* cursor, /* in: detached persistent cursor */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /* in: mtr */
{ {
dict_tree_t* tree; dict_tree_t* tree;
...@@ -206,21 +206,21 @@ btr_pcur_restore_position( ...@@ -206,21 +206,21 @@ btr_pcur_restore_position(
mem_heap_t* heap; mem_heap_t* heap;
if (UNIV_UNLIKELY(cursor->old_stored != BTR_PCUR_OLD_STORED) if (UNIV_UNLIKELY(cursor->old_stored != BTR_PCUR_OLD_STORED)
|| UNIV_UNLIKELY(cursor->pos_state != BTR_PCUR_WAS_POSITIONED || UNIV_UNLIKELY(cursor->pos_state != BTR_PCUR_WAS_POSITIONED
&& cursor->pos_state != BTR_PCUR_IS_POSITIONED)) { && cursor->pos_state != BTR_PCUR_IS_POSITIONED)) {
ut_print_buf(stderr, (const byte*)cursor, sizeof(btr_pcur_t)); ut_print_buf(stderr, (const byte*)cursor, sizeof(btr_pcur_t));
if (cursor->trx_if_known) { if (cursor->trx_if_known) {
trx_print(stderr, cursor->trx_if_known, 0); trx_print(stderr, cursor->trx_if_known, 0);
} }
ut_error; ut_error;
} }
if (UNIV_UNLIKELY(cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE if (UNIV_UNLIKELY(cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE
|| cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE)) { || cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE)) {
/* In these cases we do not try an optimistic restoration, /* In these cases we do not try an optimistic restoration,
but always do a search */ but always do a search */
btr_cur_open_at_index_side( btr_cur_open_at_index_side(
cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE, cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE,
...@@ -232,7 +232,7 @@ btr_pcur_restore_position( ...@@ -232,7 +232,7 @@ btr_pcur_restore_position(
return(FALSE); return(FALSE);
} }
ut_a(cursor->old_rec); ut_a(cursor->old_rec);
ut_a(cursor->old_n_fields); ut_a(cursor->old_n_fields);
...@@ -241,10 +241,10 @@ btr_pcur_restore_position( ...@@ -241,10 +241,10 @@ btr_pcur_restore_position(
if (UNIV_LIKELY(latch_mode == BTR_SEARCH_LEAF) if (UNIV_LIKELY(latch_mode == BTR_SEARCH_LEAF)
|| UNIV_LIKELY(latch_mode == BTR_MODIFY_LEAF)) { || UNIV_LIKELY(latch_mode == BTR_MODIFY_LEAF)) {
/* Try optimistic restoration */ /* Try optimistic restoration */
if (UNIV_LIKELY(buf_page_optimistic_get(latch_mode, if (UNIV_LIKELY(buf_page_optimistic_get(latch_mode,
cursor->block_when_stored, page, cursor->block_when_stored, page,
cursor->modify_clock, mtr))) { cursor->modify_clock, mtr))) {
cursor->pos_state = BTR_PCUR_IS_POSITIONED; cursor->pos_state = BTR_PCUR_IS_POSITIONED;
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_TREE_NODE); buf_page_dbg_add_level(page, SYNC_TREE_NODE);
...@@ -285,14 +285,14 @@ btr_pcur_restore_position( ...@@ -285,14 +285,14 @@ btr_pcur_restore_position(
/* If optimistic restoration did not succeed, open the cursor anew */ /* If optimistic restoration did not succeed, open the cursor anew */
heap = mem_heap_create(256); heap = mem_heap_create(256);
tree = btr_cur_get_tree(btr_pcur_get_btr_cur(cursor)); tree = btr_cur_get_tree(btr_pcur_get_btr_cur(cursor));
tuple = dict_tree_build_data_tuple(tree, cursor->old_rec, tuple = dict_tree_build_data_tuple(tree, cursor->old_rec,
cursor->old_n_fields, heap); cursor->old_n_fields, heap);
/* Save the old search mode of the cursor */ /* Save the old search mode of the cursor */
old_mode = cursor->search_mode; old_mode = cursor->search_mode;
if (UNIV_LIKELY(cursor->rel_pos == BTR_PCUR_ON)) { if (UNIV_LIKELY(cursor->rel_pos == BTR_PCUR_ON)) {
mode = PAGE_CUR_LE; mode = PAGE_CUR_LE;
} else if (cursor->rel_pos == BTR_PCUR_AFTER) { } else if (cursor->rel_pos == BTR_PCUR_AFTER) {
...@@ -304,13 +304,13 @@ btr_pcur_restore_position( ...@@ -304,13 +304,13 @@ btr_pcur_restore_position(
btr_pcur_open_with_no_init(btr_pcur_get_btr_cur(cursor)->index, tuple, btr_pcur_open_with_no_init(btr_pcur_get_btr_cur(cursor)->index, tuple,
mode, latch_mode, cursor, 0, mtr); mode, latch_mode, cursor, 0, mtr);
/* Restore the old search mode */ /* Restore the old search mode */
cursor->search_mode = old_mode; cursor->search_mode = old_mode;
if (cursor->rel_pos == BTR_PCUR_ON if (cursor->rel_pos == BTR_PCUR_ON
&& btr_pcur_is_on_user_rec(cursor, mtr) && btr_pcur_is_on_user_rec(cursor, mtr)
&& 0 == cmp_dtuple_rec(tuple, btr_pcur_get_rec(cursor), && 0 == cmp_dtuple_rec(tuple, btr_pcur_get_rec(cursor),
rec_get_offsets(btr_pcur_get_rec(cursor), rec_get_offsets(btr_pcur_get_rec(cursor),
btr_pcur_get_btr_cur(cursor)->index, btr_pcur_get_btr_cur(cursor)->index,
NULL, ULINT_UNDEFINED, &heap))) { NULL, ULINT_UNDEFINED, &heap))) {
...@@ -335,7 +335,7 @@ btr_pcur_restore_position( ...@@ -335,7 +335,7 @@ btr_pcur_restore_position(
/* We have to store new position information, modify_clock etc., /* We have to store new position information, modify_clock etc.,
to the cursor because it can now be on a different page, the record to the cursor because it can now be on a different page, the record
under it may have been removed, etc. */ under it may have been removed, etc. */
btr_pcur_store_position(cursor, mtr); btr_pcur_store_position(cursor, mtr);
return(FALSE); return(FALSE);
...@@ -358,12 +358,12 @@ btr_pcur_release_leaf( ...@@ -358,12 +358,12 @@ btr_pcur_release_leaf(
ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
ut_ad(cursor->latch_mode != BTR_NO_LATCHES); ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
page = btr_cur_get_page(btr_pcur_get_btr_cur(cursor)); page = btr_cur_get_page(btr_pcur_get_btr_cur(cursor));
btr_leaf_page_release(page, cursor->latch_mode, mtr); btr_leaf_page_release(page, cursor->latch_mode, mtr);
cursor->latch_mode = BTR_NO_LATCHES; cursor->latch_mode = BTR_NO_LATCHES;
cursor->pos_state = BTR_PCUR_WAS_POSITIONED; cursor->pos_state = BTR_PCUR_WAS_POSITIONED;
} }
...@@ -386,25 +386,25 @@ btr_pcur_move_to_next_page( ...@@ -386,25 +386,25 @@ btr_pcur_move_to_next_page(
page_t* page; page_t* page;
page_t* next_page; page_t* next_page;
ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
ut_ad(cursor->latch_mode != BTR_NO_LATCHES); ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
ut_ad(btr_pcur_is_after_last_on_page(cursor, mtr)); ut_ad(btr_pcur_is_after_last_on_page(cursor, mtr));
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED; cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
page = btr_pcur_get_page(cursor); page = btr_pcur_get_page(cursor);
next_page_no = btr_page_get_next(page, mtr); next_page_no = btr_page_get_next(page, mtr);
space = buf_frame_get_space_id(page); space = buf_frame_get_space_id(page);
ut_ad(next_page_no != FIL_NULL); ut_ad(next_page_no != FIL_NULL);
next_page = btr_page_get(space, next_page_no, cursor->latch_mode, mtr); next_page = btr_page_get(space, next_page_no, cursor->latch_mode, mtr);
ut_a(page_is_comp(next_page) == page_is_comp(page)); ut_a(page_is_comp(next_page) == page_is_comp(page));
buf_block_align(next_page)->check_index_page_at_flush = TRUE; buf_block_align(next_page)->check_index_page_at_flush = TRUE;
btr_leaf_page_release(page, cursor->latch_mode, mtr); btr_leaf_page_release(page, cursor->latch_mode, mtr);
page_cur_set_before_first(next_page, btr_pcur_get_page_cur(cursor)); page_cur_set_before_first(next_page, btr_pcur_get_page_cur(cursor));
page_check_dir(next_page); page_check_dir(next_page);
...@@ -436,11 +436,11 @@ btr_pcur_move_backward_from_page( ...@@ -436,11 +436,11 @@ btr_pcur_move_backward_from_page(
ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
ut_ad(cursor->latch_mode != BTR_NO_LATCHES); ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
ut_ad(btr_pcur_is_before_first_on_page(cursor, mtr)); ut_ad(btr_pcur_is_before_first_on_page(cursor, mtr));
ut_ad(!btr_pcur_is_before_first_in_tree(cursor, mtr)); ut_ad(!btr_pcur_is_before_first_in_tree(cursor, mtr));
latch_mode = cursor->latch_mode; latch_mode = cursor->latch_mode;
if (latch_mode == BTR_SEARCH_LEAF) { if (latch_mode == BTR_SEARCH_LEAF) {
latch_mode2 = BTR_SEARCH_PREV; latch_mode2 = BTR_SEARCH_PREV;
...@@ -459,7 +459,7 @@ btr_pcur_move_backward_from_page( ...@@ -459,7 +459,7 @@ btr_pcur_move_backward_from_page(
mtr_start(mtr); mtr_start(mtr);
btr_pcur_restore_position(latch_mode2, cursor, mtr); btr_pcur_restore_position(latch_mode2, cursor, mtr);
page = btr_pcur_get_page(cursor); page = btr_pcur_get_page(cursor);
...@@ -467,7 +467,7 @@ btr_pcur_move_backward_from_page( ...@@ -467,7 +467,7 @@ btr_pcur_move_backward_from_page(
space = buf_frame_get_space_id(page); space = buf_frame_get_space_id(page);
if (btr_pcur_is_before_first_on_page(cursor, mtr) if (btr_pcur_is_before_first_on_page(cursor, mtr)
&& (prev_page_no != FIL_NULL)) { && (prev_page_no != FIL_NULL)) {
prev_page = btr_pcur_get_btr_cur(cursor)->left_page; prev_page = btr_pcur_get_btr_cur(cursor)->left_page;
...@@ -476,11 +476,11 @@ btr_pcur_move_backward_from_page( ...@@ -476,11 +476,11 @@ btr_pcur_move_backward_from_page(
page_cur_set_after_last(prev_page, page_cur_set_after_last(prev_page,
btr_pcur_get_page_cur(cursor)); btr_pcur_get_page_cur(cursor));
} else if (prev_page_no != FIL_NULL) { } else if (prev_page_no != FIL_NULL) {
/* The repositioned cursor did not end on an infimum record on /* The repositioned cursor did not end on an infimum record on
a page. Cursor repositioning acquired a latch also on the a page. Cursor repositioning acquired a latch also on the
previous page, but we do not need the latch: release it. */ previous page, but we do not need the latch: release it. */
prev_page = btr_pcur_get_btr_cur(cursor)->left_page; prev_page = btr_pcur_get_btr_cur(cursor)->left_page;
btr_leaf_page_release(prev_page, latch_mode, mtr); btr_leaf_page_release(prev_page, latch_mode, mtr);
...@@ -506,7 +506,7 @@ btr_pcur_move_to_prev( ...@@ -506,7 +506,7 @@ btr_pcur_move_to_prev(
{ {
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
ut_ad(cursor->latch_mode != BTR_NO_LATCHES); ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED; cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
if (btr_pcur_is_before_first_on_page(cursor, mtr)) { if (btr_pcur_is_before_first_on_page(cursor, mtr)) {
...@@ -542,14 +542,14 @@ btr_pcur_open_on_user_rec( ...@@ -542,14 +542,14 @@ btr_pcur_open_on_user_rec(
ulint mode, /* in: PAGE_CUR_L, ... */ ulint mode, /* in: PAGE_CUR_L, ... */
ulint latch_mode, /* in: BTR_SEARCH_LEAF or ulint latch_mode, /* in: BTR_SEARCH_LEAF or
BTR_MODIFY_LEAF */ BTR_MODIFY_LEAF */
btr_pcur_t* cursor, /* in: memory buffer for persistent btr_pcur_t* cursor, /* in: memory buffer for persistent
cursor */ cursor */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /* in: mtr */
{ {
btr_pcur_open(index, tuple, mode, latch_mode, cursor, mtr); btr_pcur_open(index, tuple, mode, latch_mode, cursor, mtr);
if ((mode == PAGE_CUR_GE) || (mode == PAGE_CUR_G)) { if ((mode == PAGE_CUR_GE) || (mode == PAGE_CUR_G)) {
if (btr_pcur_is_after_last_on_page(cursor, mtr)) { if (btr_pcur_is_after_last_on_page(cursor, mtr)) {
btr_pcur_move_to_next_user_rec(cursor, mtr); btr_pcur_move_to_next_user_rec(cursor, mtr);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -27,15 +27,15 @@ ulint data_dummy; /* this is used to fool the compiler in ...@@ -27,15 +27,15 @@ ulint data_dummy; /* this is used to fool the compiler in
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
/* Some non-inlined functions used in the MySQL interface: */ /* Some non-inlined functions used in the MySQL interface: */
void void
dfield_set_data_noninline( dfield_set_data_noninline(
dfield_t* field, /* in: field */ dfield_t* field, /* in: field */
void* data, /* in: data */ void* data, /* in: data */
ulint len) /* in: length or UNIV_SQL_NULL */ ulint len) /* in: length or UNIV_SQL_NULL */
{ {
dfield_set_data(field, data, len); dfield_set_data(field, data, len);
} }
void* void*
dfield_get_data_noninline( dfield_get_data_noninline(
dfield_t* field) /* in: field */ dfield_t* field) /* in: field */
{ {
...@@ -47,15 +47,15 @@ dfield_get_len_noninline( ...@@ -47,15 +47,15 @@ dfield_get_len_noninline(
{ {
return(dfield_get_len(field)); return(dfield_get_len(field));
} }
ulint ulint
dtuple_get_n_fields_noninline( dtuple_get_n_fields_noninline(
dtuple_t* tuple) /* in: tuple */ dtuple_t* tuple) /* in: tuple */
{ {
return(dtuple_get_n_fields(tuple)); return(dtuple_get_n_fields(tuple));
} }
dfield_t* dfield_t*
dtuple_get_nth_field_noninline( dtuple_get_nth_field_noninline(
dtuple_t* tuple, /* in: tuple */ dtuple_t* tuple, /* in: tuple */
ulint n) /* in: index of field */ ulint n) /* in: index of field */
{ {
return(dtuple_get_nth_field(tuple, n)); return(dtuple_get_nth_field(tuple, n));
...@@ -83,7 +83,7 @@ dfield_data_is_binary_equal( ...@@ -83,7 +83,7 @@ dfield_data_is_binary_equal(
} }
if (0 != ut_memcmp(field->data, data, len)) { if (0 != ut_memcmp(field->data, data, len)) {
return(FALSE); return(FALSE);
} }
...@@ -122,18 +122,18 @@ dtuple_datas_are_ordering_equal( ...@@ -122,18 +122,18 @@ dtuple_datas_are_ordering_equal(
return(FALSE); return(FALSE);
} }
for (i = 0; i < n_fields; i++) { for (i = 0; i < n_fields; i++) {
field1 = dtuple_get_nth_field(tuple1, i); field1 = dtuple_get_nth_field(tuple1, i);
field2 = dtuple_get_nth_field(tuple2, i); field2 = dtuple_get_nth_field(tuple2, i);
if (0 != cmp_dfield_dfield(field1, field2)) { if (0 != cmp_dfield_dfield(field1, field2)) {
return(FALSE); return(FALSE);
} }
} }
return(TRUE); return(TRUE);
} }
...@@ -144,12 +144,12 @@ dtuple_t* ...@@ -144,12 +144,12 @@ dtuple_t*
dtuple_create_for_mysql( dtuple_create_for_mysql(
/*====================*/ /*====================*/
/* out, own created dtuple */ /* out, own created dtuple */
void** heap, /* out: created memory heap */ void** heap, /* out: created memory heap */
ulint n_fields) /* in: number of fields */ ulint n_fields) /* in: number of fields */
{ {
*heap = (void*)mem_heap_create(500); *heap = (void*)mem_heap_create(500);
return(dtuple_create(*((mem_heap_t**)heap), n_fields)); return(dtuple_create(*((mem_heap_t**)heap), n_fields));
} }
/************************************************************************* /*************************************************************************
...@@ -160,12 +160,12 @@ dtuple_free_for_mysql( ...@@ -160,12 +160,12 @@ dtuple_free_for_mysql(
/*==================*/ /*==================*/
void* heap) /* in: memory heap where tuple was created */ void* heap) /* in: memory heap where tuple was created */
{ {
mem_heap_free((mem_heap_t*)heap); mem_heap_free((mem_heap_t*)heap);
} }
/************************************************************************* /*************************************************************************
Sets number of fields used in a tuple. Normally this is set in Sets number of fields used in a tuple. Normally this is set in
dtuple_create, but if you want later to set it smaller, you can use this. */ dtuple_create, but if you want later to set it smaller, you can use this. */
void void
dtuple_set_n_fields( dtuple_set_n_fields(
...@@ -189,7 +189,7 @@ dfield_check_typed_no_assert( ...@@ -189,7 +189,7 @@ dfield_check_typed_no_assert(
dfield_t* field) /* in: data field */ dfield_t* field) /* in: data field */
{ {
if (dfield_get_type(field)->mtype > DATA_MYSQL if (dfield_get_type(field)->mtype > DATA_MYSQL
|| dfield_get_type(field)->mtype < DATA_VARCHAR) { || dfield_get_type(field)->mtype < DATA_VARCHAR) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: data field type %lu, len %lu\n", "InnoDB: Error: data field type %lu, len %lu\n",
...@@ -211,8 +211,8 @@ dtuple_check_typed_no_assert( ...@@ -211,8 +211,8 @@ dtuple_check_typed_no_assert(
dtuple_t* tuple) /* in: tuple */ dtuple_t* tuple) /* in: tuple */
{ {
dfield_t* field; dfield_t* field;
ulint i; ulint i;
if (dtuple_get_n_fields(tuple) > REC_MAX_N_FIELDS) { if (dtuple_get_n_fields(tuple) > REC_MAX_N_FIELDS) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: index entry has %lu fields\n", "InnoDB: Error: index entry has %lu fields\n",
...@@ -247,7 +247,7 @@ dfield_check_typed( ...@@ -247,7 +247,7 @@ dfield_check_typed(
dfield_t* field) /* in: data field */ dfield_t* field) /* in: data field */
{ {
if (dfield_get_type(field)->mtype > DATA_MYSQL if (dfield_get_type(field)->mtype > DATA_MYSQL
|| dfield_get_type(field)->mtype < DATA_VARCHAR) { || dfield_get_type(field)->mtype < DATA_VARCHAR) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: data field type %lu, len %lu\n", "InnoDB: Error: data field type %lu, len %lu\n",
...@@ -270,7 +270,7 @@ dtuple_check_typed( ...@@ -270,7 +270,7 @@ dtuple_check_typed(
dtuple_t* tuple) /* in: tuple */ dtuple_t* tuple) /* in: tuple */
{ {
dfield_t* field; dfield_t* field;
ulint i; ulint i;
for (i = 0; i < dtuple_get_n_fields(tuple); i++) { for (i = 0; i < dtuple_get_n_fields(tuple); i++) {
...@@ -294,11 +294,11 @@ dtuple_validate( ...@@ -294,11 +294,11 @@ dtuple_validate(
dtuple_t* tuple) /* in: tuple */ dtuple_t* tuple) /* in: tuple */
{ {
dfield_t* field; dfield_t* field;
byte* data; byte* data;
ulint n_fields; ulint n_fields;
ulint len; ulint len;
ulint i; ulint i;
ulint j; ulint j;
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N); ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
...@@ -311,7 +311,7 @@ dtuple_validate( ...@@ -311,7 +311,7 @@ dtuple_validate(
field = dtuple_get_nth_field(tuple, i); field = dtuple_get_nth_field(tuple, i);
len = dfield_get_len(field); len = dfield_get_len(field);
if (len != UNIV_SQL_NULL) { if (len != UNIV_SQL_NULL) {
data = field->data; data = field->data;
...@@ -357,7 +357,7 @@ dfield_print( ...@@ -357,7 +357,7 @@ dfield_print(
mtype = dtype_get_mtype(dfield_get_type(dfield)); mtype = dtype_get_mtype(dfield_get_type(dfield));
if ((mtype == DATA_CHAR) || (mtype == DATA_VARCHAR)) { if ((mtype == DATA_CHAR) || (mtype == DATA_VARCHAR)) {
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
int c = *data++; int c = *data++;
putc(isprint(c) ? c : ' ', stderr); putc(isprint(c) ? c : ' ', stderr);
...@@ -372,7 +372,7 @@ dfield_print( ...@@ -372,7 +372,7 @@ dfield_print(
/***************************************************************** /*****************************************************************
Pretty prints a dfield value according to its data type. Also the hex string Pretty prints a dfield value according to its data type. Also the hex string
is printed if a string contains non-printable characters. */ is printed if a string contains non-printable characters. */
void void
dfield_print_also_hex( dfield_print_also_hex(
...@@ -399,7 +399,7 @@ dfield_print_also_hex( ...@@ -399,7 +399,7 @@ dfield_print_also_hex(
if ((mtype == DATA_CHAR) || (mtype == DATA_VARCHAR)) { if ((mtype == DATA_CHAR) || (mtype == DATA_VARCHAR)) {
print_also_hex = FALSE; print_also_hex = FALSE;
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
int c = *data++; int c = *data++;
if (!isprint(c)) { if (!isprint(c)) {
...@@ -415,9 +415,9 @@ dfield_print_also_hex( ...@@ -415,9 +415,9 @@ dfield_print_also_hex(
} }
fputs(" Hex: ", stderr); fputs(" Hex: ", stderr);
data = dfield_get_data(dfield); data = dfield_get_data(dfield);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
fprintf(stderr, "%02lx", (ulint)*data); fprintf(stderr, "%02lx", (ulint)*data);
...@@ -452,7 +452,7 @@ dtuple_print( ...@@ -452,7 +452,7 @@ dtuple_print(
fprintf(f, " %lu:", (ulong) i); fprintf(f, " %lu:", (ulong) i);
field = dtuple_get_nth_field(tuple, i); field = dtuple_get_nth_field(tuple, i);
if (field->len != UNIV_SQL_NULL) { if (field->len != UNIV_SQL_NULL) {
ut_print_buf(f, field->data, field->len); ut_print_buf(f, field->data, field->len);
} else { } else {
...@@ -497,7 +497,7 @@ dtuple_convert_big_rec( ...@@ -497,7 +497,7 @@ dtuple_convert_big_rec(
ibool is_externally_stored; ibool is_externally_stored;
ulint i; ulint i;
ulint j; ulint j;
ut_a(dtuple_check_typed_no_assert(entry)); ut_a(dtuple_check_typed_no_assert(entry));
size = rec_get_converted_size(index, entry); size = rec_get_converted_size(index, entry);
...@@ -545,21 +545,21 @@ dtuple_convert_big_rec( ...@@ -545,21 +545,21 @@ dtuple_convert_big_rec(
} }
} }
} }
if (!is_externally_stored) { if (!is_externally_stored) {
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;
longest_i = i; longest_i = i;
} }
} }
} }
/* We do not store externally fields which are smaller than /* We do not store externally fields which are smaller than
DICT_MAX_INDEX_COL_LEN */ DICT_MAX_INDEX_COL_LEN */
...@@ -591,7 +591,7 @@ dtuple_convert_big_rec( ...@@ -591,7 +591,7 @@ dtuple_convert_big_rec(
vector->fields[n_fields].field_no = longest_i; vector->fields[n_fields].field_no = longest_i;
ut_a(dfield->len > DICT_MAX_INDEX_COL_LEN); ut_a(dfield->len > DICT_MAX_INDEX_COL_LEN);
vector->fields[n_fields].len = dfield->len vector->fields[n_fields].len = dfield->len
- DICT_MAX_INDEX_COL_LEN; - DICT_MAX_INDEX_COL_LEN;
...@@ -612,7 +612,7 @@ dtuple_convert_big_rec( ...@@ -612,7 +612,7 @@ dtuple_convert_big_rec(
+ dfield->len - BTR_EXTERN_FIELD_REF_SIZE, + dfield->len - BTR_EXTERN_FIELD_REF_SIZE,
0, BTR_EXTERN_FIELD_REF_SIZE); 0, BTR_EXTERN_FIELD_REF_SIZE);
n_fields++; n_fields++;
} }
vector->n_fields = n_fields; vector->n_fields = n_fields;
return(vector); return(vector);
...@@ -632,10 +632,10 @@ dtuple_convert_back_big_rec( ...@@ -632,10 +632,10 @@ dtuple_convert_back_big_rec(
freed in this function */ freed in this function */
{ {
dfield_t* dfield; dfield_t* dfield;
ulint i; ulint i;
for (i = 0; i < vector->n_fields; i++) { for (i = 0; i < vector->n_fields; i++) {
dfield = dtuple_get_nth_field(entry, dfield = dtuple_get_nth_field(entry,
vector->fields[i].field_no); vector->fields[i].field_no);
/* Copy data from big rec vector */ /* Copy data from big rec vector */
...@@ -643,10 +643,10 @@ dtuple_convert_back_big_rec( ...@@ -643,10 +643,10 @@ dtuple_convert_back_big_rec(
ut_memcpy(((byte*)dfield->data) ut_memcpy(((byte*)dfield->data)
+ dfield->len - BTR_EXTERN_FIELD_REF_SIZE, + dfield->len - BTR_EXTERN_FIELD_REF_SIZE,
vector->fields[i].data, vector->fields[i].data,
vector->fields[i].len); vector->fields[i].len);
dfield->len = dfield->len + vector->fields[i].len dfield->len = dfield->len + vector->fields[i].len
- BTR_EXTERN_FIELD_REF_SIZE; - BTR_EXTERN_FIELD_REF_SIZE;
} }
mem_heap_free(vector->heap); mem_heap_free(vector->heap);
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -31,7 +31,7 @@ dyn_array_add_block( ...@@ -31,7 +31,7 @@ dyn_array_add_block(
UT_LIST_ADD_FIRST(list, arr->base, arr); UT_LIST_ADD_FIRST(list, arr->base, arr);
arr->heap = mem_heap_create(sizeof(dyn_block_t)); arr->heap = mem_heap_create(sizeof(dyn_block_t));
} }
block = dyn_array_get_last_block(arr); block = dyn_array_get_last_block(arr);
block->used = block->used | DYN_BLOCK_FULL_FLAG; block->used = block->used | DYN_BLOCK_FULL_FLAG;
......
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.
...@@ -72,7 +72,7 @@ UNIV_INLINE ...@@ -72,7 +72,7 @@ UNIV_INLINE
void void
btr_cur_position( btr_cur_position(
/*=============*/ /*=============*/
dict_index_t* index, /* in: index */ dict_index_t* index, /* in: index */
rec_t* rec, /* in: record in tree */ rec_t* rec, /* in: record in tree */
btr_cur_t* cursor);/* in: cursor */ btr_cur_t* cursor);/* in: cursor */
/************************************************************************ /************************************************************************
...@@ -550,7 +550,7 @@ btr_push_update_extern_fields( ...@@ -550,7 +550,7 @@ btr_push_update_extern_fields(
to have space for all fields in rec */ to have space for all fields in rec */
const ulint* offsets,/* in: array returned by rec_get_offsets() */ const ulint* offsets,/* in: array returned by rec_get_offsets() */
upd_t* update);/* in: update vector or NULL */ upd_t* update);/* in: update vector or NULL */
/*######################################################################*/ /*######################################################################*/
...@@ -697,5 +697,5 @@ extern ulint btr_cur_n_sea_old; ...@@ -697,5 +697,5 @@ extern ulint btr_cur_n_sea_old;
#ifndef UNIV_NONINL #ifndef UNIV_NONINL
#include "btr0cur.ic" #include "btr0cur.ic"
#endif #endif
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment