Commit c6f5ea28 authored by marko's avatar marko

branches/zip: btr_push_update_extern_fields(): Add parameter "index"

and use it for flagging externally stored columns in the data tuple.
The data tuple contains the same columns as the clustered index record,
but in a different order.  This error was introduced in r1591.

TODO: the assertion ut_ad(!dfield_is_ext()) may fail in
btr_cur_pessimistic_update().
parent 46b7cec1
......@@ -2150,7 +2150,8 @@ btr_cur_pessimistic_update(
ut_ad(!page_is_comp(page) || !rec_get_node_ptr_flag(rec));
offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, heap);
n_ext = btr_push_update_extern_fields(new_entry, offsets, update);
n_ext = btr_push_update_extern_fields(new_entry, index, offsets,
update);
if (page_zip_rec_needs_ext(rec_get_converted_size(index, new_entry,
n_ext),
......@@ -3525,10 +3526,13 @@ update. */
ulint
btr_push_update_extern_fields(
/*==========================*/
/* out: number of externally stored columns */
dtuple_t* tuple, /* in/out: data tuple */
const ulint* offsets,/* in: array returned by rec_get_offsets() */
const upd_t* update) /* in: update vector or NULL */
/* out: number of externally
stored columns */
dtuple_t* tuple, /* in/out: data tuple */
const dict_index_t* index, /* in: clustered index */
const ulint* offsets,/* in: array returned by
rec_get_offsets() */
const upd_t* update) /* in: update vector or NULL */
{
ulint n_pushed = 0;
ulint n;
......@@ -3536,7 +3540,7 @@ btr_push_update_extern_fields(
ut_ad(tuple);
ut_ad(offsets);
ut_ad(dtuple_get_n_fields(tuple) == rec_offs_n_fields(offsets));
ut_ad(dict_index_is_clust(index));
#ifdef UNIV_DEBUG
for (i = 0; i < dtuple_get_n_fields(tuple); i++) {
ut_ad(!dfield_is_ext(dtuple_get_nth_field(tuple, i)));
......@@ -3567,8 +3571,12 @@ btr_push_update_extern_fields(
for (i = 0; i < n; i++) {
if (rec_offs_nth_extern(offsets, i)) {
dfield_t* dfield
= dtuple_get_nth_field(tuple, i);
const dict_field_t* ifield
= dict_index_get_nth_field(index, i);
ulint col_no
= dict_col_get_no(dict_field_get_col(ifield));
dfield_t* dfield
= dtuple_get_nth_field(tuple, col_no);
/* Check it is not flagged already */
if (!dfield_is_ext(dfield)) {
......
......@@ -560,10 +560,13 @@ update. */
ulint
btr_push_update_extern_fields(
/*==========================*/
/* out: number of externally stored columns */
dtuple_t* tuple, /* in/out: data tuple */
const ulint* offsets,/* in: array returned by rec_get_offsets() */
const upd_t* update);/* in: update vector or NULL */
/* out: number of externally
stored columns */
dtuple_t* tuple, /* in/out: data tuple */
const dict_index_t* index, /* in: clustered index */
const ulint* offsets,/* in: array returned by
rec_get_offsets() */
const upd_t* update);/* in: update vector or NULL */
/*######################################################################*/
......
......@@ -1230,7 +1230,7 @@ row_upd_store_row(
&node->ext, node->heap);
if (UNIV_LIKELY_NULL(node->ext)) {
node->n_ext = btr_push_update_extern_fields(
node->row, offsets,
node->row, clust_index, offsets,
node->is_delete ? NULL : node->update);
} else {
node->n_ext = 0;
......
......@@ -1398,7 +1398,8 @@ trx_undo_prev_version_build(
entry = row_rec_to_index_entry(ROW_COPY_DATA, index, rec,
heap);
n_ext = btr_push_update_extern_fields(entry, offsets, update);
n_ext = btr_push_update_extern_fields(entry, index, offsets,
update);
row_upd_index_replace_new_col_vals(entry, index, update, heap);
buf = mem_heap_alloc(heap, rec_get_converted_size(index, entry,
......
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