| Bug #2247 | mysql_stmt_affected_rows returns affected rows from last command | ||
|---|---|---|---|
| Submitted: | 1 Jan 2004 7:35 | Modified: | 20 Feb 2004 3:15 |
| Reporter: | Georg Richter | ||
| Status: | Closed | ||
| Category: | Server | Severity: | S3 (Non-critical) |
| Version: | 4.1.2 | OS: | Any (any) |
| Assigned to: | Konstantin Osipov | Target Version: | |
[1 Jan 2004 7:35]
Georg Richter
[5 Jan 2004 16:47]
Dean Ellis
Verifying, though this sounds more like a matter that needs internal discussion.
[5 Jan 2004 17:43]
Konstantin Osipov
This is description of 2291 which is a copy of this bug:
Description: Implementation of mysql_stmt_affected_rows() is the following:
/*
Return total affected rows from the last statement
*/
my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt)
{
return stmt->mysql->last_used_con->affected_rows;
}
We should return statement-local variable here, otherwise that call is nothing
but usual mysql_affected_rows
How to repeat:
-
Suggested fix:
Add statement-local variable affected_rows and copy it from
mysql->last_used_conn->affected_rows in execute() function of libmysql.c
[20 Feb 2004 3:15]
Konstantin Osipov
Fixed in 4.1.2, bk commit - 4.1 tree (konstantin:1.1694)
