Skip to content

Commit

Permalink
further ODBC 3.0 compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
weltling committed Apr 4, 2015
1 parent 5c2aa71 commit d27d915
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/odbc/php_odbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions ext/odbc/php_odbc_includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit d27d915

Please sign in to comment.