summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql
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_mysql
parent53ba72ec03b05800de94c3e4f3f8c96aae70185d (diff)
downloadphp-git-60a61afd3c40f029c6bb679754d13f71d63e3283.tar.gz
Boolify PDO's preparer handler
Diffstat (limited to 'ext/pdo_mysql')
-rw-r--r--ext/pdo_mysql/mysql_driver.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index 3d3f9b2b8d..1cc48e9010 100644
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -161,7 +161,7 @@ static void mysql_handle_closer(pdo_dbh_t *dbh)
/* }}} */
/* {{{ mysql_handle_preparer */
-static int mysql_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options)
+static bool mysql_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
pdo_mysql_stmt *S = ecalloc(1, sizeof(pdo_mysql_stmt));
@@ -194,7 +194,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *s
} else if (ret == -1) {
/* failed to parse */
strcpy(dbh->error_code, stmt->error_code);
- PDO_DBG_RETURN(0);
+ PDO_DBG_RETURN(false);
}
if (!(S->stmt = mysql_stmt_init(H->server))) {
@@ -202,7 +202,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *s
if (nsql) {
zend_string_release(nsql);
}
- PDO_DBG_RETURN(0);
+ PDO_DBG_RETURN(false);
}
if (mysql_stmt_prepare(S->stmt, ZSTR_VAL(sql), ZSTR_LEN(sql))) {
@@ -217,7 +217,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *s
goto fallback;
}
pdo_mysql_error(dbh);
- PDO_DBG_RETURN(0);
+ PDO_DBG_RETURN(false);
}
if (nsql) {
zend_string_release(nsql);
@@ -238,13 +238,13 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *s
S->max_length = pdo_attr_lval(driver_options, PDO_ATTR_MAX_COLUMN_LEN, 0);
- PDO_DBG_RETURN(1);
+ PDO_DBG_RETURN(true);
fallback:
end:
stmt->supports_placeholders = PDO_PLACEHOLDER_NONE;
- PDO_DBG_RETURN(1);
+ PDO_DBG_RETURN(true);
}
/* }}} */