php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch odbc-wvarchar-native-draft for ODBC related Bug #69975

Patch version 2015-07-02 14:17 UTC

Return to Bug #69975 | Download this patch
Patch Revisions:

Developer: cmb@php.net

 ext/odbc/php_odbc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 49432b6..4e5478e 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -1014,6 +1014,12 @@ int odbc_bindcols(odbc_result *result)
 								NULL, 0, NULL, &displaysize);
 				}
 #endif
+                /* Workaround for drivers that report size 0 for SQL_WVARCHAR columns */
+                if (result->values[i].coltype = SQL_WVARCHAR && displaysize == 0) {
+                    result->values[i].value = NULL;
+                    break;
+                }
+
 				/* Workaround for Oracle ODBC Driver bug (#50162) when fetching TIMESTAMP column */
 				if (result->values[i].coltype == SQL_TIMESTAMP) {
 					displaysize += 3;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 16:01:29 2024 UTC