Commit 7340e52d authored by osku's avatar osku

Port parts of r297 from branches/fts:

row_upd_index_replace_new_col_vals_index_pos(): Add a parameter, "ibool
order_only", for limiting the replacement to the ordering fields of the
index. Adjust callers.

 In this port, the comment for the parameter was adjusted to make it clear
 that it only supports clustered indexes.
parent 3c1b6a21
......@@ -1606,7 +1606,7 @@ btr_cur_optimistic_update(
new_entry = row_rec_to_index_entry(ROW_COPY_DATA, index, rec, heap);
row_upd_index_replace_new_col_vals_index_pos(new_entry, index, update,
NULL);
FALSE, NULL);
old_rec_size = rec_offs_size(offsets);
new_rec_size = rec_get_converted_size(index, new_entry);
......@@ -1846,7 +1846,7 @@ btr_cur_pessimistic_update(
new_entry = row_rec_to_index_entry(ROW_COPY_DATA, index, rec, heap);
row_upd_index_replace_new_col_vals_index_pos(new_entry, index, update,
heap);
FALSE, heap);
if (!(flags & BTR_KEEP_SYS_FLAG)) {
row_upd_index_entry_sys_field(new_entry, index, DATA_ROLL_PTR,
roll_ptr);
......
......@@ -185,6 +185,10 @@ row_upd_index_replace_new_col_vals_index_pos(
upd_t* update, /* in: an update vector built for the index so
that the field number in an upd_field is the
index position */
ibool order_only,
/* in: if TRUE, limit the replacement to
ordering fields of index; note that this
does not work for non-clustered indexes. */
mem_heap_t* heap); /* in: memory heap to which we allocate and
copy the new values, set this as NULL if you
do not want allocation */
......
......@@ -869,6 +869,10 @@ row_upd_index_replace_new_col_vals_index_pos(
upd_t* update, /* in: an update vector built for the index so
that the field number in an upd_field is the
index position */
ibool order_only,
/* in: if TRUE, limit the replacement to
ordering fields of index; note that this
does not work for non-clustered indexes. */
mem_heap_t* heap) /* in: memory heap to which we allocate and
copy the new values, set this as NULL if you
do not want allocation */
......@@ -879,13 +883,20 @@ row_upd_index_replace_new_col_vals_index_pos(
dfield_t* new_val;
ulint j;
ulint i;
ulint n_fields;
dtype_t* cur_type;
ut_ad(index);
dtuple_set_info_bits(entry, update->info_bits);
for (j = 0; j < dict_index_get_n_fields(index); j++) {
if (order_only) {
n_fields = dict_index_get_n_unique(index);
} else {
n_fields = dict_index_get_n_fields(index);
}
for (j = 0; j < n_fields; j++) {
field = dict_index_get_nth_field(index, j);
......
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