Skip to content

Commit 07e11dc

Browse files
committed
Fix #36632
1 parent aa5dbc8 commit 07e11dc

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2006, PHP 5.2.0
44
- Fixed bug #35552 (crash when pdo_odbc prepare fails). (Wez).
5+
- Fixed bug #36632 (bad error reporting for pdo_odbc exec UPDATE). (Wez).
56

67
28 Apr 2006, PHP 5.1.3
78
- Updated bundled PCRE library to version 6.6. (Andrei)

ext/pdo_odbc/odbc_driver.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,14 @@ static long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRML
234234

235235
rc = SQLExecDirect(stmt, (char *)sql, sql_len);
236236

237+
if (rc == SQL_NO_DATA) {
238+
/* If SQLExecDirect executes a searched update or delete statement that
239+
* does not affect any rows at the data source, the call to
240+
* SQLExecDirect returns SQL_NO_DATA. */
241+
row_count = 0;
242+
goto out;
243+
}
244+
237245
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
238246
pdo_odbc_doer_error("SQLExecDirect");
239247
goto out;

0 commit comments

Comments
 (0)