Commit cd7583af authored by marko's avatar marko

branches/zip: Minor fixes

trx-undo_prev_version_build(): Pass offsets==NULL to
rec_set_field_extern_bits().

rec_set_field_extern_bits(), rec_set_field_extern_bits_new():
Accept offsets==NULL.

row_upd_rec_in_place(): Remove the bogus comment that the function
would only be invoked on a clustered index.  Remove the related
debug assertion.
parent 9d91b4bd
......@@ -470,7 +470,8 @@ rec_set_field_extern_bits(
/*======================*/
rec_t* rec, /* in: record */
dict_index_t* index, /* in: record descriptor */
ulint* offsets,/* in/out: rec_get_offsets(rec, index) */
ulint* offsets,/* in/out: rec_get_offsets(rec, index),
or NULL */
const ulint* vec, /* in: array of field numbers */
ulint n_fields);/* in: number of fields numbers */
/***************************************************************
......
......@@ -132,8 +132,7 @@ row_upd_changes_field_size_or_external(
upd_t* update);/* in: update vector */
/***************************************************************
Replaces the new column values stored in the update vector to the record
given. No field size changes are allowed. This function is used only for
a clustered index */
given. No field size changes are allowed. */
void
row_upd_rec_in_place(
......
......@@ -767,7 +767,8 @@ rec_set_field_extern_bits_new(
/*==========================*/
rec_t* rec, /* in: record */
dict_index_t* index, /* in: record descriptor */
ulint* offsets,/* in/out: rec_get_offsets(rec, index) */
ulint* offsets,/* in/out: rec_get_offsets(rec, index),
or NULL */
const ulint* ext, /* in: array of field numbers */
ulint n_ext) /* in: number of elements in ext */
{
......@@ -833,7 +834,10 @@ rec_set_field_extern_bits_new(
/* set the extern bit */
len |= 0x40;
lens[1] = (byte) len;
rec_offs_set_nth_extern(offsets, i);
if (offsets) {
rec_offs_set_nth_extern(
offsets, i);
}
}
lens--;
} else {
......@@ -855,13 +859,14 @@ rec_set_field_extern_bits(
/*======================*/
rec_t* rec, /* in: record */
dict_index_t* index, /* in: record descriptor */
ulint* offsets,/* in/out: rec_get_offsets(rec, index) */
ulint* offsets,/* in/out: rec_get_offsets(rec, index),
or NULL */
const ulint* vec, /* in: array of field numbers */
ulint n_fields)/* in: number of fields numbers */
{
ut_ad(rec_offs_validate(rec, index, offsets));
ut_ad(!offsets || rec_offs_validate(rec, index, offsets));
if (rec_offs_comp(offsets)) {
if (dict_table_is_comp(index->table)) {
rec_set_field_extern_bits_new(rec, index, offsets,
vec, n_fields);
} else {
......@@ -870,7 +875,9 @@ rec_set_field_extern_bits(
for (i = 0; i < n_fields; i++) {
rec_set_nth_field_extern_bit_old(rec, vec[i]);
rec_offs_set_nth_extern(offsets, vec[i]);
if (offsets) {
rec_offs_set_nth_extern(offsets, vec[i]);
}
}
}
}
......
......@@ -438,8 +438,7 @@ row_upd_changes_field_size_or_external(
/***************************************************************
Replaces the new column values stored in the update vector to the record
given. No field size changes are allowed. This function is used only for
a clustered index */
given. No field size changes are allowed. */
void
row_upd_rec_in_place(
......@@ -456,7 +455,6 @@ row_upd_rec_in_place(
ulint n_fields;
ulint i;
ut_ad(dict_index_is_clust(index));
ut_ad(rec_offs_validate(rec, index, offsets));
if (rec_offs_comp(offsets)) {
......
......@@ -1406,7 +1406,7 @@ trx_undo_prev_version_build(
*old_vers = rec_convert_dtuple_to_rec(buf, index, entry);
/* Now set the extern bits in the old version of the record */
rec_set_field_extern_bits(*old_vers, index, offsets,
rec_set_field_extern_bits(*old_vers, index, NULL,
ext_vect, n_ext_vect);
mem_free(ext_vect);
} else {
......
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