PDO: Store/pass query_string as zend_string

Rather than storing char* + size_t, use a zend_string*. Also
avoid various copies of the query string.
This commit is contained in:
Nikita Popov 2020-12-11 17:13:38 +01:00
parent c288b5294b
commit 2d51c203f0
15 changed files with 81 additions and 102 deletions

View file

@ -317,7 +317,7 @@ static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt) /* {{{ */
PDO_DBG_RETURN(pdo_mysql_stmt_execute_prepared(stmt));
}
if (mysql_real_query(H->server, stmt->active_query_string, stmt->active_query_stringlen) != 0) {
if (mysql_real_query(H->server, ZSTR_VAL(stmt->active_query_string), ZSTR_LEN(stmt->active_query_string)) != 0) {
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
}