Commit 24b34fa9 authored by kent@mysql.com's avatar kent@mysql.com

Merge

parents 0d739755 b076cdb2
...@@ -2729,6 +2729,8 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags) ...@@ -2729,6 +2729,8 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags)
if (!disable_result_log) if (!disable_result_log)
{ {
ulong affected_rows; /* Ok to be undef if 'disable_info' is set */
if (res) if (res)
{ {
MYSQL_FIELD *field= mysql_fetch_fields(res); MYSQL_FIELD *field= mysql_fetch_fields(res);
...@@ -2750,6 +2752,13 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags) ...@@ -2750,6 +2752,13 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags)
append_result(ds, res); 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. We can't do this if we are in Add all warnings to the result. We can't do this if we are in
the middle of processing results from multi-statement, because the middle of processing results from multi-statement, because
...@@ -2777,7 +2786,7 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags) ...@@ -2777,7 +2786,7 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags)
if (!disable_info) if (!disable_info)
{ {
char buf[40]; 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); dynstr_append(ds, buf);
if (mysql_info(mysql)) if (mysql_info(mysql))
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment