Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/pdo_sqlsrv/pdo_dbh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ int pdo_sqlsrv_db_handle_factory( _Inout_ pdo_dbh_t *dbh, _In_opt_ zval *driver_
PDO_LOG_DBH_ENTRY;

hash_auto_ptr pdo_conn_options_ht;
pdo_error_mode prev_err_mode = dbh->error_mode;
pdo_error_mode prev_err_mode = static_cast<pdo_error_mode>( dbh->error_mode );

// must be done in all cases so that even a failed connection can query the
// object for errors.
Expand Down Expand Up @@ -1604,7 +1604,7 @@ zend_string * pdo_sqlsrv_dbh_last_id(_Inout_ pdo_dbh_t *dbh, _In_ const zend_str
PDO_LOG_DBH_ENTRY;

// turn off any error handling for last_id
pdo_error_mode prev_err_mode = dbh->error_mode;
pdo_error_mode prev_err_mode = static_cast<pdo_error_mode>( dbh->error_mode );
dbh->error_mode = PDO_ERRMODE_SILENT;

sqlsrv_malloc_auto_ptr<sqlsrv_stmt> driver_stmt;
Expand Down
7 changes: 6 additions & 1 deletion source/pdo_sqlsrv/php_pdo_sqlsrv_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,12 @@ inline void pdo_reset_dbh_error( _Inout_ pdo_dbh_t* dbh )
// release the last statement from the dbh so that error handling won't have a statement passed to it
if( dbh->query_stmt ) {
dbh->query_stmt = NULL;
zval_ptr_dtor( &dbh->query_stmt_zval );
#if PHP_VERSION_ID < 80500
zval_ptr_dtor( &dbh->query_stmt_zval );
#else
OBJ_RELEASE( dbh->query_stmt_obj );
dbh->query_stmt_obj = NULL;
#endif
}

// if the driver isn't valid, just return (PDO calls close sometimes more than once?)
Expand Down