php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #68014
Patch php-5.4.32-odbc-displaysize.patch revision 2014-09-12 20:17 UTC by marcus dot england at noaa dot gov

Patch php-5.4.32-odbc-displaysize.patch for ODBC related Bug #68014

Patch version 2014-09-12 20:17 UTC

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

Developer: marcus.england@noaa.gov

diff -uNr php-5.4.32/ext/odbc/php_odbc.c php-5.4.32p/ext/odbc/php_odbc.c
--- php-5.4.32/ext/odbc/php_odbc.c	2014-08-20 14:15:22.000000000 -0600
+++ php-5.4.32p/ext/odbc/php_odbc.c	2014-09-12 11:20:51.834087744 -0600
@@ -951,7 +951,6 @@
 	SQLUSMALLINT	colfieldid;
 	int		charextraalloc;
 
-	colfieldid = SQL_COLUMN_DISPLAY_SIZE;
 	charextraalloc = 0;
 	result->values = (odbc_result_value *) safe_emalloc(sizeof(odbc_result_value), result->numcols, 0);
 
@@ -959,6 +958,8 @@
 	result->binmode = ODBCG(defaultbinmode);
 
 	for(i = 0; i < result->numcols; i++) {
+		colfieldid = SQL_COLUMN_DISPLAY_SIZE; /* This needs to be reset for every column */
+
 		rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_NAME, 
 				result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0);
 		rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE, 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 03:01:27 2024 UTC