]> granicus.if.org Git - php/commitdiff
Fix #36632
authorWez Furlong <wez@php.net>
Sun, 30 Apr 2006 01:27:33 +0000 (01:27 +0000)
committerWez Furlong <wez@php.net>
Sun, 30 Apr 2006 01:27:33 +0000 (01:27 +0000)
NEWS
ext/pdo_odbc/odbc_driver.c

diff --git a/NEWS b/NEWS
index 353e1d5985e751a326498b0414f03c2d1835c0a1..44250a0a78bfb0fa802ff7cf39b68cb9a323d8d2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2006, PHP 5.2.0
 - Fixed bug #35552 (crash when pdo_odbc prepare fails). (Wez).
+- Fixed bug #36632 (bad error reporting for pdo_odbc exec UPDATE). (Wez).
 
 28 Apr 2006, PHP 5.1.3
 - Updated bundled PCRE library to version 6.6. (Andrei)
index 8309b23a5abc14e02601275c64f3182c4c41eb4a..5585cecf381f681ce8488d6621073f3ed0d98322 100755 (executable)
@@ -234,6 +234,14 @@ static long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRML
 
        rc = SQLExecDirect(stmt, (char *)sql, sql_len);
 
+       if (rc == SQL_NO_DATA) {
+               /* If SQLExecDirect executes a searched update or delete statement that
+                * does not affect any rows at the data source, the call to
+                * SQLExecDirect returns SQL_NO_DATA. */
+               row_count = 0;
+               goto out;
+       }
+
        if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
                pdo_odbc_doer_error("SQLExecDirect");
                goto out;