You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

28 lines
1.1 KiB

From: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Date: Fri, 20 Mar 2015 12:08:49 +0100
Subject: ads_odbc_exec
---
ext/odbc/php_odbc.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index b9bee96..abfce07 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -999,6 +999,15 @@ int odbc_bindcols(odbc_result *result TSRMLS_DC)
default:
rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), colfieldid,
NULL, 0, NULL, &displaysize);
+ if (colfieldid == SQL_DESC_OCTET_LENGTH && rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
+ /* Fallback to old method because ADS ODBC driver version 11 doesn't support
+ * SQL_DESC_OCTET_LENGTH.
+ */
+ charextraalloc = 1;
+ rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_DISPLAY_SIZE,
+ NULL, 0, NULL, &displaysize);
+ }
+
/* Workaround for Oracle ODBC Driver bug (#50162) when fetching TIMESTAMP column */
if (result->values[i].coltype == SQL_TIMESTAMP) {
displaysize += 3;