diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 3ca09cb68ea..181904edc1a 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1361,7 +1361,7 @@ mysql_stat(MYSQL *mysql) { DBUG_ENTER("mysql_stat"); if (simple_command(mysql,COM_STATISTICS,0,0,0)) - return mysql->net.last_error; + DBUG_RETURN(mysql->net.last_error); DBUG_RETURN((*mysql->methods->read_statistics)(mysql)); } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 4091164005c..9fe09d9f03c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -261,7 +261,9 @@ THD::THD() #endif client_capabilities= 0; // minimalistic client net.last_error[0]=0; // If error on boot +#ifdef HAVE_QUERY_CACHE query_cache_init_query(&net); // If error on boot +#endif ull=0; system_thread= NON_SYSTEM_THREAD; cleanup_done= abort_on_warning= no_warnings_for_error= 0;