[Zope-Checkins] CVS: Products/DCOracle2/src - dco2.c:1.100

Matthew T. Kromer matt@zope.com
Fri, 4 Jan 2002 07:58:09 -0500


Update of /cvs-repository/Products/DCOracle2/src
In directory cvs.zope.org:/tmp/cvs-serv8190/src

Modified Files:
	dco2.c 
Log Message:
Updated None result handling; return None when ever a result is 0 length,
regardless of the indicator value.  This may screw up a legitimate '' result.


=== Products/DCOracle2/src/dco2.c 1.99 => 1.100 ===
 	len = *rlenp;
 
+	if (len == 0) {
+		Py_INCREF(Py_None);
+		TRACE(T_EXIT,("sAs", "ResultSetItem_value", Py_None,
+			"0 Len"));
+		return Py_None;
+	}
+
 	typeline = typeByType(self->rs->dty);
 
 	if (typeline < 0 || TypeTable[typeline].convertout == NULL) {
@@ -5305,7 +5312,7 @@
 	} else {
 		/* Is the indicator none?  That would be fast */
 
-		if (self->ba->indp[item] == -1) {
+		if (self->ba->indp[item] == -1 || self->ba->alenp[item] == 0) {
 			result = Py_None;
 			Py_INCREF(Py_None);
 		} else {
@@ -5720,12 +5727,6 @@
 	char buf[64];
 
 	TRACE(T_ENTRY,("sAd", "CONVERTOUTF(SQLT_DAT)", data, len));
-
-	if (len == 0) {
-		Py_INCREF(Py_None);
-		TRACE(T_EXIT,("ss", "CONVERTOUTF(SQLT_DAT)", "None"));
-		return Py_None;
-	}
 
 	c = (char *) data;