[Commits] 4d0e521: MDEV-7770: Online DDL progress output contains incorrectly printed index names

Jan Lindström jan.lindstrom at mariadb.com
Fri Mar 13 09:38:40 EET 2015


revision-id: 4d0e52189ca945c94146035c2733d85c9c6fd18d
parent(s): bb3115b256113097bcfd0d80213e160339e4b00b
committer: Jan Lindström
branch nick: 10.1-innodb
timestamp: 2015-03-13 09:38:08 +0200
message:

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

Index names were not formatted correctly.

---
 storage/innobase/row/row0merge.cc | 17 +++++++++++++----
 storage/xtradb/row/row0merge.cc   | 17 +++++++++++++----
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 57be662..97746aa 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -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};
 
@@ -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],
@@ -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 +
@@ -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(
@@ -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);
 			}
 		}
 
diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc
index 19d4f96..61494be 100644
--- a/storage/xtradb/row/row0merge.cc
+++ b/storage/xtradb/row/row0merge.cc
@@ -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};
 
@@ -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],
@@ -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 +
@@ -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(
@@ -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);
 			}
 		}
 


More information about the commits mailing list