@@ -590,7 +590,7 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *typ
590
590
}
591
591
/* }}} */
592
592
593
- static int do_fetch_common (pdo_stmt_t * stmt , enum pdo_fetch_orientation ori , zend_long offset , int do_bind ) /* {{{ */
593
+ static int do_fetch_common (pdo_stmt_t * stmt , enum pdo_fetch_orientation ori , zend_long offset ) /* {{{ */
594
594
{
595
595
if (!stmt -> executed ) {
596
596
return 0 ;
@@ -613,7 +613,7 @@ static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zen
613
613
return 0 ;
614
614
}
615
615
616
- if (do_bind && stmt -> bound_columns ) {
616
+ if (stmt -> bound_columns ) {
617
617
/* update those bound column variables now */
618
618
struct pdo_bound_param_data * param ;
619
619
@@ -739,9 +739,9 @@ static void do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs) /* {{{ */
739
739
}
740
740
/* }}} */
741
741
742
- /* perform a fetch. If do_bind is true, update any bound columns.
742
+ /* perform a fetch.
743
743
* If return_value is not null, store values into it according to HOW. */
744
- static int do_fetch (pdo_stmt_t * stmt , int do_bind , zval * return_value , enum pdo_fetch_type how , enum pdo_fetch_orientation ori , zend_long offset , zval * return_all ) /* {{{ */
744
+ static int do_fetch (pdo_stmt_t * stmt , zval * return_value , enum pdo_fetch_type how , enum pdo_fetch_orientation ori , zend_long offset , zval * return_all ) /* {{{ */
745
745
{
746
746
int flags , idx , old_arg_count = 0 ;
747
747
zend_class_entry * ce = NULL , * old_ce = NULL ;
@@ -754,7 +754,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
754
754
flags = how & PDO_FETCH_FLAGS ;
755
755
how = how & ~PDO_FETCH_FLAGS ;
756
756
757
- if (!do_fetch_common (stmt , ori , offset , do_bind )) {
757
+ if (!do_fetch_common (stmt , ori , offset )) {
758
758
return 0 ;
759
759
}
760
760
@@ -1182,7 +1182,7 @@ PHP_METHOD(PDOStatement, fetch)
1182
1182
RETURN_FALSE ;
1183
1183
}
1184
1184
1185
- if (!do_fetch (stmt , TRUE, return_value , how , ori , off , 0 )) {
1185
+ if (!do_fetch (stmt , return_value , how , ori , off , 0 )) {
1186
1186
PDO_HANDLE_STMT_ERR ();
1187
1187
RETURN_FALSE ;
1188
1188
}
@@ -1232,7 +1232,7 @@ PHP_METHOD(PDOStatement, fetchObject)
1232
1232
stmt -> fetch .cls .ce = zend_standard_class_def ;
1233
1233
}
1234
1234
1235
- if (!do_fetch (stmt , TRUE, return_value , how , ori , off , 0 )) {
1235
+ if (!do_fetch (stmt , return_value , how , ori , off , 0 )) {
1236
1236
PDO_HANDLE_STMT_ERR ();
1237
1237
RETVAL_FALSE ;
1238
1238
}
@@ -1257,7 +1257,7 @@ PHP_METHOD(PDOStatement, fetchColumn)
1257
1257
PHP_STMT_GET_OBJ ;
1258
1258
PDO_STMT_CLEAR_ERR ();
1259
1259
1260
- if (!do_fetch_common (stmt , PDO_FETCH_ORI_NEXT , 0 , TRUE )) {
1260
+ if (!do_fetch_common (stmt , PDO_FETCH_ORI_NEXT , 0 )) {
1261
1261
PDO_HANDLE_STMT_ERR ();
1262
1262
RETURN_FALSE ;
1263
1263
}
@@ -1392,20 +1392,20 @@ PHP_METHOD(PDOStatement, fetchAll)
1392
1392
} else {
1393
1393
return_all = 0 ;
1394
1394
}
1395
- if (!do_fetch (stmt , 1 , & data , how | flags , PDO_FETCH_ORI_NEXT , 0 , return_all )) {
1395
+ if (!do_fetch (stmt , & data , how | flags , PDO_FETCH_ORI_NEXT , 0 , return_all )) {
1396
1396
error = 2 ;
1397
1397
}
1398
1398
}
1399
1399
if (!error ) {
1400
1400
if ((how & PDO_FETCH_GROUP )) {
1401
- while (do_fetch (stmt , 1 , & data , how | flags , PDO_FETCH_ORI_NEXT , 0 , return_all ));
1401
+ while (do_fetch (stmt , & data , how | flags , PDO_FETCH_ORI_NEXT , 0 , return_all ));
1402
1402
} else if (how == PDO_FETCH_KEY_PAIR || (how == PDO_FETCH_USE_DEFAULT && stmt -> default_fetch_type == PDO_FETCH_KEY_PAIR )) {
1403
- while (do_fetch (stmt , 1 , & data , how | flags , PDO_FETCH_ORI_NEXT , 0 , return_all ));
1403
+ while (do_fetch (stmt , & data , how | flags , PDO_FETCH_ORI_NEXT , 0 , return_all ));
1404
1404
} else {
1405
1405
array_init (return_value );
1406
1406
do {
1407
1407
zend_hash_next_index_insert_new (Z_ARRVAL_P (return_value ), & data );
1408
- } while (do_fetch (stmt , 1 , & data , how | flags , PDO_FETCH_ORI_NEXT , 0 , 0 ));
1408
+ } while (do_fetch (stmt , & data , how | flags , PDO_FETCH_ORI_NEXT , 0 , 0 ));
1409
1409
}
1410
1410
}
1411
1411
@@ -2225,7 +2225,7 @@ static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter)
2225
2225
zval_ptr_dtor (& I -> fetch_ahead );
2226
2226
}
2227
2227
2228
- if (!do_fetch (stmt , TRUE, & I -> fetch_ahead , PDO_FETCH_USE_DEFAULT ,
2228
+ if (!do_fetch (stmt , & I -> fetch_ahead , PDO_FETCH_USE_DEFAULT ,
2229
2229
PDO_FETCH_ORI_NEXT , 0 , 0 )) {
2230
2230
2231
2231
PDO_HANDLE_STMT_ERR ();
@@ -2265,7 +2265,7 @@ zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int
2265
2265
Z_ADDREF_P (object );
2266
2266
ZVAL_OBJ (& I -> iter .data , Z_OBJ_P (object ));
2267
2267
2268
- if (!do_fetch (stmt , 1 , & I -> fetch_ahead , PDO_FETCH_USE_DEFAULT ,
2268
+ if (!do_fetch (stmt , & I -> fetch_ahead , PDO_FETCH_USE_DEFAULT ,
2269
2269
PDO_FETCH_ORI_NEXT , 0 , 0 )) {
2270
2270
PDO_HANDLE_STMT_ERR ();
2271
2271
I -> key = (zend_ulong )- 1 ;
0 commit comments