From 5379038af9f279b3ad15e74c7147608fd8f899ea Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 21 May 2010 17:25:40 +0200 Subject: [PATCH] mysql: don't crash when --show-warnings is enabled and the server suddenly goes away --- client/mysql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index bfaed00b49f..f7ef9a652fb 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -3588,7 +3588,7 @@ static void print_warnings() mysql_store_result_for_lazy(&result); /* Bail out when no warnings */ - if (!(num_rows= mysql_num_rows(result))) + if (!result || !(num_rows= mysql_num_rows(result))) goto end; cur= mysql_fetch_row(result);