@@ -3879,7 +3879,12 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
3879
3879
switch (entry_type ) {
3880
3880
case PHP_PG_ASYNC_IS_BUSY :
3881
3881
PQconsumeInput (pgsql );
3882
- RETVAL_LONG (PQisBusy (pgsql ));
3882
+ /* PQisBusy
3883
+ * Returns 1 if a command is busy, that is, PQgetResult would block waiting for input.
3884
+ * A 0 return indicates that PQgetResult can be called with assurance of not blocking.
3885
+ * https://www.postgresql.org/docs/current/libpq-async.html#LIBPQ-PQISBUSY
3886
+ */
3887
+ RETVAL_BOOL (PQisBusy (pgsql ));
3883
3888
break ;
3884
3889
case PHP_PG_ASYNC_REQUEST_CANCEL : {
3885
3890
PGcancel * c ;
@@ -3893,7 +3898,8 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
3893
3898
* errbuf must be a char array of size errbufsize (the recommended size is 256 bytes).
3894
3899
* https://www.postgresql.org/docs/current/libpq-cancel.html#LIBPQ-PQCANCEL
3895
3900
*/
3896
- RETVAL_LONG ((rc = PQcancel (c , err , sizeof (err ))));
3901
+ rc = PQcancel (c , err , sizeof (err ));
3902
+ RETVAL_BOOL (rc );
3897
3903
if (rc == 0 ) {
3898
3904
zend_error (E_WARNING , "cannot cancel the query: %s" , err );
3899
3905
}
@@ -3908,7 +3914,6 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
3908
3914
if (PQsetnonblocking (pgsql , 0 )) {
3909
3915
php_error_docref (NULL , E_NOTICE , "Cannot set connection to blocking mode" );
3910
3916
}
3911
- convert_to_boolean (return_value );
3912
3917
}
3913
3918
/* }}} */
3914
3919
@@ -4929,8 +4934,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string *
4929
4934
break ; /* break out for() */
4930
4935
}
4931
4936
4932
- convert_to_boolean (is_enum );
4933
- if (Z_TYPE_P (is_enum ) == IS_TRUE ) {
4937
+ if (zval_is_true (is_enum )) {
4934
4938
/* enums need to be treated like strings */
4935
4939
data_type = PG_TEXT ;
4936
4940
} else {
0 commit comments