From dc0db7382cfe7f4855280fde2fc0e6f1f19ad6c8 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Fri, 25 Nov 2005 12:56:04 +0000 Subject: [PATCH] MFH: fix #35391 (pdo_mysql::exec does not return number of affected rows) --- NEWS | 2 ++ ext/pdo_mysql/mysql_driver.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 5026267767..85051322c6 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ PHP NEWS - Added an additional field $frame['object'] to the result array of debug_backtrace() that contains a reference to the respective object when the frame was called from an object. (Sebastian) +- Fixed bug #35391 (pdo_mysql::exec does not return number of affected rows). + (Tony) - Fixed bug #35360 (exceptions in interactive mode (php -a) may cause crash). (Dmitry) - Fixed bug #35358 (Incorrect error messages for PDO class constants). (Ilia) diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 0b5570e39c..295723056d 100755 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -244,7 +244,7 @@ static long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRM return -1; } else { my_ulonglong c = mysql_affected_rows(H->server); - if (c != (my_ulonglong) -1) { + if (c == (my_ulonglong) -1) { pdo_mysql_error(dbh); return (H->einfo.errcode ? -1 : 0); } else { -- 2.40.0