Skip to content

Commit f64dcb7

Browse files
committed
Reverted the changes because the array is for internal use only
1 parent c445b47 commit f64dcb7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

source/pdo_sqlsrv/pdo_dbh.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,10 +1396,10 @@ int pdo_sqlsrv_dbh_quote( _Inout_ pdo_dbh_t* dbh, _In_reads_(unquoted_len) const
13961396
encoding = driver_dbh->encoding();
13971397
}
13981398
// get the placeholder at the current position in driver_stmt->placeholders ht
1399-
// do not directly alter the internal pointer in the array (See pull request 634 on GitHub)
1400-
HashPosition pos;
1399+
// Normally it's not a good idea to alter the internal pointer in a hashed array
1400+
// (see pull request 634 on GitHub) but in this case this is for internal use only
14011401
zval* placeholder = NULL;
1402-
if ((placeholder = zend_hash_get_current_data_ex(driver_stmt->placeholders, &pos)) != NULL && zend_hash_move_forward_ex(driver_stmt->placeholders, &pos) == SUCCESS && stmt->bound_params != NULL) {
1402+
if ((placeholder = zend_hash_get_current_data(driver_stmt->placeholders)) != NULL && zend_hash_move_forward(driver_stmt->placeholders) == SUCCESS && stmt->bound_params != NULL) {
14031403
pdo_bound_param_data* param = NULL;
14041404
if (Z_TYPE_P(placeholder) == IS_STRING) {
14051405
param = reinterpret_cast<pdo_bound_param_data*>(zend_hash_find_ptr(stmt->bound_params, Z_STR_P(placeholder)));

source/pdo_sqlsrv/pdo_stmt.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,10 +562,10 @@ int pdo_sqlsrv_stmt_execute( _Inout_ pdo_stmt_t *stmt TSRMLS_DC )
562562
// subtituted query provided by PDO
563563
if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
564564
// reset the placeholders hashtable internal in case the user reexecutes a statement
565-
// do not directly alter the internal pointer in the array (See pull request 634 on GitHub)
566-
HashPosition pos;
565+
// Normally it's not a good idea to alter the internal pointer in a hashed array
566+
// (see pull request 634 on GitHub) but in this case this is for internal use only
567567

568-
zend_hash_internal_pointer_reset_ex(driver_stmt->placeholders, &pos);
568+
zend_hash_internal_pointer_reset(driver_stmt->placeholders);
569569

570570
query = stmt->active_query_string;
571571
query_len = static_cast<unsigned int>(stmt->active_query_stringlen);

0 commit comments

Comments
 (0)