Commit 4d0e5218 authored by Jan Lindström's avatar Jan Lindström

MDEV-7770: Online DDL progress output contains incorrectly printed index names

Index names were not formatted correctly.
parent bb3115b2
...@@ -3730,6 +3730,8 @@ row_merge_build_indexes( ...@@ -3730,6 +3730,8 @@ row_merge_build_indexes(
DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n"); DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n");
#endif #endif
} else { } else {
char buf[3 * NAME_LEN];
char *bufend;
row_merge_dup_t dup = { row_merge_dup_t dup = {
sort_idx, table, col_map, 0}; sort_idx, table, col_map, 0};
...@@ -3739,9 +3741,16 @@ row_merge_build_indexes( ...@@ -3739,9 +3741,16 @@ row_merge_build_indexes(
(total_static_cost + total_dynamic_cost) (total_static_cost + total_dynamic_cost)
* PCT_COST_MERGESORT_INDEX * 100; * PCT_COST_MERGESORT_INDEX * 100;
bufend = innobase_convert_name(buf, sizeof buf,
indexes[i]->name, strlen(indexes[i]->name),
trx ? trx->mysql_thd : NULL,
FALSE);
buf[bufend - buf]='\0';
sql_print_information("InnoDB: Online DDL : Start merge-sorting" sql_print_information("InnoDB: Online DDL : Start merge-sorting"
" index %s (%lu / %lu), estimated cost : %2.4f", " index %s (%lu / %lu), estimated cost : %2.4f",
indexes[i]->name, (i+1), n_indexes, pct_cost); buf, (i+1), n_indexes, pct_cost);
error = row_merge_sort( error = row_merge_sort(
trx, &dup, &merge_files[i], trx, &dup, &merge_files[i],
...@@ -3751,7 +3760,7 @@ row_merge_build_indexes( ...@@ -3751,7 +3760,7 @@ row_merge_build_indexes(
sql_print_information("InnoDB: Online DDL : End of " sql_print_information("InnoDB: Online DDL : End of "
" merge-sorting index %s (%lu / %lu)", " merge-sorting index %s (%lu / %lu)",
indexes[i]->name, (i+1), n_indexes); buf, (i+1), n_indexes);
if (error == DB_SUCCESS) { if (error == DB_SUCCESS) {
pct_cost = (COST_BUILD_INDEX_STATIC + pct_cost = (COST_BUILD_INDEX_STATIC +
...@@ -3762,7 +3771,7 @@ row_merge_build_indexes( ...@@ -3762,7 +3771,7 @@ row_merge_build_indexes(
sql_print_information("InnoDB: Online DDL : Start " sql_print_information("InnoDB: Online DDL : Start "
"building index %s (%lu / %lu), estimated " "building index %s (%lu / %lu), estimated "
"cost : %2.4f", indexes[i]->name, (i+1), "cost : %2.4f", buf, (i+1),
n_indexes, pct_cost); n_indexes, pct_cost);
error = row_merge_insert_index_tuples( error = row_merge_insert_index_tuples(
...@@ -3773,7 +3782,7 @@ row_merge_build_indexes( ...@@ -3773,7 +3782,7 @@ row_merge_build_indexes(
sql_print_information("InnoDB: Online DDL : " sql_print_information("InnoDB: Online DDL : "
"End of building index %s (%lu / %lu)", "End of building index %s (%lu / %lu)",
indexes[i]->name, (i+1), n_indexes); buf, (i+1), n_indexes);
} }
} }
......
...@@ -3736,6 +3736,8 @@ row_merge_build_indexes( ...@@ -3736,6 +3736,8 @@ row_merge_build_indexes(
DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n"); DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n");
#endif #endif
} else { } else {
char buf[3 * NAME_LEN];
char *bufend;
row_merge_dup_t dup = { row_merge_dup_t dup = {
sort_idx, table, col_map, 0}; sort_idx, table, col_map, 0};
...@@ -3745,9 +3747,16 @@ row_merge_build_indexes( ...@@ -3745,9 +3747,16 @@ row_merge_build_indexes(
(total_static_cost + total_dynamic_cost) (total_static_cost + total_dynamic_cost)
* PCT_COST_MERGESORT_INDEX * 100; * PCT_COST_MERGESORT_INDEX * 100;
bufend = innobase_convert_name(buf, sizeof buf,
indexes[i]->name, strlen(indexes[i]->name),
trx ? trx->mysql_thd : NULL,
FALSE);
buf[bufend - buf]='\0';
sql_print_information("InnoDB: Online DDL : Start merge-sorting" sql_print_information("InnoDB: Online DDL : Start merge-sorting"
" index %s (%lu / %lu), estimated cost : %2.4f", " index %s (%lu / %lu), estimated cost : %2.4f",
indexes[i]->name, (i+1), n_indexes, pct_cost); buf, (i+1), n_indexes, pct_cost);
error = row_merge_sort( error = row_merge_sort(
trx, &dup, &merge_files[i], trx, &dup, &merge_files[i],
...@@ -3757,7 +3766,7 @@ row_merge_build_indexes( ...@@ -3757,7 +3766,7 @@ row_merge_build_indexes(
sql_print_information("InnoDB: Online DDL : End of " sql_print_information("InnoDB: Online DDL : End of "
" merge-sorting index %s (%lu / %lu)", " merge-sorting index %s (%lu / %lu)",
indexes[i]->name, (i+1), n_indexes); buf, (i+1), n_indexes);
if (error == DB_SUCCESS) { if (error == DB_SUCCESS) {
pct_cost = (COST_BUILD_INDEX_STATIC + pct_cost = (COST_BUILD_INDEX_STATIC +
...@@ -3768,7 +3777,7 @@ row_merge_build_indexes( ...@@ -3768,7 +3777,7 @@ row_merge_build_indexes(
sql_print_information("InnoDB: Online DDL : Start " sql_print_information("InnoDB: Online DDL : Start "
"building index %s (%lu / %lu), estimated " "building index %s (%lu / %lu), estimated "
"cost : %2.4f", indexes[i]->name, (i+1), "cost : %2.4f", buf, (i+1),
n_indexes, pct_cost); n_indexes, pct_cost);
error = row_merge_insert_index_tuples( error = row_merge_insert_index_tuples(
...@@ -3779,7 +3788,7 @@ row_merge_build_indexes( ...@@ -3779,7 +3788,7 @@ row_merge_build_indexes(
sql_print_information("InnoDB: Online DDL : " sql_print_information("InnoDB: Online DDL : "
"End of building index %s (%lu / %lu)", "End of building index %s (%lu / %lu)",
indexes[i]->name, (i+1), n_indexes); buf, (i+1), n_indexes);
} }
} }
......
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