summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-12-24 01:16:29 +0100
committerGeorge Peter Banyard <girgias@php.net>2021-01-06 10:20:57 +0000
commit60a61afd3c40f029c6bb679754d13f71d63e3283 (patch)
treecff2f0c32ff76bebc7cf735588c9fdf2efc29041 /ext/pdo_pgsql
parent53ba72ec03b05800de94c3e4f3f8c96aae70185d (diff)
downloadphp-git-60a61afd3c40f029c6bb679754d13f71d63e3283.tar.gz
Boolify PDO's preparer handler
Diffstat (limited to 'ext/pdo_pgsql')
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index 121bdc3409..53751b28c7 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -221,7 +221,7 @@ static void pgsql_handle_closer(pdo_dbh_t *dbh) /* {{{ */
}
/* }}} */
-static int pgsql_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options)
+static bool pgsql_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
pdo_pgsql_stmt *S = ecalloc(1, sizeof(pdo_pgsql_stmt));
@@ -272,7 +272,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *s
if (ret == -1) {
/* couldn't grok it */
strcpy(dbh->error_code, stmt->error_code);
- return 0;
+ return false;
} else if (ret == 1) {
/* query was re-written */
S->query = nsql;
@@ -286,7 +286,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *s
spprintf(&S->stmt_name, 0, "pdo_stmt_%08x", ++H->stmt_counter);
}
- return 1;
+ return true;
}
static zend_long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, size_t sql_len)