diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-03-12 17:04:02 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-03-12 17:04:02 +0100 |
commit | e31342ef843f98523722b2d37ea23190bf2781af (patch) | |
tree | 90012a557646b3a69617c1579b4ef0c4463269b4 /ext/pdo_sqlite/sqlite_driver.c | |
parent | 22e6b5ef220345bb187c93a293ee436a80f897d1 (diff) | |
parent | fbf0e0587f8455525466e6d4ab2c1f0fc24bfe26 (diff) | |
download | php-git-e31342ef843f98523722b2d37ea23190bf2781af.tar.gz |
Merge branch 'PHP-7.1'
Diffstat (limited to 'ext/pdo_sqlite/sqlite_driver.c')
-rw-r--r-- | ext/pdo_sqlite/sqlite_driver.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index c5fd54cfb4..1e3e071fef 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -505,7 +505,7 @@ static int php_sqlite3_collation_callback(void *context, return ret; } -/* {{{ bool SQLite::sqliteCreateFunction(string name, mixed callback [, int argcount]) +/* {{{ bool SQLite::sqliteCreateFunction(string name, mixed callback [, int argcount, int flags]) Registers a UDF with the sqlite db handle */ static PHP_METHOD(SQLite, sqliteCreateFunction) { @@ -514,16 +514,18 @@ static PHP_METHOD(SQLite, sqliteCreateFunction) char *func_name; size_t func_name_len; zend_long argc = -1; + zend_long flags = 0; zend_string *cbname = NULL; pdo_dbh_t *dbh; pdo_sqlite_db_handle *H; int ret; - ZEND_PARSE_PARAMETERS_START(2, 3) + ZEND_PARSE_PARAMETERS_START(2, 4) Z_PARAM_STRING(func_name, func_name_len) Z_PARAM_ZVAL_DEREF(callback) Z_PARAM_OPTIONAL Z_PARAM_LONG(argc) + Z_PARAM_LONG(flags) ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); dbh = Z_PDO_DBH_P(getThis()); @@ -540,7 +542,7 @@ static PHP_METHOD(SQLite, sqliteCreateFunction) func = (struct pdo_sqlite_func*)ecalloc(1, sizeof(*func)); - ret = sqlite3_create_function(H->db, func_name, argc, SQLITE_UTF8, + ret = sqlite3_create_function(H->db, func_name, argc, flags | SQLITE_UTF8, func, php_sqlite3_func_callback, NULL, NULL); if (ret == SQLITE_OK) { func->funcname = estrdup(func_name); |