@@ -222,7 +222,7 @@ static zend_long odbc_handle_doer(pdo_dbh_t *dbh, const zend_string *sql)
222222 PDO_ODBC_HSTMT stmt ;
223223
224224 rc = SQLAllocHandle (SQL_HANDLE_STMT , H -> dbc , & stmt );
225- if (rc != SQL_SUCCESS ) {
225+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) {
226226 pdo_odbc_drv_error ("SQLAllocHandle: STMT" );
227227 return -1 ;
228228 }
@@ -449,7 +449,12 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{
449449
450450 dbh -> driver_data = H ;
451451
452- SQLAllocHandle (SQL_HANDLE_ENV , SQL_NULL_HANDLE , & H -> env );
452+ rc = SQLAllocHandle (SQL_HANDLE_ENV , SQL_NULL_HANDLE , & H -> env );
453+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) {
454+ pdo_odbc_drv_error ("SQLAllocHandle: ENV" );
455+ goto fail ;
456+ }
457+
453458 rc = SQLSetEnvAttr (H -> env , SQL_ATTR_ODBC_VERSION , (void * )SQL_OV_ODBC3 , 0 );
454459
455460 if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) {
@@ -469,7 +474,7 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{
469474
470475 rc = SQLAllocHandle (SQL_HANDLE_DBC , H -> env , & H -> dbc );
471476 if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) {
472- pdo_odbc_drv_error ("SQLAllocHandle ( DBC) " );
477+ pdo_odbc_drv_error ("SQLAllocHandle: DBC" );
473478 goto fail ;
474479 }
475480
0 commit comments