From 0e2af2cdd32bc2482483c09ac8dd9c0aa7549c15 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Tue, 1 Nov 2011 07:50:54 +0100 Subject: [PATCH] Bug#12406055 post-push fix: unused variable 'num_chars' in optimized build. Also fixed possibly uninitialized use of need_copy_table_res. --- client/sql_string.cc | 3 ++- sql/sql_table.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/sql_string.cc b/client/sql_string.cc index c7e235522e0..3fd9dccd784 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -188,7 +188,8 @@ end: #else #ifdef HAVE_SNPRINTF buff[sizeof(buff)-1]=0; // Safety - int num_chars= snprintf(buff, sizeof(buff)-1, "%.*f",(int) decimals, num); + IF_DBUG(int num_chars= ) + snprintf(buff, sizeof(buff)-1, "%.*f",(int) decimals, num); DBUG_ASSERT(num_chars > 0); DBUG_ASSERT(num_chars < (int) sizeof(buff)); #else diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 105b5e7a43c..b7feed5ab4c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6985,7 +6985,7 @@ view_err: need_copy_table= ALTER_TABLE_DATA_CHANGED; else { - enum_alter_table_change_level need_copy_table_res; + enum_alter_table_change_level need_copy_table_res=ALTER_TABLE_METADATA_ONLY; /* Check how much the tables differ. */ if (compare_tables(table, alter_info, create_info, order_num,