tags 413534 patch
thanks

Hi Peter,

I've had a chance now to look over Stephen's proposed bugfix.  I haven't
verified that this is a complete fix for all related 64-bit issues, but I
agree that there are 64-bit problems in this code and that his/upstream's
changes appear to be a correct, minimal fix for the problem he's running
into.

I'm therefore going to go ahead and NMU a fix for this bug using Stephen's
patch.  The full NMU diff is attached; it will be uploaded to incoming
shortly.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
[EMAIL PROTECTED]                                   http://www.debian.org/
diff -u psqlodbc-08.01.0200/debian/changelog psqlodbc-08.01.0200/debian/changelog
--- psqlodbc-08.01.0200/debian/changelog
+++ psqlodbc-08.01.0200/debian/changelog
@@ -1,3 +1,11 @@
+psqlodbc (1:08.01.0200-2.1) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * High-urgency upload for RC bugfix.
+  * Fix the signature of SQLGetData on 64-bit architectures.
+
+ -- Steve Langasek <[EMAIL PROTECTED]>  Mon,  5 Mar 2007 22:28:19 -0800
+
 psqlodbc (1:08.01.0200-2) unstable; urgency=low
 
   * Fix to build on 64-bit architectures (closes: #358949)
only in patch2:
unchanged:
--- psqlodbc-08.01.0200.orig/debian/patches/psqlodbc-413534.diff
+++ psqlodbc-08.01.0200/debian/patches/psqlodbc-413534.diff
@@ -0,0 +1,135 @@
+diff -ur psqlodbc-08.01.0200.orig/convert.c psqlodbc-08.01.0200/convert.c
+--- psqlodbc-08.01.0200.orig/convert.c	2007-03-07 12:10:01.000000000 -0500
++++ psqlodbc-08.01.0200/convert.c	2007-03-07 12:10:17.000000000 -0500
+@@ -379,14 +379,14 @@
+ 
+ 	SC_set_current_col(stmt, -1);
+ 	return copy_and_convert_field(stmt, field_type, value, (Int2) bic->returntype, (PTR) (bic->buffer + offset),
+-							 (SDWORD) bic->buflen, (bic->used + (offset >> 2)));
++							 bic->buflen, (bic->used + (offset >> 2)));
+ }
+ 
+ 
+ /*	This is called by SQLGetData() */
+ int
+ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 fCType,
+-					   PTR rgbValue, SDWORD cbValueMax, SQLLEN *pcbValue)
++					   PTR rgbValue, SQLLEN cbValueMax, SQLLEN *pcbValue)
+ {
+ 	CSTR func = "copy_and_convert_field";
+ 	ARDFields	*opts = SC_get_ARDF(stmt);
+@@ -454,7 +454,7 @@
+ 		pcbValueOffset = rgbValueOffset = (bind_size * bind_row);
+ 	else
+ 	{
+-		pcbValueOffset = bind_row * sizeof(SDWORD);
++		pcbValueOffset = bind_row * sizeof(SQLLEN);
+ 		rgbValueOffset = bind_row * cbValueMax;
+ 	}
+ 	/*
+@@ -486,7 +486,7 @@
+ 		 */
+ 		if (pcbValue)
+ 		{
+-			*((SDWORD *) pcbValueBindRow) = SQL_NULL_DATA;
++			*((SQLLEN *) pcbValueBindRow) = SQL_NULL_DATA;
+ 			return COPY_OK;
+ 		}
+ 		else
+@@ -663,7 +663,7 @@
+ 
+ 				/* There is no corresponding fCType for this. */
+ 				if (pcbValue)
+-					*((SDWORD *) pcbValueBindRow) = len;
++					*((SQLLEN *) pcbValueBindRow) = len;
+ 
+ 				return COPY_OK; /* dont go any further or the data will be
+ 								 * trashed */
+@@ -675,13 +675,13 @@
+ 			 */
+ 		case PG_TYPE_LO_UNDEFINED:
+ 
+-			return convert_lo(stmt, value, fCType, rgbValueBindRow, cbValueMax, (SDWORD *) pcbValueBindRow);
++			return convert_lo(stmt, value, fCType, rgbValueBindRow, cbValueMax, (SQLLEN *) pcbValueBindRow);
+ 
+ 		default:
+ 
+ 			if (field_type == stmt->hdbc->lobj_type)	/* hack until permanent
+ 														 * type available */
+-				return convert_lo(stmt, value, fCType, rgbValueBindRow, cbValueMax, (SDWORD *) pcbValueBindRow);
++				return convert_lo(stmt, value, fCType, rgbValueBindRow, cbValueMax, (SQLLEN *) pcbValueBindRow);
+ 	}
+ 
+ 	/* Change default into something useable */
+@@ -956,13 +956,13 @@
+ 			{
+ 				char *str = strdup(rgbValueBindRow);
+ 				UInt4	ucount = utf8_to_ucs2(str, len, (SQLWCHAR *) rgbValueBindRow, cbValueMax / WCLEN);
+-				if (cbValueMax < (SDWORD) (WCLEN * ucount))
++				if (cbValueMax < WCLEN * ucount)
+ 					result = COPY_RESULT_TRUNCATED;
+ 				free(str); 
+ 			}
+ 			else
+ 			{
+-                if ((SDWORD) (len + WCLEN) <= cbValueMax)
++                if (len + WCLEN <= cbValueMax)
+                 {
+                     result = COPY_OK;
+                 }
+@@ -1263,7 +1263,7 @@
+ 					if (neut_str)
+ 						len = strlen(neut_str);
+ 					if (pcbValue)
+-						*((SDWORD *) pcbValueBindRow) = len;
++						*((SQLLEN *) pcbValueBindRow) = len;
+ 					if (len > 0 && cbValueMax > 0)
+ 					{
+ 						memcpy(rgbValueBindRow, neut_str, len < cbValueMax ? len : cbValueMax);
+@@ -1282,7 +1282,7 @@
+ 
+ inolog("SQL_C_VARBOOKMARK value=%d\n", ival);
+ 					if (pcbValue)
+-						*((SDWORD *) pcbValueBindRow) = sizeof(ival);
++						*((SQLLEN *) pcbValueBindRow) = sizeof(ival);
+ 					if (cbValueMax >= sizeof(ival))
+ 					{
+ 						memcpy(rgbValueBindRow, &ival, sizeof(ival));
+@@ -1381,7 +1381,7 @@
+ 
+ 	/* store the length of what was copied, if there's a place for it */
+ 	if (pcbValue)
+-		*((SDWORD *) pcbValueBindRow) = len;
++		*((SQLLEN *) pcbValueBindRow) = len;
+ 
+ 	if (result == COPY_OK && stmt->current_col >= 0)
+ 		gdata->gdata[stmt->current_col].data_left = 0;
+@@ -3873,7 +3873,7 @@
+  */
+ int
+ convert_lo(StatementClass *stmt, const void *value, Int2 fCType, PTR rgbValue,
+-		   SDWORD cbValueMax, SDWORD *pcbValue)
++		   SQLLEN cbValueMax, SQLLEN *pcbValue)
+ {
+ 	Oid			oid;
+ 	int			retval,
+diff -ur psqlodbc-08.01.0200.orig/convert.h psqlodbc-08.01.0200/convert.h
+--- psqlodbc-08.01.0200.orig/convert.h	2007-03-07 12:10:01.000000000 -0500
++++ psqlodbc-08.01.0200/convert.h	2007-03-07 12:10:17.000000000 -0500
+@@ -37,7 +37,7 @@
+ 
+ int			copy_and_convert_field_bindinfo(StatementClass *stmt, Int4 field_type, void *value, int col);
+ int copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 fCType,
+-					   PTR rgbValue, SDWORD cbValueMax, SQLLEN *pcbValue);
++					   PTR rgbValue, SQLLEN cbValueMax, SQLLEN *pcbValue);
+ 
+ int		copy_statement_with_parameters(StatementClass *stmt, BOOL);
+ BOOL		convert_money(const char *s, char *sout, size_t soutmax);
+@@ -52,6 +52,6 @@
+ void		encode(const char *in, char *out);
+ void		decode(const char *in, char *out);
+ int convert_lo(StatementClass *stmt, const void *value, Int2 fCType, PTR rgbValue,
+-		   SDWORD cbValueMax, SDWORD *pcbValue);
++		   SQLLEN cbValueMax, SQLLEN *pcbValue);
+ 
+ #endif

Reply via email to