@@ -5243,27 +5243,26 @@ PHP_FUNCTION(pg_convert)
5243
5243
}
5244
5244
/* }}} */
5245
5245
5246
- static int do_exec (smart_str * querystr , ExecStatusType expect , PGconn * pg_link , zend_ulong opt ) /* {{{ */
5246
+ static bool do_exec (smart_str * querystr , ExecStatusType expect , PGconn * pg_link , zend_ulong opt ) /* {{{ */
5247
5247
{
5248
5248
if (opt & PGSQL_DML_ASYNC ) {
5249
5249
if (PQsendQuery (pg_link , ZSTR_VAL (querystr -> s ))) {
5250
- return 0 ;
5250
+ return true ;
5251
5251
}
5252
- }
5253
- else {
5252
+ } else {
5254
5253
PGresult * pg_result ;
5255
5254
5256
5255
pg_result = PQexec (pg_link , ZSTR_VAL (querystr -> s ));
5257
5256
if (PQresultStatus (pg_result ) == expect ) {
5258
5257
PQclear (pg_result );
5259
- return 0 ;
5258
+ return true ;
5260
5259
} else {
5261
5260
php_error_docref (NULL , E_WARNING , "%s" , PQresultErrorMessage (pg_result ));
5262
5261
PQclear (pg_result );
5263
5262
}
5264
5263
}
5265
5264
5266
- return -1 ;
5265
+ return false ;
5267
5266
}
5268
5267
/* }}} */
5269
5268
@@ -5392,7 +5391,7 @@ PHP_PGSQL_API zend_result php_pgsql_insert(PGconn *pg_link, const zend_string *t
5392
5391
smart_str_0 (& querystr );
5393
5392
5394
5393
if ((opt & (PGSQL_DML_EXEC |PGSQL_DML_ASYNC )) &&
5395
- do_exec (& querystr , PGRES_COMMAND_OK , pg_link , (opt & PGSQL_CONV_OPTS )) == 0 ) {
5394
+ do_exec (& querystr , PGRES_COMMAND_OK , pg_link , (opt & PGSQL_CONV_OPTS ))) {
5396
5395
ret = SUCCESS ;
5397
5396
}
5398
5397
else if (opt & PGSQL_DML_STRING ) {
@@ -5610,7 +5609,7 @@ PHP_PGSQL_API zend_result php_pgsql_update(PGconn *pg_link, const zend_string *t
5610
5609
smart_str_appendc (& querystr , ';' );
5611
5610
smart_str_0 (& querystr );
5612
5611
5613
- if ((opt & PGSQL_DML_EXEC ) && do_exec (& querystr , PGRES_COMMAND_OK , pg_link , opt ) == 0 ) {
5612
+ if ((opt & PGSQL_DML_EXEC ) && do_exec (& querystr , PGRES_COMMAND_OK , pg_link , opt )) {
5614
5613
ret = SUCCESS ;
5615
5614
} else if (opt & PGSQL_DML_STRING ) {
5616
5615
ret = SUCCESS ;
@@ -5706,7 +5705,7 @@ PHP_PGSQL_API zend_result php_pgsql_delete(PGconn *pg_link, const zend_string *t
5706
5705
smart_str_appendc (& querystr , ';' );
5707
5706
smart_str_0 (& querystr );
5708
5707
5709
- if ((opt & PGSQL_DML_EXEC ) && do_exec (& querystr , PGRES_COMMAND_OK , pg_link , opt ) == 0 ) {
5708
+ if ((opt & PGSQL_DML_EXEC ) && do_exec (& querystr , PGRES_COMMAND_OK , pg_link , opt )) {
5710
5709
ret = SUCCESS ;
5711
5710
} else if (opt & PGSQL_DML_STRING ) {
5712
5711
ret = SUCCESS ;
0 commit comments