[Zope-Checkins] CVS: Products/DCOracle2/src - dco2.c:1.111
Matthew T. Kromer
matt@zope.com
Thu, 16 May 2002 22:31:53 -0400
Update of /cvs-repository/Products/DCOracle2/src
In directory cvs.zope.org:/tmp/cvs-serv5154/src
Modified Files:
dco2.c
Log Message:
Modify LOBs so they have an indicator; a proc which returns an empty lob will return None on a read of a NULL lob, rather than ''.
=== Products/DCOracle2/src/dco2.c 1.110 => 1.111 ===
OCILobLocator *lobp; /* LOB Locator */
ub2 dty; /* Type of locator */
+ ub2 ind; /* Indicator */
} LobLocator;
staticforward PyTypeObject LobLocatorType;
@@ -2810,6 +2811,12 @@
alenp = &self->bind[pos].alen;
rcodep = &self->bind[pos].rcode;
+ /* LobLocators have their own indicator */
+ if (obj->ob_type == &LobLocatorType) {
+ LobLocator *lobp = (LobLocator *) obj;
+ indp = &lobp->ind;
+ }
+
/* Handle array binds (still dynamic) for PL/SQL */
if (self->bind[pos].flags & BIND_ARRAY_COLUMN) {
@@ -4343,7 +4350,8 @@
lob->lobp = NULL;
lob->errhp = NULL;
- lob->dty = SQLT_BLOB; /* FIXME -- default */
+ lob->dty = SQLT_BLOB; /* FIXME -- default */
+ lob->ind = 0; /* Normal indicator */
if (alloc == 1) {
@@ -4562,6 +4570,12 @@
if (!PyArg_ParseTuple(args, "|iiii", &length, &offset, &csid, &csfrm))
return NULL;
+
+ if (self->ind == (ub2) -1) {
+ TRACE(T_EXIT,("ss","LobLocator_read","None"));
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
TRACE(T_ARGS,("sdddd", "LobLocator_read", length, offset, csid, csfrm));