Commit 916cd784 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.2 into bb-10.2-ext

parents 72a80242 dc112d2f
...@@ -1895,6 +1895,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -1895,6 +1895,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
usage(1); usage(1);
status.exit_status= 0; status.exit_status= 0;
mysql_end(-1); mysql_end(-1);
break;
case 'I': case 'I':
case '?': case '?':
usage(0); usage(0);
......
...@@ -331,7 +331,7 @@ btr_pcur_restore_position_func( ...@@ -331,7 +331,7 @@ btr_pcur_restore_position_func(
heap = mem_heap_create(256); heap = mem_heap_create(256);
tuple = dict_index_build_data_tuple(index, cursor->old_rec, tuple = dict_index_build_data_tuple(cursor->old_rec, index, true,
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 */
......
...@@ -5703,16 +5703,22 @@ dict_index_copy_rec_order_prefix( ...@@ -5703,16 +5703,22 @@ dict_index_copy_rec_order_prefix(
return(rec_copy_prefix_to_buf(rec, index, n, buf, buf_size)); return(rec_copy_prefix_to_buf(rec, index, n, buf, buf_size));
} }
/**********************************************************************//** /** Convert a physical record into a search tuple.
Builds a typed data tuple out of a physical record. @param[in] rec index record (not necessarily in an index page)
@param[in] index index
@param[in] leaf whether rec is in a leaf page
@param[in] n_fields number of data fields
@param[in,out] heap memory heap for allocation
@return own: data tuple */ @return own: data tuple */
dtuple_t* dtuple_t*
dict_index_build_data_tuple( dict_index_build_data_tuple_func(
/*========================*/ const rec_t* rec,
dict_index_t* index, /*!< in: index tree */ const dict_index_t* index,
rec_t* rec, /*!< in: record for which to build data tuple */ #ifdef UNIV_DEBUG
ulint n_fields,/*!< in: number of data fields */ bool leaf,
mem_heap_t* heap) /*!< in: memory heap where tuple created */ #endif /* UNIV_DEBUG */
ulint n_fields,
mem_heap_t* heap)
{ {
dtuple_t* tuple; dtuple_t* tuple;
...@@ -5723,7 +5729,7 @@ dict_index_build_data_tuple( ...@@ -5723,7 +5729,7 @@ dict_index_build_data_tuple(
dict_index_copy_types(tuple, index, n_fields); dict_index_copy_types(tuple, index, n_fields);
rec_copy_prefix_to_dtuple(tuple, rec, index, true, n_fields, heap); rec_copy_prefix_to_dtuple(tuple, rec, index, leaf, n_fields, heap);
ut_ad(dtuple_check_typed(tuple)); ut_ad(dtuple_check_typed(tuple));
......
...@@ -1352,7 +1352,7 @@ rtr_cur_restore_position( ...@@ -1352,7 +1352,7 @@ rtr_cur_restore_position(
heap = mem_heap_create(256); heap = mem_heap_create(256);
tuple = dict_index_build_data_tuple(index, r_cursor->old_rec, tuple = dict_index_build_data_tuple(r_cursor->old_rec, index, !level,
r_cursor->old_n_fields, heap); r_cursor->old_n_fields, heap);
page_cursor = btr_pcur_get_page_cur(r_cursor); page_cursor = btr_pcur_get_page_cur(r_cursor);
......
...@@ -1460,17 +1460,31 @@ dict_index_copy_rec_order_prefix( ...@@ -1460,17 +1460,31 @@ dict_index_copy_rec_order_prefix(
copied prefix, or NULL */ copied prefix, or NULL */
ulint* buf_size)/*!< in/out: buffer size */ ulint* buf_size)/*!< in/out: buffer size */
MY_ATTRIBUTE((nonnull, warn_unused_result)); MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//** /** Convert a physical record into a search tuple.
Builds a typed data tuple out of a physical record. @param[in] rec index record (not necessarily in an index page)
@param[in] index index
@param[in] leaf whether rec is in a leaf page
@param[in] n_fields number of data fields
@param[in,out] heap memory heap for allocation
@return own: data tuple */ @return own: data tuple */
dtuple_t* dtuple_t*
dict_index_build_data_tuple( dict_index_build_data_tuple_func(
/*========================*/ const rec_t* rec,
dict_index_t* index, /*!< in: index */ const dict_index_t* index,
rec_t* rec, /*!< in: record for which to build data tuple */ #ifdef UNIV_DEBUG
ulint n_fields,/*!< in: number of data fields */ bool leaf,
mem_heap_t* heap) /*!< in: memory heap where tuple created */ #endif /* UNIV_DEBUG */
ulint n_fields,
mem_heap_t* heap)
MY_ATTRIBUTE((nonnull, warn_unused_result)); MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifdef UNIV_DEBUG
# define dict_index_build_data_tuple(rec, index, leaf, n_fields, heap) \
dict_index_build_data_tuple_func(rec, index, leaf, n_fields, heap)
#else /* UNIV_DEBUG */
# define dict_index_build_data_tuple(rec, index, leaf, n_fields, heap) \
dict_index_build_data_tuple_func(rec, index, n_fields, heap)
#endif /* UNIV_DEBUG */
/*********************************************************************//** /*********************************************************************//**
Gets the space id of the root of the index tree. Gets the space id of the root of the index tree.
@return space id */ @return space id */
......
...@@ -944,14 +944,23 @@ The fields are copied into the memory heap. ...@@ -944,14 +944,23 @@ The fields are copied into the memory heap.
@param[in] n_fields number of fields to copy @param[in] n_fields number of fields to copy
@param[in,out] heap memory heap */ @param[in,out] heap memory heap */
void void
rec_copy_prefix_to_dtuple( rec_copy_prefix_to_dtuple_func(
dtuple_t* tuple, dtuple_t* tuple,
const rec_t* rec, const rec_t* rec,
const dict_index_t* index, const dict_index_t* index,
#ifdef UNIV_DEBUG
bool is_leaf, bool is_leaf,
#endif /* UNIV_DEBUG */
ulint n_fields, ulint n_fields,
mem_heap_t* heap) mem_heap_t* heap)
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
# define rec_copy_prefix_to_dtuple(tuple,rec,index,leaf,n_fields,heap) \
rec_copy_prefix_to_dtuple_func(tuple,rec,index,leaf,n_fields,heap)
#else /* UNIV_DEBUG */
# define rec_copy_prefix_to_dtuple(tuple,rec,index,leaf,n_fields,heap) \
rec_copy_prefix_to_dtuple_func(tuple,rec,index,n_fields,heap)
#endif /* UNIV_DEBUG */
/***************************************************************//** /***************************************************************//**
Validates the consistency of a physical record. Validates the consistency of a physical record.
@return TRUE if ok */ @return TRUE if ok */
......
...@@ -589,7 +589,7 @@ rec_get_offsets_func( ...@@ -589,7 +589,7 @@ rec_get_offsets_func(
infimum and supremum record based on the heap number. */ infimum and supremum record based on the heap number. */
ut_d(const bool is_user_rec = rec_get_heap_no_old(rec) ut_d(const bool is_user_rec = rec_get_heap_no_old(rec)
>= PAGE_HEAP_NO_USER_LOW); >= PAGE_HEAP_NO_USER_LOW);
ut_ad(n <= index->n_fields + !leaf || index->is_dummy ut_ad(n <= ulint(index->n_fields + !leaf) || index->is_dummy
|| dict_index_is_ibuf(index)); || dict_index_is_ibuf(index));
/* The infimum and supremum records carry 1 field. */ /* The infimum and supremum records carry 1 field. */
ut_ad(is_user_rec || n == 1); ut_ad(is_user_rec || n == 1);
...@@ -1556,11 +1556,13 @@ The fields are copied into the memory heap. ...@@ -1556,11 +1556,13 @@ The fields are copied into the memory heap.
@param[in] n_fields number of fields to copy @param[in] n_fields number of fields to copy
@param[in,out] heap memory heap */ @param[in,out] heap memory heap */
void void
rec_copy_prefix_to_dtuple( rec_copy_prefix_to_dtuple_func(
dtuple_t* tuple, dtuple_t* tuple,
const rec_t* rec, const rec_t* rec,
const dict_index_t* index, const dict_index_t* index,
#ifdef UNIV_DEBUG
bool is_leaf, bool is_leaf,
#endif /* UNIV_DEBUG */
ulint n_fields, ulint n_fields,
mem_heap_t* heap) mem_heap_t* heap)
{ {
......
...@@ -3393,23 +3393,12 @@ row_sel_get_clust_rec_for_mysql( ...@@ -3393,23 +3393,12 @@ row_sel_get_clust_rec_for_mysql(
goto func_exit; goto func_exit;
} }
ulint page_no = page_get_page_no( buf_block_t* block = btr_pcur_get_block(
btr_pcur_get_page( prebuilt->pcur);
prebuilt->pcur));
page_id_t page_id(dict_index_get_space(sec_index),
page_no);
buf_block_t* block = buf_page_get_gen(
page_id,
dict_table_page_size(sec_index->table),
RW_NO_LATCH, NULL, BUF_GET,
__FILE__, __LINE__, mtr, &err);
mem_heap_t* heap = mem_heap_create(256); mem_heap_t* heap = mem_heap_create(256);
dtuple_t* tuple = dict_index_build_data_tuple( dtuple_t* tuple = dict_index_build_data_tuple(
sec_index, const_cast<rec_t*>(rec), rec, sec_index, true,
dict_index_get_n_fields(sec_index), heap);; sec_index->n_fields, heap);
page_cur_t page_cursor; page_cur_t page_cursor;
ulint low_match = page_cur_search( ulint low_match = page_cur_search(
......
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