[Zope-Checkins] CVS: Products/DCOracle2/src - dco2.c:1.104.4.2
Matthew T. Kromer
matt@zope.com
Tue, 12 Feb 2002 16:21:58 -0500
Update of /cvs-repository/Products/DCOracle2/src
In directory cvs.zope.org:/tmp/cvs-serv27082/src
Modified Files:
Tag: dco2-object-branch
dco2.c
Log Message:
More TABLE OF stuff
=== Products/DCOracle2/src/dco2.c 1.104.4.1 => 1.104.4.2 ===
int flags; /* Binding flags */
int pieces; /* # of pieces */
- int piecect; /* Piece count */
union {
int i; /* in place storage */
unsigned int ui;
@@ -2382,7 +2381,6 @@
bind->object = object;
bind->flags = 0;
bind->pieces = 0;
- bind->piecect = 0;
bind->u.i = 0;
bind->alen = 0;
bind->rcode = 0;
@@ -2701,6 +2699,13 @@
}
+ while (ba->entries < index) {
+ ba = BindingArray_realloc(ba, ba->entries + 10);
+ if (ba == NULL) return OCI_ERROR;
+ }
+
+ if (ba->count < index) ba->count = index;
+
/* bufpp is the output buffer, with the following rules:
** for a locator, it's the value of the locator, not the locator
** address. For a reference, it's the address of the reference.
@@ -2721,20 +2726,21 @@
/* This handles the simple case (no locators or REFs) */
*bufpp = (dvoid *) ((char *) ba->valuep +
- (binding->piecect * binding->valuesz));
+ (index * binding->valuesz));
/* OK, now, tell Oracle where it can set the length */
- *alenpp = (ub4 *) &ba->alenp[binding->piecect];
+ *alenpp = (ub4 *) &ba->alenp[index];
/* Set the size */
- ba->alenp[binding->piecect] = binding->valuesz;
+ ba->alenp[index] = binding->valuesz;
/* and where it can save the indicator value */
- *indpp = &ba->indp[binding->piecect];
+ *indpp = &ba->indp[index];
/* and the result code */
- *rcodepp = &ba->rcodep[binding->piecect];
+ *rcodepp = &ba->rcodep[index];
- TRACE(T_EXIT,("s","dynamicBindOut"));
+ TRACE(T_EXIT,("sAAdAA","dynamicBindOut", *bufpp, *alenpp,
+ binding->valuesz, *indpp, *rcodepp));
return OCI_CONTINUE;
}
@@ -2922,7 +2928,6 @@
} else if (self->bind[pos].valuesz > 32767) { /* Whoops ! too big */
- self->bind[pos].piecect = 0;
self->bind[pos].pieces = (self->bind[pos].valuesz +32766)
/ 32767;