Incorporated changes in PR 634 to pdo_sqlsrv (#834)
* Incorporated changes in PR 634 to pdo_sqlsrv * Reverted the changes because the array is for internal use only
This commit is contained in:
parent
c209b7248f
commit
084ab72406
|
@ -1382,8 +1382,12 @@ int pdo_sqlsrv_dbh_quote( _Inout_ pdo_dbh_t* dbh, _In_reads_(unquoted_len) const
|
|||
// is prepared with emulate prepared on)
|
||||
if (is_statement) {
|
||||
pdo_stmt_t *stmt = Z_PDO_STMT_P(object);
|
||||
SQLSRV_ASSERT(stmt != NULL, "pdo_sqlsrv_dbh_quote: stmt object was null");
|
||||
// set the encoding to be the encoding of the statement otherwise set to be the encoding of the dbh
|
||||
|
||||
pdo_sqlsrv_stmt* driver_stmt = reinterpret_cast<pdo_sqlsrv_stmt*>(stmt->driver_data);
|
||||
SQLSRV_ASSERT(driver_stmt != NULL, "pdo_sqlsrv_dbh_quote: driver_data object was null");
|
||||
|
||||
if (driver_stmt->encoding() != SQLSRV_ENCODING_INVALID) {
|
||||
encoding = driver_stmt->encoding();
|
||||
}
|
||||
|
@ -1392,6 +1396,8 @@ int pdo_sqlsrv_dbh_quote( _Inout_ pdo_dbh_t* dbh, _In_reads_(unquoted_len) const
|
|||
encoding = driver_dbh->encoding();
|
||||
}
|
||||
// get the placeholder at the current position in driver_stmt->placeholders ht
|
||||
// Normally it's not a good idea to alter the internal pointer in a hashed array
|
||||
// (see pull request 634 on GitHub) but in this case this is for internal use only
|
||||
zval* placeholder = NULL;
|
||||
if ((placeholder = zend_hash_get_current_data(driver_stmt->placeholders)) != NULL && zend_hash_move_forward(driver_stmt->placeholders) == SUCCESS && stmt->bound_params != NULL) {
|
||||
pdo_bound_param_data* param = NULL;
|
||||
|
|
|
@ -562,6 +562,9 @@ int pdo_sqlsrv_stmt_execute( _Inout_ pdo_stmt_t *stmt TSRMLS_DC )
|
|||
// subtituted query provided by PDO
|
||||
if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
|
||||
// reset the placeholders hashtable internal in case the user reexecutes a statement
|
||||
// Normally it's not a good idea to alter the internal pointer in a hashed array
|
||||
// (see pull request 634 on GitHub) but in this case this is for internal use only
|
||||
|
||||
zend_hash_internal_pointer_reset(driver_stmt->placeholders);
|
||||
|
||||
query = stmt->active_query_string;
|
||||
|
|
Loading…
Reference in a new issue