summaryrefslogtreecommitdiff
path: root/sql/sql_error.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r--sql/sql_error.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 3bda16202b9..293b695d199 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -239,6 +239,8 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
offset--;
continue;
}
+ if (limit-- == 0)
+ break;
protocol->prepare_for_resend();
protocol->store(warning_level_names[err->level],
warning_level_length[err->level], system_charset_info);
@@ -246,8 +248,6 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
protocol->store(err->msg, strlen(err->msg), system_charset_info);
if (protocol->write())
DBUG_RETURN(TRUE);
- if (!--limit)
- break;
}
send_eof(thd);
DBUG_RETURN(FALSE);