Skip to content

Commit

Permalink
MDEV-7770: Online DDL progress output contains incorrectly printed in…
Browse files Browse the repository at this point in the history
…dex names

Index names were not formatted correctly.
  • Loading branch information
Jan Lindström committed Mar 13, 2015
1 parent bb3115b commit 4d0e521
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
17 changes: 13 additions & 4 deletions storage/innobase/row/row0merge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3730,6 +3730,8 @@ row_merge_build_indexes(
DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n");
#endif
} else {
char buf[3 * NAME_LEN];
char *bufend;
row_merge_dup_t dup = {
sort_idx, table, col_map, 0};

Expand All @@ -3739,9 +3741,16 @@ row_merge_build_indexes(
(total_static_cost + total_dynamic_cost)
* 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"
" 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(
trx, &dup, &merge_files[i],
Expand All @@ -3751,7 +3760,7 @@ row_merge_build_indexes(

sql_print_information("InnoDB: Online DDL : End of "
" merge-sorting index %s (%lu / %lu)",
indexes[i]->name, (i+1), n_indexes);
buf, (i+1), n_indexes);

if (error == DB_SUCCESS) {
pct_cost = (COST_BUILD_INDEX_STATIC +
Expand All @@ -3762,7 +3771,7 @@ row_merge_build_indexes(

sql_print_information("InnoDB: Online DDL : Start "
"building index %s (%lu / %lu), estimated "
"cost : %2.4f", indexes[i]->name, (i+1),
"cost : %2.4f", buf, (i+1),
n_indexes, pct_cost);

error = row_merge_insert_index_tuples(
Expand All @@ -3773,7 +3782,7 @@ row_merge_build_indexes(

sql_print_information("InnoDB: Online DDL : "
"End of building index %s (%lu / %lu)",
indexes[i]->name, (i+1), n_indexes);
buf, (i+1), n_indexes);
}
}

Expand Down
17 changes: 13 additions & 4 deletions storage/xtradb/row/row0merge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3736,6 +3736,8 @@ row_merge_build_indexes(
DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n");
#endif
} else {
char buf[3 * NAME_LEN];
char *bufend;
row_merge_dup_t dup = {
sort_idx, table, col_map, 0};

Expand All @@ -3745,9 +3747,16 @@ row_merge_build_indexes(
(total_static_cost + total_dynamic_cost)
* 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"
" 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(
trx, &dup, &merge_files[i],
Expand All @@ -3757,7 +3766,7 @@ row_merge_build_indexes(

sql_print_information("InnoDB: Online DDL : End of "
" merge-sorting index %s (%lu / %lu)",
indexes[i]->name, (i+1), n_indexes);
buf, (i+1), n_indexes);

if (error == DB_SUCCESS) {
pct_cost = (COST_BUILD_INDEX_STATIC +
Expand All @@ -3768,7 +3777,7 @@ row_merge_build_indexes(

sql_print_information("InnoDB: Online DDL : Start "
"building index %s (%lu / %lu), estimated "
"cost : %2.4f", indexes[i]->name, (i+1),
"cost : %2.4f", buf, (i+1),
n_indexes, pct_cost);

error = row_merge_insert_index_tuples(
Expand All @@ -3779,7 +3788,7 @@ row_merge_build_indexes(

sql_print_information("InnoDB: Online DDL : "
"End of building index %s (%lu / %lu)",
indexes[i]->name, (i+1), n_indexes);
buf, (i+1), n_indexes);
}
}

Expand Down

0 comments on commit 4d0e521

Please sign in to comment.