diff --git a/sql/sql_show.cc b/sql/sql_show.cc index ba13dd1ff04..88a56d26e35 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -817,6 +817,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) DBUG_RETURN(1); } + buffer.length(0); if (store_create_info(thd, table, &buffer)) DBUG_RETURN(-1); @@ -830,9 +831,6 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) DBUG_RETURN(1); protocol->prepare_for_resend(); protocol->store(table->table_name, system_charset_info); - buffer.length(0); - if (store_create_info(thd, table, &buffer)) - DBUG_RETURN(-1); protocol->store(buffer.ptr(), buffer.length(), buffer.charset()); if (protocol->write()) DBUG_RETURN(1);