Commit c755d066 authored by osku's avatar osku

Fetch externally stored fields when using InnoDB's internal SQL parser.

parent 06f7b09f
...@@ -302,19 +302,45 @@ row_sel_fetch_columns( ...@@ -302,19 +302,45 @@ row_sel_fetch_columns(
} }
while (column) { while (column) {
mem_heap_t* heap = NULL;
ibool needs_copy;
field_no = column->field_nos[index_type]; field_no = column->field_nos[index_type];
if (field_no != ULINT_UNDEFINED) { if (field_no != ULINT_UNDEFINED) {
data = rec_get_nth_field(rec, offsets, field_no, &len); if (UNIV_UNLIKELY(rec_offs_nth_extern(offsets,
field_no))) {
/* Copy an externally stored field to the
temporary heap */
heap = mem_heap_create(1);
if (column->copy_val) { data = btr_rec_copy_externally_stored_field(
rec, offsets, field_no, &len, heap);
ut_a(len != UNIV_SQL_NULL);
needs_copy = TRUE;
} else {
data = rec_get_nth_field(rec, offsets,
field_no, &len);
needs_copy = column->copy_val;
}
if (needs_copy) {
eval_node_copy_and_alloc_val(column, data, eval_node_copy_and_alloc_val(column, data,
len); len);
} else { } else {
val = que_node_get_val(column); val = que_node_get_val(column);
dfield_set_data(val, data, len); dfield_set_data(val, data, len);
} }
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
} }
column = UT_LIST_GET_NEXT(col_var_list, column); column = UT_LIST_GET_NEXT(col_var_list, column);
......
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