From d27d9158c91a8db82e4d3d69dd8f4ed2701101eb Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 2 Apr 2015 15:30:31 +0200 Subject: [PATCH] further ODBC 3.0 compliance --- ext/odbc/php_odbc.c | 2 +- ext/odbc/php_odbc_includes.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 354b9b8551967..0606eba2a4dae 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -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); diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h index 181688ae7f205..5f0c205977d4d 100644 --- a/ext/odbc/php_odbc_includes.h +++ b/ext/odbc/php_odbc_includes.h @@ -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)