@@ -5250,27 +5250,26 @@ PHP_FUNCTION(pg_convert)
5250
5250
}
5251
5251
/* }}} */
5252
5252
5253
- static int do_exec (smart_str * querystr , ExecStatusType expect , PGconn * pg_link , zend_ulong opt ) /* {{{ */
5253
+ static bool do_exec (smart_str * querystr , ExecStatusType expect , PGconn * pg_link , zend_ulong opt ) /* {{{ */
5254
5254
{
5255
5255
if (opt & PGSQL_DML_ASYNC ) {
5256
5256
if (PQsendQuery (pg_link , ZSTR_VAL (querystr -> s ))) {
5257
- return 0 ;
5257
+ return true ;
5258
5258
}
5259
- }
5260
- else {
5259
+ } else {
5261
5260
PGresult * pg_result ;
5262
5261
5263
5262
pg_result = PQexec (pg_link , ZSTR_VAL (querystr -> s ));
5264
5263
if (PQresultStatus (pg_result ) == expect ) {
5265
5264
PQclear (pg_result );
5266
- return 0 ;
5265
+ return true ;
5267
5266
} else {
5268
5267
php_error_docref (NULL , E_WARNING , "%s" , PQresultErrorMessage (pg_result ));
5269
5268
PQclear (pg_result );
5270
5269
}
5271
5270
}
5272
5271
5273
- return -1 ;
5272
+ return false ;
5274
5273
}
5275
5274
/* }}} */
5276
5275
@@ -5400,7 +5399,7 @@ PHP_PGSQL_API zend_result php_pgsql_insert(PGconn *pg_link, const char *table, z
5400
5399
smart_str_0 (& querystr );
5401
5400
5402
5401
if ((opt & (PGSQL_DML_EXEC |PGSQL_DML_ASYNC )) &&
5403
- do_exec (& querystr , PGRES_COMMAND_OK , pg_link , (opt & PGSQL_CONV_OPTS )) == 0 ) {
5402
+ do_exec (& querystr , PGRES_COMMAND_OK , pg_link , (opt & PGSQL_CONV_OPTS ))) {
5404
5403
ret = SUCCESS ;
5405
5404
}
5406
5405
else if (opt & PGSQL_DML_STRING ) {
@@ -5619,7 +5618,7 @@ PHP_PGSQL_API zend_result php_pgsql_update(PGconn *pg_link, const char *table, z
5619
5618
smart_str_appendc (& querystr , ';' );
5620
5619
smart_str_0 (& querystr );
5621
5620
5622
- if ((opt & PGSQL_DML_EXEC ) && do_exec (& querystr , PGRES_COMMAND_OK , pg_link , opt ) == 0 ) {
5621
+ if ((opt & PGSQL_DML_EXEC ) && do_exec (& querystr , PGRES_COMMAND_OK , pg_link , opt )) {
5623
5622
ret = SUCCESS ;
5624
5623
} else if (opt & PGSQL_DML_STRING ) {
5625
5624
ret = SUCCESS ;
@@ -5716,7 +5715,7 @@ PHP_PGSQL_API zend_result php_pgsql_delete(PGconn *pg_link, const char *table, z
5716
5715
smart_str_appendc (& querystr , ';' );
5717
5716
smart_str_0 (& querystr );
5718
5717
5719
- if ((opt & PGSQL_DML_EXEC ) && do_exec (& querystr , PGRES_COMMAND_OK , pg_link , opt ) == 0 ) {
5718
+ if ((opt & PGSQL_DML_EXEC ) && do_exec (& querystr , PGRES_COMMAND_OK , pg_link , opt )) {
5720
5719
ret = SUCCESS ;
5721
5720
} else if (opt & PGSQL_DML_STRING ) {
5722
5721
ret = SUCCESS ;
0 commit comments