From f505d112074d7d0693ee6829945865b4788f777f Mon Sep 17 00:00:00 2001 From: Frederic Marchal Date: Tue, 28 Apr 2015 15:08:53 +0200 Subject: Fixed bug #69381 out of memory with sage odbc driver This is just a hotfix as there are still drivers with no full ODBC 3.x support. This patch origins from bug #68350 which was solved by the proper 3.0 migration, another driver (Sage) turned out to have the real issue. --- 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 231e8144f9..ddfbc4edbe 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 = PHP_ODBC_SQLCOLATTRIBUTE(result->stmt, (SQLUSMALLINT)(i+1), colfieldid, NULL, 0, NULL, &displaysize); +#if defined(ODBCVER) && (ODBCVER >= 0x0300) + if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO && colfieldid == SQL_DESC_OCTET_LENGTH) { + /* This is a quirk for ODBC 2.0 compatibility for broken driver implementations. + */ + charextraalloc = 1; + rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_DISPLAY_SIZE, + NULL, 0, NULL, &displaysize); + } +#endif /* Workaround for Oracle ODBC Driver bug (#50162) when fetching TIMESTAMP column */ if (result->values[i].coltype == SQL_TIMESTAMP) { displaysize += 3; -- cgit v1.2.1 From 1c7a902d8adc546bf81b0d9cdd42fcce139e18c3 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 28 Apr 2015 15:13:19 +0200 Subject: updated NEWS --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 6c9d4f69c1..b0e9007f8e 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ PHP NEWS - ODBC: . Fixed bug #69474 (ODBC: Query with same field name from two tables returns incorrect result). (Anatol) + . Fixed bug #69381 (out of memory with sage odbc driver). (Frederic Marchall, + Anatol Belski) - OpenSSL: . Fixed bug #69402 (Reading empty SSL stream hangs until timeout). -- cgit v1.2.1