Skip to content

Commit

Permalink
SQL_GUID is only defined if ODBCVER >= 0x0350
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-E committed Mar 8, 2015
1 parent 7b639dc commit 9628db1
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pdo_sqlsrv/core_results.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ sqlsrv_buffered_result_set::sqlsrv_buffered_result_set( sqlsrv_stmt* stmt TSRMLS
// these types are the display size
case SQL_BIGINT:
case SQL_DECIMAL:
#if (ODBCVER >= 0x0350)
case SQL_GUID:
#endif /* ODBCVER >= 0x0350 */
case SQL_NUMERIC:
core::SQLColAttribute( stmt, i + 1, SQL_DESC_DISPLAY_SIZE, NULL, 0, NULL,
reinterpret_cast<SQLLEN*>( &meta[i].length ) TSRMLS_CC );
Expand Down Expand Up @@ -396,7 +398,9 @@ sqlsrv_buffered_result_set::sqlsrv_buffered_result_set( sqlsrv_stmt* stmt TSRMLS
case SQL_CHAR:
case SQL_DATETIME:
case SQL_DECIMAL:
#if (ODBCVER >= 0x0350)
case SQL_GUID:
#endif /* ODBCVER >= 0x0350 */
case SQL_NUMERIC:
case SQL_LONGVARCHAR:
case SQL_TYPE_DATE:
Expand Down
2 changes: 2 additions & 0 deletions pdo_sqlsrv/core_stmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,9 @@ void calc_string_size( sqlsrv_stmt* stmt, SQLUSMALLINT field_index, SQLLEN sql_t
case SQL_INTEGER:
case SQL_SMALLINT:
case SQL_TINYINT:
#if (ODBCVER >= 0x0350)
case SQL_GUID:
#endif /* ODBCVER >= 0x0350 */
case SQL_FLOAT:
case SQL_DOUBLE:
case SQL_REAL:
Expand Down
4 changes: 4 additions & 0 deletions pdo_sqlsrv/pdo_stmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ inline pdo_param_type sql_type_to_pdo_type( SQLSMALLINT sql_type )
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
#if (ODBCVER >= 0x0350)
case SQL_GUID:
#endif /* ODBCVER >= 0x0350 */
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_NUMERIC:
Expand Down Expand Up @@ -1271,7 +1273,9 @@ sqlsrv_phptype pdo_sqlsrv_stmt::sql_type_to_php_type( SQLINTEGER sql_type, SQLUI
case SQL_DECIMAL:
case SQL_FLOAT:
case SQL_REAL:
#if (ODBCVER >= 0x0350)
case SQL_GUID:
#endif /* ODBCVER >= 0x0350 */
case SQL_NUMERIC:
case SQL_WCHAR:
case SQL_VARCHAR:
Expand Down
4 changes: 4 additions & 0 deletions sqlsrv/core_results.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ sqlsrv_buffered_result_set::sqlsrv_buffered_result_set( sqlsrv_stmt* stmt TSRMLS
// these types are the display size
case SQL_BIGINT:
case SQL_DECIMAL:
#if (ODBCVER >= 0x0350)
case SQL_GUID:
#endif /* ODBCVER >= 0x0350 */
case SQL_NUMERIC:
core::SQLColAttribute( stmt, i + 1, SQL_DESC_DISPLAY_SIZE, NULL, 0, NULL,
reinterpret_cast<SQLLEN*>( &meta[i].length ) TSRMLS_CC );
Expand Down Expand Up @@ -396,7 +398,9 @@ sqlsrv_buffered_result_set::sqlsrv_buffered_result_set( sqlsrv_stmt* stmt TSRMLS
case SQL_CHAR:
case SQL_DATETIME:
case SQL_DECIMAL:
#if (ODBCVER >= 0x0350)
case SQL_GUID:
#endif /* ODBCVER >= 0x0350 */
case SQL_NUMERIC:
case SQL_LONGVARCHAR:
case SQL_TYPE_DATE:
Expand Down
2 changes: 2 additions & 0 deletions sqlsrv/core_stmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,9 @@ void calc_string_size( sqlsrv_stmt* stmt, SQLUSMALLINT field_index, SQLLEN sql_t
case SQL_INTEGER:
case SQL_SMALLINT:
case SQL_TINYINT:
#if (ODBCVER >= 0x0350)
case SQL_GUID:
#endif /* ODBCVER >= 0x0350 */
case SQL_FLOAT:
case SQL_DOUBLE:
case SQL_REAL:
Expand Down
2 changes: 2 additions & 0 deletions sqlsrv/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@ PHP_MINIT_FUNCTION(sqlsrv)
REGISTER_LONG_CONSTANT( "SQLSRV_SQLTYPE_TIMESTAMP", constant_type.value, CONST_PERSISTENT | CONST_CS );
REGISTER_LONG_CONSTANT( "SQLSRV_SQLTYPE_TINYINT", SQL_TINYINT, CONST_PERSISTENT | CONST_CS );
REGISTER_LONG_CONSTANT( "SQLSRV_SQLTYPE_UDT", SQL_SS_UDT, CONST_PERSISTENT | CONST_CS );
#if (ODBCVER >= 0x0350)
REGISTER_LONG_CONSTANT( "SQLSRV_SQLTYPE_UNIQUEIDENTIFIER", SQL_GUID, CONST_PERSISTENT | CONST_CS );
#endif /* ODBCVER >= 0x0350 */
REGISTER_LONG_CONSTANT( "SQLSRV_SQLTYPE_XML", SQL_SS_XML, CONST_PERSISTENT | CONST_CS );
constant_type.typeinfo.type = SQL_TYPE_DATE;
constant_type.typeinfo.size = 10;
Expand Down
8 changes: 8 additions & 0 deletions sqlsrv/stmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ sqlsrv_phptype ss_sqlsrv_stmt::sql_type_to_php_type( SQLINTEGER sql_type, SQLUIN
case SQL_BIGINT:
case SQL_CHAR:
case SQL_DECIMAL:
#if (ODBCVER >= 0x0350)
case SQL_GUID:
#endif /* ODBCVER >= 0x0350 */
case SQL_NUMERIC:
case SQL_WCHAR:
case SQL_SS_VARIANT:
Expand Down Expand Up @@ -1590,9 +1592,11 @@ bool determine_column_size_or_precision( sqlsrv_stmt const* stmt, sqlsrv_sqltype
case SQL_TINYINT:
*column_size = 3;
break;
#if (ODBCVER >= 0x0350)
case SQL_GUID:
*column_size = 36;
break;
#endif /* ODBCVER >= 0x0350 */
case SQL_FLOAT:
*column_size = 53;
break;
Expand Down Expand Up @@ -1683,7 +1687,9 @@ sqlsrv_phptype determine_sqlsrv_php_type( ss_sqlsrv_stmt const* stmt, SQLINTEGER
case SQL_BIGINT:
case SQL_CHAR:
case SQL_DECIMAL:
#if (ODBCVER >= 0x0350)
case SQL_GUID:
#endif /* ODBCVER >= 0x0350 */
case SQL_NUMERIC:
case SQL_WCHAR:
sqlsrv_phptype.typeinfo.type = SQLSRV_PHPTYPE_STRING;
Expand Down Expand Up @@ -2104,7 +2110,9 @@ bool is_valid_sqlsrv_sqltype( sqlsrv_sqltype sql_type )
case SQL_INTEGER:
case SQL_SMALLINT:
case SQL_TINYINT:
#if (ODBCVER >= 0x0350)
case SQL_GUID:
#endif /* ODBCVER >= 0x0350 */
case SQL_FLOAT:
case SQL_REAL:
case SQL_LONGVARBINARY:
Expand Down

0 comments on commit 9628db1

Please sign in to comment.