diff options
| author | Wez Furlong <wez@php.net> | 2006-04-30 00:52:28 +0000 |
|---|---|---|
| committer | Wez Furlong <wez@php.net> | 2006-04-30 00:52:28 +0000 |
| commit | aa5dbc8c9263b53b646980998e1d2eea03323f37 (patch) | |
| tree | 63df523987e803967eb862002e2be848b12b8280 /ext/pdo_odbc/odbc_driver.c | |
| parent | fa94d911dfefc77bbb174200001d58b297a10707 (diff) | |
| download | php-git-aa5dbc8c9263b53b646980998e1d2eea03323f37.tar.gz | |
Fix #35552
Diffstat (limited to 'ext/pdo_odbc/odbc_driver.c')
| -rwxr-xr-x | ext/pdo_odbc/odbc_driver.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index 08120720be..8309b23a5a 100755 --- a/ext/pdo_odbc/odbc_driver.c +++ b/ext/pdo_odbc/odbc_driver.c @@ -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; } |
