further ODBC 3.0 compliance

This commit is contained in:
Anatol Belski 2015-04-02 15:30:31 +02:00
parent 5c2aa71e0c
commit d27d9158c9
2 changed files with 7 additions and 1 deletions

View File

@ -960,7 +960,7 @@ int odbc_bindcols(odbc_result *result TSRMLS_DC)
charextraalloc = 0;
colfieldid = SQL_COLUMN_DISPLAY_SIZE;
rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_NAME,
rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), PHP_ODBC_DESC_BASE_COLUMN_NAME,
result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0);
rc = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE,
NULL, 0, NULL, &result->values[i].coltype);

View File

@ -281,10 +281,16 @@ void odbc_sql_error(ODBC_SQL_ERROR_PARAMS);
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR || x == SQL_WLONGVARCHAR)
#define PHP_ODBC_SQLCOLATTRIBUTE SQLColAttribute
#define PHP_ODBC_DESC_BASE_COLUMN_NAME SQL_DESC_BASE_COLUMN_NAME
#else
#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR)
#define PHP_ODBC_SQLCOLATTRIBUTE SQLColAttributes
#define PHP_ODBC_DESC_BASE_COLUMN_NAME SQL_COLUMN_NAME
#endif
#define IS_SQL_BINARY(x) (x == SQL_BINARY || x == SQL_VARBINARY || x == SQL_LONGVARBINARY)