summaryrefslogtreecommitdiff
path: root/sql/sql_error.cc
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-06-04 14:58:32 +0400
committerunknown <konstantin@mysql.com>2005-06-04 14:58:32 +0400
commitd6e0883b070cbb66a3dc94384816835964025aba (patch)
tree91657c41a2b675fcb61fa27bfbfa7e79aa8806f9 /sql/sql_error.cc
parenta681af904d4fc8e02042b93b9035855ea989a155 (diff)
downloadmariadb-git-d6e0883b070cbb66a3dc94384816835964025aba.tar.gz
Fix show warnings limit 0 and show warnings limit 0, 0.
Add test coverage for SHOW WARNINGS LIMIT a, b; mysql-test/r/warnings.result: Add test coverage for SHOW WARNINGS LIMIT a,b mysql-test/t/warnings.test: Add test coverage for SHOW WARNINGS LIMIT a,b sql/sql_error.cc: Fix show warnings limit 0 and show warnings limit 0, 0
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 d19e9fbdb09..a31e15d0745 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -203,6 +203,8 @@ my_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);
@@ -210,8 +212,6 @@ my_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(1);
- if (!--limit)
- break;
}
send_eof(thd);
DBUG_RETURN(0);