Skip to content

Commit

Permalink
Fix #35552
Browse files Browse the repository at this point in the history
  • Loading branch information
wez committed Apr 30, 2006
1 parent fa94d91 commit aa5dbc8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2006, PHP 5.2.0
- Fixed bug #35552 (crash when pdo_odbc prepare fails). (Wez).

28 Apr 2006, PHP 5.1.3
- Updated bundled PCRE library to version 6.6. (Andrei)
Expand Down
14 changes: 11 additions & 3 deletions ext/pdo_odbc/odbc_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,21 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, p
efree(nsql);
}

stmt->driver_data = S;
stmt->methods = &odbc_stmt_methods;

if (rc != SQL_SUCCESS) {
pdo_odbc_stmt_error("SQLPrepare");
if (rc != SQL_SUCCESS_WITH_INFO) {
/* clone error information into the db handle */
strcpy(H->einfo.last_err_msg, S->einfo.last_err_msg);
H->einfo.file = S->einfo.file;
H->einfo.line = S->einfo.line;
H->einfo.what = S->einfo.what;
strcpy(dbh->error_code, stmt->error_code);
}
}

stmt->driver_data = S;
stmt->methods = &odbc_stmt_methods;

if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
return 0;
}
Expand Down

0 comments on commit aa5dbc8

Please sign in to comment.