correctly and gives warning when accessing an index that does
not exist.
ub4 ndx;
int inx;
dvoid *elem;
- dvoid *elemind;
+ OCIInd elemind;
boolean exists;
OCIString *ocistr = (OCIString *)0;
text *str;
ndx,
&exists,
&elem,
- &elemind));
+ (dvoid **)&elemind));
if (connection->error) {
oci_error(connection->pError, "OCICollGetElem", connection->error);
- RETURN_FALSE;
+ RETURN_NULL();
}
/* Return false if value does not exist at that location */
if(exists == 0) {
+ php_error(E_WARNING, "OCICollGetElem - Invalid index %d", ndx);
RETURN_FALSE;
}
+ /* Return null if the value is null */
+ if(elemind == OCI_IND_NULL) {
+ RETURN_FALSE;
+ }
+
switch (coll->element_typecode) {
case OCI_TYPECODE_DATE:
len = 1024;