summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <kent@mysql.com>2005-05-16 01:08:42 +0200
committerunknown <kent@mysql.com>2005-05-16 01:08:42 +0200
commit94f3584bc7455b7ac48bac6e69d9179ff31e46d7 (patch)
tree1636e9a57d6e7c301ae01fb8c7f282b71e3899bd /client
parent8fd8d819d0ee7f048b6a40b6e96f0d5e23c0943f (diff)
downloadmariadb-git-94f3584bc7455b7ac48bac6e69d9179ff31e46d7.tar.gz
mysqltest.c:
To solve bug#8455, call mysql_affected_rows() earlier, before query to find warnings client/mysqltest.c: To solve bug#8455, call mysql_affected_rows() earlier, before query to find warnings
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 1f95f1eaeeb..e60d9ecd1c5 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -2597,6 +2597,8 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags)
if (!disable_result_log)
{
+ ulong affected_rows; /* Ok to be undef if 'disable_info' is set */
+
if (res)
{
MYSQL_FIELD *field= mysql_fetch_fields(res);
@@ -2619,6 +2621,13 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags)
append_result(ds, res);
}
+ /*
+ Need to call mysql_affected_rows() before the new
+ query to find the warnings
+ */
+ if (!disable_info)
+ affected_rows= (ulong)mysql_affected_rows(mysql);
+
/* Add all warnings to the result */
if (!disable_warnings && mysql_warning_count(mysql))
{
@@ -2641,7 +2650,7 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags)
if (!disable_info)
{
char buf[40];
- sprintf(buf,"affected rows: %lu\n",(ulong) mysql_affected_rows(mysql));
+ sprintf(buf,"affected rows: %lu\n", affected_rows);
dynstr_append(ds, buf);
if (mysql_info(mysql))
{