Bug #2291 mysql_stmt_affected_rows() does not return statement-local variable

Submitted: 5 Jan 2004 13:41 Modified: 5 Jan 2004 16:43
Reporter: Konstantin Osipov (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1, 5.0 OS:Any (all)
Assigned to: Assigned Account CPU Architecture:Any

[5 Jan 2004 13:41] Konstantin Osipov
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
[5 Jan 2004 16:43] Konstantin Osipov
See bug #2247

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.050 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.