diff options
author | George Peter Banyard <girgias@php.net> | 2020-12-24 01:16:29 +0100 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2021-01-06 10:20:57 +0000 |
commit | 60a61afd3c40f029c6bb679754d13f71d63e3283 (patch) | |
tree | cff2f0c32ff76bebc7cf735588c9fdf2efc29041 /ext/pdo_sqlite/sqlite_driver.c | |
parent | 53ba72ec03b05800de94c3e4f3f8c96aae70185d (diff) | |
download | php-git-60a61afd3c40f029c6bb679754d13f71d63e3283.tar.gz |
Boolify PDO's preparer handler
Diffstat (limited to 'ext/pdo_sqlite/sqlite_driver.c')
-rw-r--r-- | ext/pdo_sqlite/sqlite_driver.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index 8e1ea1d2b3..cb62816c3a 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -174,7 +174,7 @@ static void sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */ } /* }}} */ -static int sqlite_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options) +static bool sqlite_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options) { pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; pdo_sqlite_stmt *S = ecalloc(1, sizeof(pdo_sqlite_stmt)); @@ -189,17 +189,17 @@ static int sqlite_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t * if (PDO_CURSOR_FWDONLY != pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY)) { H->einfo.errcode = SQLITE_ERROR; pdo_sqlite_error(dbh); - return 0; + return false; } i = sqlite3_prepare_v2(H->db, ZSTR_VAL(sql), ZSTR_LEN(sql), &S->stmt, &tail); if (i == SQLITE_OK) { - return 1; + return true; } pdo_sqlite_error(dbh); - return 0; + return false; } static zend_long sqlite_handle_doer(pdo_dbh_t *dbh, const char *sql, size_t sql_len) |