Commit aea22cad authored by marko's avatar marko

branches/zip: row_scan_and_check_index(): Remove the compiler warning

that tmp_heap is possibly uninitialized.  This was introduced in r1990.
parent e7267909
...@@ -3959,7 +3959,6 @@ row_scan_and_check_index( ...@@ -3959,7 +3959,6 @@ row_scan_and_check_index(
ulint i; ulint i;
ulint cnt; ulint cnt;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
mem_heap_t* tmp_heap;
ulint n_ext; ulint n_ext;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets; ulint* offsets;
...@@ -4059,23 +4058,29 @@ row_scan_and_check_index( ...@@ -4059,23 +4058,29 @@ row_scan_and_check_index(
} }
} }
/* Empty the heap on each round. But preserve offsets[] {
for the row_rec_to_index_entry() call, by copying them mem_heap_t* tmp_heap = NULL;
into a separate memory heap when needed. */
if (offsets != offsets_) {
ulint size = rec_offs_get_n_alloc(offsets) * sizeof *offsets;
tmp_heap = mem_heap_create(size); /* Empty the heap on each round. But preserve offsets[]
offsets = mem_heap_dup(tmp_heap, offsets, size); for the row_rec_to_index_entry() call, by copying them
} into a separate memory heap when needed. */
if (UNIV_UNLIKELY(offsets != offsets_)) {
ulint size = rec_offs_get_n_alloc(offsets)
* sizeof *offsets;
tmp_heap = mem_heap_create(size);
offsets = mem_heap_dup(tmp_heap, offsets, size);
}
mem_heap_empty(heap); mem_heap_empty(heap);
prev_entry = row_rec_to_index_entry(ROW_COPY_DATA, rec, prev_entry = row_rec_to_index_entry(ROW_COPY_DATA, rec,
index, offsets, &n_ext, heap); index, offsets,
&n_ext, heap);
if (offsets != offsets_) { if (UNIV_LIKELY_NULL(tmp_heap)) {
mem_heap_free(tmp_heap); mem_heap_free(tmp_heap);
}
} }
ret = row_search_for_mysql(buf, PAGE_CUR_G, prebuilt, 0, ROW_SEL_NEXT); ret = row_search_for_mysql(buf, PAGE_CUR_G, prebuilt, 0, ROW_SEL_NEXT);
......
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