]> granicus.if.org Git - php/commitdiff
Boolify pdo_stmt_describe_columns()
authorGeorge Peter Banyard <girgias@php.net>
Fri, 12 Mar 2021 03:05:04 +0000 (03:05 +0000)
committerGeorge Peter Banyard <girgias@php.net>
Mon, 15 Mar 2021 14:48:33 +0000 (14:48 +0000)
ext/pdo/pdo_dbh.c
ext/pdo/pdo_stmt.c
ext/pdo/php_pdo_int.h

index 316c9e3f97414093d9b554308e3295cd9ae486c6..55dac17434083c4fed7f86abbe6c60d872789edc 100644 (file)
@@ -1084,7 +1084,7 @@ PHP_METHOD(PDO, query)
                        /* now execute the statement */
                        PDO_STMT_CLEAR_ERR();
                        if (stmt->methods->executer(stmt)) {
-                               int ret = 1;
+                               bool ret = true;
                                if (!stmt->executed) {
                                        if (stmt->dbh->alloc_own_columns) {
                                                ret = pdo_stmt_describe_columns(stmt);
index dbd2666226b1022b7034baa7546bcf69681b7fc9..c7d44028c2f3f815a3a6c0af980d7e5d77bca15c 100644 (file)
@@ -125,7 +125,7 @@ iterate:
 }
 /* }}} */
 
-int pdo_stmt_describe_columns(pdo_stmt_t *stmt) /* {{{ */
+bool pdo_stmt_describe_columns(pdo_stmt_t *stmt) /* {{{ */
 {
        int col;
 
@@ -133,7 +133,7 @@ int pdo_stmt_describe_columns(pdo_stmt_t *stmt) /* {{{ */
 
        for (col = 0; col < stmt->column_count; col++) {
                if (!stmt->methods->describer(stmt, col)) {
-                       return 0;
+                       return false;
                }
 
                /* if we are applying case conversions on column names, do so now */
@@ -168,7 +168,7 @@ int pdo_stmt_describe_columns(pdo_stmt_t *stmt) /* {{{ */
                }
 
        }
-       return 1;
+       return true;
 }
 /* }}} */
 
index 1e8dcccb9ed17a4c7ae29f85cb1e8eb65ddd75c4..4027721200d01fd39290bdd785c44b0ac1d968f6 100644 (file)
@@ -39,7 +39,7 @@ extern zend_class_entry *pdo_dbstmt_ce;
 void pdo_dbstmt_free_storage(zend_object *std);
 zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref);
 extern zend_object_handlers pdo_dbstmt_object_handlers;
-int pdo_stmt_describe_columns(pdo_stmt_t *stmt);
+bool pdo_stmt_describe_columns(pdo_stmt_t *stmt);
 bool pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode_arg_num,
        zval *args, uint32_t variadic_num_args);