Commit 7e0f40b3 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-12625 total_index_blocks is uninitialized in ALTER TABLE…ALGORITHM=INPLACE of small tables

Before MDEV-6812, it did not matter that merge_files[].offset was
uninitialized when no files were created.

This problem was introduced in MDEV-6812. There could be a user-visible
impact that the progress reports spit into the error log are bogus.

row_merge_build_indexes(): Initialize merge_files[i].offset.
parent a1b6128d
...@@ -4035,6 +4035,7 @@ row_merge_build_indexes( ...@@ -4035,6 +4035,7 @@ row_merge_build_indexes(
for (i = 0; i < n_indexes; i++) { for (i = 0; i < n_indexes; i++) {
merge_files[i].fd = -1; merge_files[i].fd = -1;
merge_files[i].offset = 0;
} }
total_static_cost = COST_BUILD_INDEX_STATIC * n_indexes + COST_READ_CLUSTERED_INDEX; total_static_cost = COST_BUILD_INDEX_STATIC * n_indexes + COST_READ_CLUSTERED_INDEX;
......
...@@ -4037,6 +4037,7 @@ row_merge_build_indexes( ...@@ -4037,6 +4037,7 @@ row_merge_build_indexes(
for (i = 0; i < n_indexes; i++) { for (i = 0; i < n_indexes; i++) {
merge_files[i].fd = -1; merge_files[i].fd = -1;
merge_files[i].offset = 0;
} }
total_static_cost = COST_BUILD_INDEX_STATIC * n_indexes + COST_READ_CLUSTERED_INDEX; total_static_cost = COST_BUILD_INDEX_STATIC * n_indexes + COST_READ_CLUSTERED_INDEX;
......
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