@@ -746,18 +746,19 @@ static void php3_ifx_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
746
746
(void **) &index_ptr) == SUCCESS) {
747
747
int type,link;
748
748
void *ptr;
749
-
749
+ #ifdef THREAD_SAFE
750
+ if (index_ptr->type != _php3_le_index_ptr ()) {
751
+ #else
750
752
if (index_ptr->type != le_index_ptr) {
753
+ #endif
751
754
RETURN_FALSE;
752
755
}
753
756
link = (int ) index_ptr->ptr ;
754
757
ptr = php3_list_find (link,&type); /* check if the link is still there */
755
- if (ptr && (type==IFXG (le_link) ||
756
- type==IFXG (le_plink))) {
757
- return_value->value .lval =
758
- IFXG (default_link) =
759
- link;
760
- return_value->type = IS_LONG;
758
+ if (ptr && (type==IFXG (le_link) || type==IFXG (le_plink))) {
759
+ zend_list_addref (link);
760
+ return_value->value .lval = IFXG (default_link) = link;
761
+ return_value->type = IS_RESOURCE;
761
762
efree (hashed_details);
762
763
return ;
763
764
} else {
@@ -790,13 +791,16 @@ static void php3_ifx_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
790
791
}
791
792
792
793
/* add it to the list */
793
- return_value->value .lval =
794
- php3_list_insert (ifx,IFXG (le_link));
795
- return_value->type = IS_LONG;
794
+ return_value->value .lval = php3_list_insert (ifx,IFXG (le_link));
795
+ return_value->type = IS_RESOURCE;
796
796
797
797
/* add it to the hash */
798
798
new_index_ptr.ptr = (void *) return_value->value .lval ;
799
+ #ifdef THREAD_SAFE
800
+ new_index_ptr.type = _php3_le_index_ptr ();
801
+ #else
799
802
new_index_ptr.type = le_index_ptr;
803
+ #endif
800
804
if (_php3_hash_update (list,
801
805
hashed_details,
802
806
hashed_details_length+1 ,
@@ -1083,7 +1087,7 @@ EXEC SQL END DECLARE SECTION;
1083
1087
## NONSELECT-STATEMENT
1084
1088
##
1085
1089
*/
1086
- pval *pblobidarr, *tmp;
1090
+ pval *pblobidarr, ** tmp;
1087
1091
1088
1092
Ifx_Result->iscursory = 0 ;
1089
1093
@@ -1115,16 +1119,16 @@ EXEC SQL END DECLARE SECTION;
1115
1119
i=1 ;
1116
1120
while (_php3_hash_get_current_data (pblobidarr->value .ht ,
1117
1121
(void **) &tmp) == SUCCESS) {
1118
- convert_to_long (tmp);
1122
+ convert_to_long (* tmp);
1119
1123
if ((query_type == SQ_UPDATE) || (query_type == SQ_UPDALL)) {
1120
1124
EXEC SQL SET DESCRIPTOR :descrpid COUNT = :i;
1121
1125
}
1122
1126
/* TEXT/BYTE */
1123
- if (php3_intifx_getType ((int )tmp->value .lval ,list)==TYPE_BLTEXT || php3_intifx_getType ((int )tmp->value .lval ,list)==TYPE_BLBYTE) {
1124
- locator=php3_intifx_get_blobloc ((int )tmp->value .lval ,list);
1127
+ if (php3_intifx_getType ((int )(* tmp) ->value .lval ,list)==TYPE_BLTEXT || php3_intifx_getType ((int )(* tmp) ->value .lval ,list)==TYPE_BLBYTE) {
1128
+ locator=php3_intifx_get_blobloc ((int )((* tmp) ->value .lval ) ,list);
1125
1129
if (locator==NULL ) {
1126
1130
php3_error (E_WARNING," %d is not a Informix blob-result index" ,
1127
- (int )tmp->value .lval );
1131
+ (int )((* tmp) ->value .lval ) );
1128
1132
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
1129
1133
EXEC SQL free :statemid;
1130
1134
efree (Ifx_Result);
@@ -1139,8 +1143,8 @@ EXEC SQL END DECLARE SECTION;
1139
1143
}
1140
1144
1141
1145
/* CHAR */
1142
- if (php3_intifx_getType ((int )tmp->value .lval ,list)==TYPE_CHAR) {
1143
- len=php3_intifx_get_char ((int )tmp->value .lval ,list,&char_tmp);
1146
+ if (php3_intifx_getType ((int )(* tmp) ->value .lval ,list)==TYPE_CHAR) {
1147
+ len=php3_intifx_get_char ((int )((* tmp) ->value .lval ) ,list,&char_tmp);
1144
1148
indicator=0 ;
1145
1149
if (char_tmp==NULL || len<0 )
1146
1150
indicator=-1 ;
@@ -1485,7 +1489,7 @@ EXEC SQL END DECLARE SECTION;
1485
1489
## NONSELECT-STATEMENT
1486
1490
##
1487
1491
*/
1488
- pval *pblobidarr, *tmp;
1492
+ pval *pblobidarr, ** tmp;
1489
1493
1490
1494
Ifx_Result->iscursory = 0 ;
1491
1495
@@ -1517,16 +1521,16 @@ EXEC SQL END DECLARE SECTION;
1517
1521
i=1 ;
1518
1522
while (_php3_hash_get_current_data (pblobidarr->value .ht ,
1519
1523
(void **) &tmp) == SUCCESS) {
1520
- convert_to_long (tmp);
1524
+ convert_to_long (* tmp);
1521
1525
if ((query_type == SQ_UPDATE) || (query_type == SQ_UPDALL)) {
1522
1526
EXEC SQL SET DESCRIPTOR :descrpid COUNT = :i;
1523
1527
}
1524
1528
/* TEXT/BYTE */
1525
- if (php3_intifx_getType ((int )tmp->value .lval ,list)==TYPE_BLTEXT || php3_intifx_getType ((int )tmp->value .lval ,list)==TYPE_BLBYTE) {
1526
- locator=php3_intifx_get_blobloc ((int )tmp->value .lval ,list);
1529
+ if (php3_intifx_getType ((int )((* tmp) ->value .lval ) ,list)==TYPE_BLTEXT || php3_intifx_getType ((int )((* tmp) ->value .lval ) ,list)==TYPE_BLBYTE) {
1530
+ locator=php3_intifx_get_blobloc ((int )((* tmp) ->value .lval ) ,list);
1527
1531
if (locator==NULL ) {
1528
1532
php3_error (E_WARNING," %d is not a Informix blob-result index" ,
1529
- (int )tmp->value .lval );
1533
+ (int )((* tmp) ->value .lval ) );
1530
1534
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
1531
1535
EXEC SQL free :statemid;
1532
1536
efree (Ifx_Result);
@@ -1540,8 +1544,8 @@ EXEC SQL END DECLARE SECTION;
1540
1544
TYPE=:loc_t_type;
1541
1545
}
1542
1546
/* CHAR */
1543
- if (php3_intifx_getType ((int )tmp->value .lval ,list)==TYPE_CHAR) {
1544
- len=php3_intifx_get_char ((int )tmp->value .lval ,list,&char_tmp);
1547
+ if (php3_intifx_getType ((int )((* tmp) ->value .lval ) ,list)==TYPE_CHAR) {
1548
+ len=php3_intifx_get_char ((int )((* tmp) ->value .lval ) ,list,&char_tmp);
1545
1549
indicator=0 ;
1546
1550
if (char_tmp==NULL || len<0 )
1547
1551
indicator=-1 ;
0 commit comments