@@ -695,7 +695,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
695
695
int flags , idx , old_arg_count = 0 ;
696
696
zend_class_entry * ce = NULL , * old_ce = NULL ;
697
697
zval old_ctor_args = {{0 }, {0 }, {0 }};
698
- int i = 0 ;
698
+ int column_index_to_fetch = 0 ;
699
699
zval * fetch_function_params = NULL ;
700
700
uint32_t fetch_function_param_num = 0 ;
701
701
@@ -785,7 +785,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
785
785
old_arg_count = stmt -> fetch .cls .fci .param_count ;
786
786
do_fetch_opt_finish (stmt , 0 );
787
787
788
- fetch_value (stmt , & val , i ++ , NULL );
788
+ fetch_value (stmt , & val , column_index_to_fetch ++ , NULL );
789
789
if (Z_TYPE (val ) != IS_NULL ) {
790
790
if (!try_convert_to_string (& val )) {
791
791
return 0 ;
@@ -865,15 +865,15 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
865
865
}
866
866
867
867
if (group_key ) {
868
- fetch_value (stmt , group_key , i , NULL );
868
+ fetch_value (stmt , group_key , column_index_to_fetch , NULL );
869
869
convert_to_string (group_key );
870
- i ++ ;
870
+ column_index_to_fetch ++ ;
871
871
}
872
872
873
- for (idx = 0 ; i < stmt -> column_count ; i ++ , idx ++ ) {
873
+ for (idx = 0 ; column_index_to_fetch < stmt -> column_count ; column_index_to_fetch ++ , idx ++ ) {
874
874
zval val ;
875
- fetch_value (stmt , & val , i , NULL );
876
- zend_string * column_name = stmt -> columns [i ].name ;
875
+ fetch_value (stmt , & val , column_index_to_fetch , NULL );
876
+ zend_string * column_name = stmt -> columns [column_index_to_fetch ].name ;
877
877
878
878
switch (how ) {
879
879
case PDO_FETCH_ASSOC :
@@ -883,7 +883,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
883
883
case PDO_FETCH_USE_DEFAULT :
884
884
case PDO_FETCH_BOTH :
885
885
zend_symtable_update (Z_ARRVAL_P (return_value ), column_name , & val );
886
- if (zend_hash_index_add (Z_ARRVAL_P (return_value ), i , & val ) != NULL ) {
886
+ if (zend_hash_index_add (Z_ARRVAL_P (return_value ), column_index_to_fetch , & val ) != NULL ) {
887
887
Z_TRY_ADDREF (val );
888
888
}
889
889
break ;
0 commit comments