summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2010-05-21 17:25:40 +0200
committerSergei Golubchik <sergii@pisem.net>2010-05-21 17:25:40 +0200
commit5379038af9f279b3ad15e74c7147608fd8f899ea (patch)
tree2cc2a631d5ebaeb9a91a0a3bf9a0b01cde06fde5 /client
parent38b3218c4d372f6b0c5de7e4c81c824a1f308e55 (diff)
downloadmariadb-git-5379038af9f279b3ad15e74c7147608fd8f899ea.tar.gz
mysql: don't crash when --show-warnings is enabled
and the server suddenly goes away
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc2
1 files changed, 1 insertions, 1 deletions
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);