diff options
| author | Keyur Govande <keyur@php.net> | 2014-07-30 02:28:31 +0000 |
|---|---|---|
| committer | Keyur Govande <keyur@php.net> | 2014-07-30 02:28:31 +0000 |
| commit | 65364fe7d00319f6bfb4814980988d34183f9f78 (patch) | |
| tree | c43cafca04c14938b5e0b6dc38d311ea1f0defcf /ext/odbc/php_odbc_includes.h | |
| parent | 00546bc9b7cb8208c27de9c6ebd12156401a5607 (diff) | |
| download | php-git-65364fe7d00319f6bfb4814980988d34183f9f78.tar.gz | |
Corrected patch for bug #60616
For unixODBC, use ODBC version as defined by it (as of v2.2.14 it is 3.5).
This allows us to use newer features like SQL_DESC_OCTET_LENGTH (which
returns the number of bytes required to store the data). This fixes the issue
in #60616. If the newer version is not available, over-allocate to accomodate
4-byte Unicode characters for CHAR and VARCHAR datatypes (and their Wide
counterparts).
version.
Fixed a couple of failing tests.
Diffstat (limited to 'ext/odbc/php_odbc_includes.h')
| -rw-r--r-- | ext/odbc/php_odbc_includes.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h index b3ae889974..06113d9624 100644 --- a/ext/odbc/php_odbc_includes.h +++ b/ext/odbc/php_odbc_includes.h @@ -115,6 +115,7 @@ PHP_FUNCTION(solid_fetch_prev); #endif #define ODBC_TYPE "unixODBC" +#undef ODBCVER #include <sql.h> #include <sqlext.h> #define HAVE_SQL_EXTENDED_FETCH 1 @@ -284,7 +285,11 @@ int odbc_bindcols(odbc_result *result TSRMLS_DC); void odbc_sql_error(ODBC_SQL_ERROR_PARAMS); -#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR || x == SQL_WVARCHAR || x == SQL_WLONGVARCHAR) +#if defined(ODBCVER) && (ODBCVER >= 0x0300) +#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR || x == SQL_WLONGVARCHAR) +#else +#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR) +#endif #define IS_SQL_BINARY(x) (x == SQL_BINARY || x == SQL_VARBINARY || x == SQL_LONGVARBINARY) #ifdef ZTS |
