@@ -413,7 +413,7 @@ static void swoole_pgsql_coro_onTimeout(Timer *timer, TimerNode *tnode) {
413
413
PQfinish (pgsql);
414
414
}
415
415
416
- zend_update_property_string (swoole_postgresql_coro_ce, zobject, " error" , 5 , " ontimeout" );
416
+ zend_update_property_string (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( zobject) , " error" , 5 , " ontimeout" );
417
417
PHPCoroutine::resume_m (ctx, result);
418
418
zval_ptr_dtor (result);
419
419
}
@@ -442,7 +442,7 @@ static void connect_callback(pg_object *object, Reactor *reactor, Event *event)
442
442
case PGRES_POLLING_FAILED:
443
443
events = 0 ;
444
444
err_msg = PQerrorMessage (conn);
445
- zend_update_property_string (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" error" ), err_msg);
445
+ zend_update_property_string (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" error" ), err_msg);
446
446
break ;
447
447
default :
448
448
swWarn (" PQconnectPoll unexpected status" );
@@ -466,7 +466,7 @@ static void connect_callback(pg_object *object, Reactor *reactor, Event *event)
466
466
ZVAL_BOOL (&return_value, object->connected );
467
467
468
468
if (object->connected == 1 ) {
469
- zend_update_property_null (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" error" ));
469
+ zend_update_property_null (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" error" ));
470
470
}
471
471
PHPCoroutine::resume_m (context, &return_value);
472
472
}
@@ -555,8 +555,8 @@ static int meta_data_result_parse(pg_object *object) {
555
555
add_assoc_zval (&return_value, name, &elem);
556
556
}
557
557
FutureTask *context = php_swoole_postgresql_coro_get_context (object->object );
558
- zend_update_property_null (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" error" ));
559
- zend_update_property_null (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" resultDiag" ));
558
+ zend_update_property_null (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" error" ));
559
+ zend_update_property_null (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" resultDiag" ));
560
560
PHPCoroutine::resume_m (context, &return_value);
561
561
swoole_event_del (object->socket );
562
562
zval_ptr_dtor (&return_value);
@@ -620,7 +620,7 @@ static void set_error_diag(const pg_object *object, const PGresult *pgsql_result
620
620
}
621
621
}
622
622
623
- zend_update_property (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" resultDiag" ), &result_diag);
623
+ zend_update_property (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" resultDiag" ), &result_diag);
624
624
zval_dtor (&result_diag);
625
625
}
626
626
@@ -637,7 +637,7 @@ static int query_result_parse(pg_object *object) {
637
637
pgsql_result = PQgetResult (object->conn );
638
638
status = PQresultStatus (pgsql_result);
639
639
640
- zend_update_property_long (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" resultStatus" ), status);
640
+ zend_update_property_long (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" resultStatus" ), status);
641
641
642
642
switch (status)
643
643
{
@@ -650,7 +650,7 @@ static int query_result_parse(pg_object *object) {
650
650
PQclear (pgsql_result);
651
651
ZVAL_FALSE (&return_value);
652
652
swoole_event_del (object->socket );
653
- zend_update_property_string (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" error" ), err_msg);
653
+ zend_update_property_string (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" error" ), err_msg);
654
654
PHPCoroutine::resume_m (context, &return_value);
655
655
break ;
656
656
case PGRES_COMMAND_OK: /* successful command that did not return rows */
@@ -661,8 +661,8 @@ static int query_result_parse(pg_object *object) {
661
661
res = PQflush (object->conn );
662
662
swoole_event_del (object->socket );
663
663
ZVAL_RES (&return_value, zend_register_resource (pgsql_result, le_result));
664
- zend_update_property_null (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" error" ));
665
- zend_update_property_null (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" resultDiag" ));
664
+ zend_update_property_null (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" error" ));
665
+ zend_update_property_null (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" resultDiag" ));
666
666
PHPCoroutine::resume_m (context, &return_value);
667
667
if (error != 0 ) {
668
668
php_swoole_fatal_error (E_WARNING, " socket error. Error: %s [%d]" , strerror (error), error);
@@ -688,7 +688,7 @@ static int prepare_result_parse(pg_object *object) {
688
688
pgsql_result = PQgetResult (object->conn );
689
689
status = PQresultStatus (pgsql_result);
690
690
691
- zend_update_property_long (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" resultStatus" ), status);
691
+ zend_update_property_long (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" resultStatus" ), status);
692
692
693
693
switch (status)
694
694
{
@@ -701,7 +701,7 @@ static int prepare_result_parse(pg_object *object) {
701
701
PQclear (pgsql_result);
702
702
ZVAL_FALSE (&return_value);
703
703
swoole_event_del (object->socket );
704
- zend_update_property_string (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" error" ), err_msg);
704
+ zend_update_property_string (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" error" ), err_msg);
705
705
PHPCoroutine::resume_m (context, &return_value);
706
706
if (error != 0 ) {
707
707
php_swoole_fatal_error (E_WARNING, " socket error. Error: %s [%d]" , strerror (error), error);
@@ -713,8 +713,8 @@ static int prepare_result_parse(pg_object *object) {
713
713
PQclear (pgsql_result);
714
714
swoole_event_del (object->socket );
715
715
ZVAL_TRUE (&return_value);
716
- zend_update_property_null (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" error" ));
717
- zend_update_property_null (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" resultDiag" ));
716
+ zend_update_property_null (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" error" ));
717
+ zend_update_property_null (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" resultDiag" ));
718
718
PHPCoroutine::resume_m (context, &return_value);
719
719
if (error != 0 ) {
720
720
php_swoole_fatal_error (E_WARNING, " socket error. Error: %s [%d]" , strerror (error), error);
@@ -724,7 +724,7 @@ static int prepare_result_parse(pg_object *object) {
724
724
PQclear (pgsql_result);
725
725
swoole_event_del (object->socket );
726
726
ZVAL_FALSE (&return_value);
727
- zend_update_property_string (swoole_postgresql_coro_ce, object->object , ZEND_STRL (" error" ), " Bad result returned to prepare" );
727
+ zend_update_property_string (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( object->object ) , ZEND_STRL (" error" ), " Bad result returned to prepare" );
728
728
PHPCoroutine::resume_m (context, &return_value);
729
729
if (error != 0 ) {
730
730
php_swoole_fatal_error (E_WARNING, " socket error. Error: %s [%d]" , strerror (error), error);
@@ -757,7 +757,7 @@ static PHP_METHOD(swoole_postgresql_coro, query) {
757
757
int ret = PQsendQuery (pgsql, Z_STRVAL_P (query));
758
758
if (ret == 0 ) {
759
759
char *err_msg = PQerrorMessage (pgsql);
760
- zend_update_property_string (swoole_postgresql_coro_ce, ZEND_THIS, ZEND_STRL (" error" ), err_msg);
760
+ zend_update_property_string (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( ZEND_THIS) , ZEND_STRL (" error" ), err_msg);
761
761
RETURN_FALSE;
762
762
}
763
763
@@ -1300,7 +1300,6 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
1300
1300
fci.retval = &retval;
1301
1301
fci.params = NULL ;
1302
1302
fci.param_count = 0 ;
1303
- fci.no_separation = 1 ;
1304
1303
1305
1304
if (ctor_params && Z_TYPE_P (ctor_params) != IS_NULL) {
1306
1305
if (zend_fcall_info_args (&fci, ctor_params) == FAILURE) {
@@ -1395,7 +1394,7 @@ static int swoole_pgsql_coro_onError(swReactor *reactor, swEvent *event) {
1395
1394
ZVAL_FALSE (result);
1396
1395
1397
1396
FutureTask *context = php_swoole_postgresql_coro_get_context (zobject);
1398
- zend_update_property_string (swoole_postgresql_coro_ce, zobject, " error" , 5 , " onerror" );
1397
+ zend_update_property_string (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( zobject) , " error" , 5 , " onerror" );
1399
1398
PHPCoroutine::resume_m (context, result);
1400
1399
zval_ptr_dtor (result);
1401
1400
@@ -1460,8 +1459,8 @@ static PHP_METHOD(swoole_postgresql_coro, escape) {
1460
1459
size_t new_len = PQescapeStringConn (object->conn , result->val , str, l_str, &error);
1461
1460
1462
1461
if (new_len == 0 || error) {
1463
- zend_update_property_string (swoole_postgresql_coro_ce, ZEND_THIS, ZEND_STRL (" error" ), PQerrorMessage (pgsql));
1464
- zend_update_property_long (swoole_postgresql_coro_ce, ZEND_THIS, ZEND_STRL (" errCode" ), error);
1462
+ zend_update_property_string (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( ZEND_THIS) , ZEND_STRL (" error" ), PQerrorMessage (pgsql));
1463
+ zend_update_property_long (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( ZEND_THIS) , ZEND_STRL (" errCode" ), error);
1465
1464
zend_string_free (result);
1466
1465
RETURN_FALSE;
1467
1466
} else {
@@ -1485,7 +1484,7 @@ static PHP_METHOD(swoole_postgresql_coro, escapeLiteral) {
1485
1484
1486
1485
tmp = PQescapeLiteral (pgsql, str, l_str);
1487
1486
if (tmp == nullptr ) {
1488
- zend_update_property_string (swoole_postgresql_coro_ce, ZEND_THIS, ZEND_STRL (" error" ), PQerrorMessage (pgsql));
1487
+ zend_update_property_string (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( ZEND_THIS) , ZEND_STRL (" error" ), PQerrorMessage (pgsql));
1489
1488
1490
1489
RETURN_FALSE;
1491
1490
}
@@ -1508,7 +1507,7 @@ static PHP_METHOD(swoole_postgresql_coro, escapeIdentifier) {
1508
1507
1509
1508
tmp = PQescapeIdentifier (pgsql, str, l_str);
1510
1509
if (tmp == nullptr ) {
1511
- zend_update_property_string (swoole_postgresql_coro_ce, ZEND_THIS, ZEND_STRL (" error" ), PQerrorMessage (pgsql));
1510
+ zend_update_property_string (swoole_postgresql_coro_ce, SW_Z8_OBJ_P ( ZEND_THIS) , ZEND_STRL (" error" ), PQerrorMessage (pgsql));
1512
1511
1513
1512
RETURN_FALSE;
1514
1513
}
0 commit comments