@@ -222,7 +222,7 @@ static zend_long odbc_handle_doer(pdo_dbh_t *dbh, const zend_string *sql)
222
222
PDO_ODBC_HSTMT stmt ;
223
223
224
224
rc = SQLAllocHandle (SQL_HANDLE_STMT , H -> dbc , & stmt );
225
- if (rc != SQL_SUCCESS ) {
225
+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) {
226
226
pdo_odbc_drv_error ("SQLAllocHandle: STMT" );
227
227
return -1 ;
228
228
}
@@ -449,7 +449,12 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{
449
449
450
450
dbh -> driver_data = H ;
451
451
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
+
453
458
rc = SQLSetEnvAttr (H -> env , SQL_ATTR_ODBC_VERSION , (void * )SQL_OV_ODBC3 , 0 );
454
459
455
460
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) /* {{{
469
474
470
475
rc = SQLAllocHandle (SQL_HANDLE_DBC , H -> env , & H -> dbc );
471
476
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) {
472
- pdo_odbc_drv_error ("SQLAllocHandle ( DBC) " );
477
+ pdo_odbc_drv_error ("SQLAllocHandle: DBC" );
473
478
goto fail ;
474
479
}
475
480
0 commit comments