Fix PDO::query() for drivers that emulate bound parameters.

This commit is contained in:
Wez Furlong 2005-02-11 01:20:59 +00:00
parent bb9ba8e36e
commit ccd242665b

View File

@ -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();
}