mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
Fix PDO::query() for drivers that emulate bound parameters.
This commit is contained in:
parent
bb9ba8e36e
commit
ccd242665b
@ -722,6 +722,8 @@ static PHP_METHOD(PDO, query)
|
||||
stmt->query_string = estrndup(statement, statement_len);
|
||||
stmt->query_stringlen = statement_len;
|
||||
stmt->default_fetch_type = PDO_FETCH_BOTH;
|
||||
stmt->active_query_string = stmt->query_stirng;
|
||||
stmt->active_query_stringlen = statement_len;
|
||||
|
||||
if (dbh->methods->preparer(dbh, statement, statement_len, stmt, driver_options TSRMLS_CC)) {
|
||||
/* prepared; create a statement object for PHP land to access it */
|
||||
@ -764,6 +766,7 @@ static PHP_METHOD(PDO, query)
|
||||
|
||||
/* TODO: kill the object handle for the stmt here */
|
||||
} else {
|
||||
efree(stmt->query_string);
|
||||
efree(stmt);
|
||||
PDO_HANDLE_DBH_ERR();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user