Minor fixes

This commit is contained in:
David Puglielli 2019-04-11 12:33:39 -07:00
parent e2a6ece527
commit 847493bdff
3 changed files with 8 additions and 8 deletions

View file

@ -600,10 +600,10 @@ int pdo_sqlsrv_stmt_execute( _Inout_ pdo_stmt_t *stmt TSRMLS_DC )
else {
if (driver_stmt->columns_rows_obtained == false)
{
stmt->column_count = core::SQLNumResultCols( driver_stmt TSRMLS_CC );
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 );
driver_stmt->column_count = stmt->column_count;
driver_stmt->row_count = stmt->row_count;
@ -709,7 +709,7 @@ int pdo_sqlsrv_stmt_fetch( _Inout_ pdo_stmt_t *stmt, _In_ enum pdo_fetch_orienta
// support for the PDO rowCount method. Since rowCount doesn't call a method, PDO relies on us to fill the
// pdo_stmt_t::row_count member
if( driver_stmt->past_fetch_end) {// || driver_stmt->cursor_type != SQL_CURSOR_FORWARD_ONLY ) {
if( driver_stmt->past_fetch_end) {
stmt->row_count = core::SQLRowCount( driver_stmt TSRMLS_CC );

View file

@ -1439,9 +1439,9 @@ struct sqlsrv_stmt : public sqlsrv_context {
bool fetch_called; // Used by core_sqlsrv_get_field to return an informative error if fetch not yet called
int last_field_index; // last field retrieved by core_sqlsrv_get_field
bool past_next_result_end; // core_sqlsrv_next_result sets this to true when the statement goes beyond the last results
bool columns_rows_obtained; // Whether or not SQLNumResultCols and SQLRowCount have been called for the active result set
int column_count; // Number of columns in the current result set obtained from SQLNumResultCols
int row_count; // Number of rows in the current result set obtained from SQLRowCount
bool columns_rows_obtained; // Whether or not SQLNumResultCols and SQLRowCount have been called for the active result
short column_count; // Number of columns in the current result set obtained from SQLNumResultCols
long row_count; // Number of rows in the current result set obtained from SQLRowCount
unsigned long query_timeout; // maximum allowed statement execution time
zend_long buffered_query_limit; // maximum allowed memory for a buffered query (measured in KB)
bool date_as_string; // false by default but the user can set this to true to retrieve datetime values as strings

View file

@ -1792,7 +1792,7 @@ SQLSMALLINT get_resultset_meta_data(_Inout_ sqlsrv_stmt * stmt)
if (num_cols == 0) {
getMetaData = true;
if (stmt->columns_rows_obtained == false) {
num_cols = core::SQLNumResultCols(stmt TSRMLS_CC);
num_cols = core::SQLNumResultCols(stmt TSRMLS_CC);
} else {
num_cols = stmt->column_count;
}