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

Matthew T. Kromer matt@zope.com
Thu, 3 Oct 2002 11:31:02 -0400


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

Modified Files:
	dco2.c 
Log Message:
Commit Uwe Hoffman's patch to long fetch status codes


=== Products/DCOracle2/src/dco2.c 1.120 => 1.121 ===
--- Products/DCOracle2/src/dco2.c:1.120	Fri Sep 27 14:01:43 2002
+++ Products/DCOracle2/src/dco2.c	Thu Oct  3 11:31:01 2002
@@ -433,6 +433,9 @@
 	sb2		*indp;			/* Indicator array	*/
 	ub2		*rlenp;			/* Length array		*/
 	ub2		*rcodep;		/* Column result codes	*/
+#ifndef ORACLE8i
+  ub2 fetchResultCode; 
+#endif
 } ResultSet;
 
 staticforward PyTypeObject ResultSetType;
@@ -3759,7 +3762,9 @@
 
 		valuep = rs->valuep;
 		width = rs->width;
-
+#ifndef ORACLE8i
+		rs->fetchResultCode = OCI_SUCCESS;
+#endif
 		if (self->flags & LONG_COLUMN && (char) i == self->longcol) {
 			mode = OCI_DYNAMIC_FETCH;
 			longFetchInit((LongFetch *) rs->valuep);
@@ -3912,7 +3917,14 @@
 	Py_END_ALLOW_THREADS
 
 	TRACE(T_RETURN,("sR", "OCIStmtFetch", status));
-
+#ifndef ORACLE8i
+	if (status == OCI_SUCCESS_WITH_INFO) {
+	  for (i = 0; i < PyList_Size(self->results); i++) {
+	    rs = (ResultSet *) PyList_GetItem(self->results, i);
+	    rs->fetchResultCode=status;
+	  }
+	}
+#endif
 	if (status != OCI_SUCCESS && status != OCI_SUCCESS_WITH_INFO) {
 		text buff[OCI_ERROR_MAXMSG_SIZE];
 		sb4	errcode;
@@ -4670,7 +4682,12 @@
 	indp = self->rs->indp;
 	indp += self->item;
 
-	if (*indp == -1) {
+	//check if fetch call return status was OCI_SUCCESS_WITH_INFO
+	if (*indp == -1
+#ifndef ORACLE8i 
+	    && self->rs->fetchResultCode==OCI_SUCCESS_WITH_INFO
+#endif
+	    ) {
 		Py_INCREF(Py_None);
 		TRACE(T_EXIT,("sAs", "ResultSetItem_value", Py_None,
 			"NULL"));