fixed indentations in updated code
This commit is contained in:
parent
b8a162fa18
commit
33f5fce36e
|
@ -672,8 +672,7 @@ void core_sqlsrv_execute( sqlsrv_stmt* stmt TSRMLS_DC, const char* sql, int sql_
|
|||
wsql_len = 0;
|
||||
}
|
||||
else {
|
||||
SQLSRV_ENCODING encoding = (( stmt->encoding() == SQLSRV_ENCODING_DEFAULT ) ? stmt->conn->encoding() :
|
||||
stmt->encoding() );
|
||||
SQLSRV_ENCODING encoding = (( stmt->encoding() == SQLSRV_ENCODING_DEFAULT ) ? stmt->conn->encoding() : stmt->encoding() );
|
||||
wsql_string = utf16_string_from_mbcs_string( encoding, reinterpret_cast<const char*>( sql ),
|
||||
sql_len, &wsql_len );
|
||||
CHECK_CUSTOM_ERROR( wsql_string == 0, stmt, SQLSRV_ERROR_QUERY_STRING_ENCODING_TRANSLATE,
|
||||
|
@ -771,9 +770,7 @@ bool core_sqlsrv_fetch( sqlsrv_stmt* stmt, SQLSMALLINT fetch_orientation, SQLULE
|
|||
|
||||
// move to the record requested. For absolute records, we use a 0 based offset, so +1 since
|
||||
// SQLFetchScroll uses a 1 based offset, otherwise for relative, just use the fetch_offset provided.
|
||||
SQLRETURN r = stmt->current_results->fetch( fetch_orientation,
|
||||
( fetch_orientation == SQL_FETCH_RELATIVE ) ? fetch_offset : fetch_offset + 1
|
||||
TSRMLS_CC );
|
||||
SQLRETURN r = stmt->current_results->fetch( fetch_orientation, ( fetch_orientation == SQL_FETCH_RELATIVE ) ? fetch_offset : fetch_offset + 1 TSRMLS_CC );
|
||||
if( r == SQL_NO_DATA ) {
|
||||
// if this is a forward only cursor, mark that we've passed the end so future calls result in an error
|
||||
if( stmt->cursor_type == SQL_CURSOR_FORWARD_ONLY ) {
|
||||
|
@ -926,10 +923,8 @@ void core_sqlsrv_get_field( sqlsrv_stmt* stmt, SQLUSMALLINT field_index, sqlsrv_
|
|||
sqlsrv_phptype invalid;
|
||||
invalid.typeinfo.type = SQLSRV_PHPTYPE_INVALID;
|
||||
for( int i = stmt->last_field_index + 1; i < field_index; ++i ) {
|
||||
SQLSRV_ASSERT( reinterpret_cast<field_cache*>( zend_hash_index_find_ptr( Z_ARRVAL( stmt->field_cache ), i )) == NULL,
|
||||
"Field already cached." );
|
||||
core_sqlsrv_get_field( stmt, i, invalid, prefer_string, field_value, field_len, cache_field,
|
||||
sqlsrv_php_type_out TSRMLS_CC );
|
||||
SQLSRV_ASSERT( reinterpret_cast<field_cache*>( zend_hash_index_find_ptr( Z_ARRVAL( stmt->field_cache ), i )) == NULL, "Field already cached." );
|
||||
core_sqlsrv_get_field( stmt, i, invalid, prefer_string, field_value, field_len, cache_field, sqlsrv_php_type_out TSRMLS_CC );
|
||||
// delete the value returned since we only want it cached, not the actual value
|
||||
if( field_value ) {
|
||||
efree( field_value );
|
||||
|
@ -1803,12 +1798,10 @@ SQLSMALLINT default_c_type( sqlsrv_stmt* stmt, SQLULEN paramno, zval const* para
|
|||
break;
|
||||
case IS_LONG:
|
||||
//ODBC 64-bit long and integer type are 4 byte values.
|
||||
if ( ( Z_LVAL_P( param_z ) < INT_MIN ) || ( Z_LVAL_P( param_z ) > INT_MAX ) )
|
||||
{
|
||||
if ( ( Z_LVAL_P( param_z ) < INT_MIN ) || ( Z_LVAL_P( param_z ) > INT_MAX ) ) {
|
||||
sql_c_type = SQL_C_SBIGINT;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
sql_c_type = SQL_C_SLONG;
|
||||
}
|
||||
break;
|
||||
|
@ -1848,7 +1841,6 @@ SQLSMALLINT default_c_type( sqlsrv_stmt* stmt, SQLULEN paramno, zval const* para
|
|||
|
||||
|
||||
// given a zval and encoding, determine the appropriate sql type
|
||||
|
||||
void default_sql_type( sqlsrv_stmt* stmt, SQLULEN paramno, zval* param_z, SQLSRV_ENCODING encoding,
|
||||
_Out_ SQLSMALLINT& sql_type TSRMLS_DC )
|
||||
{
|
||||
|
@ -1876,15 +1868,11 @@ void default_sql_type( sqlsrv_stmt* stmt, SQLULEN paramno, zval* param_z, SQLSRV
|
|||
break;
|
||||
case IS_LONG:
|
||||
//ODBC 64-bit long and integer type are 4 byte values.
|
||||
if ( ( Z_LVAL_P( param_z ) < INT_MIN ) || ( Z_LVAL_P( param_z ) > INT_MAX ) )
|
||||
{
|
||||
if ( ( Z_LVAL_P( param_z ) < INT_MIN ) || ( Z_LVAL_P( param_z ) > INT_MAX ) ) {
|
||||
sql_type = SQL_BIGINT;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sql_type = SQL_INTEGER;
|
||||
}
|
||||
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
sql_type = SQL_FLOAT;
|
||||
|
@ -2073,8 +2061,7 @@ void finalize_output_parameters( sqlsrv_stmt* stmt TSRMLS_DC )
|
|||
else if( output_param->is_bool ) {
|
||||
convert_to_boolean( value_z );
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ZVAL_LONG( value_z, static_cast<int>( Z_LVAL_P( value_z )));
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue