From 8f67221e18576db3f1d8165f53ef8b844a2cdaf6 Mon Sep 17 00:00:00 2001 From: v-kaywon Date: Mon, 3 Apr 2017 10:08:36 -0700 Subject: [PATCH] fix indentation --- source/pdo_sqlsrv/pdo_dbh.cpp | 18 +++++++++--------- source/pdo_sqlsrv/pdo_stmt.cpp | 22 +++++++++++----------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/source/pdo_sqlsrv/pdo_dbh.cpp b/source/pdo_sqlsrv/pdo_dbh.cpp index b3db945f..9c2b9342 100644 --- a/source/pdo_sqlsrv/pdo_dbh.cpp +++ b/source/pdo_sqlsrv/pdo_dbh.cpp @@ -695,20 +695,20 @@ zend_long pdo_sqlsrv_dbh_do( pdo_dbh_t *dbh, const char *sql, size_t sql_len TSR // since the user can give us a compound statement, we return the row count for the last set, and since the row count // isn't guaranteed to be valid until all the results have been fetched, we fetch them all first. - if ( execReturn ) { - if ( execReturn != SQL_NO_DATA && core_sqlsrv_has_any_result( driver_stmt TSRMLS_CC )) { + if ( execReturn ) { + if ( execReturn != SQL_NO_DATA && core_sqlsrv_has_any_result( driver_stmt TSRMLS_CC )) { - SQLRETURN r = SQL_SUCCESS; + SQLRETURN r = SQL_SUCCESS; - do { + do { - rows = core::SQLRowCount( driver_stmt TSRMLS_CC ); + rows = core::SQLRowCount( driver_stmt TSRMLS_CC ); - r = core::SQLMoreResults( driver_stmt TSRMLS_CC ); + r = core::SQLMoreResults( driver_stmt TSRMLS_CC ); - } while ( r != SQL_NO_DATA ); - } - } + } while ( r != SQL_NO_DATA ); + } + } // returning -1 forces PDO to return false, which signals an error occurred. SQLRowCount returns -1 for a number of cases // naturally, so we override that here with no rows returned. diff --git a/source/pdo_sqlsrv/pdo_stmt.cpp b/source/pdo_sqlsrv/pdo_stmt.cpp index dd508a33..9fe4b451 100644 --- a/source/pdo_sqlsrv/pdo_stmt.cpp +++ b/source/pdo_sqlsrv/pdo_stmt.cpp @@ -554,18 +554,18 @@ int pdo_sqlsrv_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) SQLRETURN execReturn = core_sqlsrv_execute( driver_stmt TSRMLS_CC, query, query_len ); - if ( execReturn ) { - if ( execReturn == SQL_NO_DATA ) { - stmt->column_count = 0; - stmt->row_count = 0; - } - else { - stmt->column_count = core::SQLNumResultCols( driver_stmt TSRMLS_CC ); + if ( execReturn ) { + if ( execReturn == SQL_NO_DATA ) { + stmt->column_count = 0; + stmt->row_count = 0; + } + else { + stmt->column_count = core::SQLNumResultCols( driver_stmt TSRMLS_CC ); - // return the row count regardless if there are any rows or not - stmt->row_count = core::SQLRowCount( driver_stmt TSRMLS_CC ); - } - } + // return the row count regardless if there are any rows or not + stmt->row_count = core::SQLRowCount( driver_stmt TSRMLS_CC ); + } + } // workaround for a bug in the PDO driver manager. It is fairly simple to crash the PDO driver manager with // the following sequence: