diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-12-11 17:13:38 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-12-14 10:43:28 +0100 |
commit | 2d51c203f09551323ed595514e03ab206fd93129 (patch) | |
tree | 5069c1608f092ee57d312d28b1b9d4064abd0c62 /ext/pdo_firebird | |
parent | c288b5294bb0e13ad2904a3ec79265f727baaea3 (diff) | |
download | php-git-2d51c203f09551323ed595514e03ab206fd93129.tar.gz |
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.
Diffstat (limited to 'ext/pdo_firebird')
-rw-r--r-- | ext/pdo_firebird/firebird_driver.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index 390871cc20..0a6223454c 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -504,7 +504,7 @@ static int firebird_handle_closer(pdo_dbh_t *dbh) /* {{{ */ /* }}} */ /* called by PDO to prepare an SQL query */ -static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_len, /* {{{ */ +static int firebird_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, /* {{{ */ pdo_stmt_t *stmt, zval *driver_options) { pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; @@ -524,7 +524,7 @@ static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_ zend_hash_init(np, 8, NULL, NULL, 0); /* allocate and prepare statement */ - if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &num_sqlda, &s, np)) { + if (!firebird_alloc_prepare_stmt(dbh, ZSTR_VAL(sql), ZSTR_LEN(sql), &num_sqlda, &s, np)) { break; } |