diff options
author | unknown <konstantin@oak.local> | 2004-02-06 16:03:09 +0300 |
---|---|---|
committer | unknown <konstantin@oak.local> | 2004-02-06 16:03:09 +0300 |
commit | 3aef1d2c4b962c52f7f5101f7834584b64331adc (patch) | |
tree | 17ba0d8b03e854ca695f50767080a37afbf279a6 /libmysql/libmysql.c | |
parent | 453a32e92720f4b3bb504d88c70433333190f174 (diff) | |
download | mariadb-git-3aef1d2c4b962c52f7f5101f7834584b64331adc.tar.gz |
Fix for bug #2247: "mysql_stmt_affected_rows returns affected rows from
last command"
include/mysql.h:
Fix for bug #2247:
added affected_rows variable to MYSQL_STMT
libmysql/libmysql.c:
Fix for bug #2247:
save mysql->affected_rows in stmt->affected_rows
after mysql_execute() and mysql_stmt_store_result().
tests/client_test.c:
Fix for bug #2247: test added
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r-- | libmysql/libmysql.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 977657f8998..16e96e17389 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -2018,6 +2018,7 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length) set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate); DBUG_RETURN(1); } + stmt->affected_rows= mysql->affected_rows; DBUG_RETURN(0); } @@ -2127,7 +2128,7 @@ ulong STDCALL mysql_param_count(MYSQL_STMT * stmt) my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt) { - return stmt->mysql->last_used_con->affected_rows; + return stmt->affected_rows; } @@ -3223,6 +3224,7 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) DBUG_RETURN(0); } mysql->affected_rows= result->row_count= result->data->rows; + stmt->affected_rows= result->row_count; result->data_cursor= result->data->data; result->fields= stmt->fields; result->field_count= stmt->field_count; |