if (oci_loadlob(statement->conn,descr,&buffer,&loblen)) {
ZVAL_FALSE(value);
} else {
- ZVAL_STRINGL(value,buffer,loblen,0);
+ if (loblen > 0) {
+ ZVAL_STRINGL(value,buffer,loblen,0);
+ }
+ else {
+ ZVAL_EMPTY_STRING(value);
+ }
}
} else {
/* return the locator */
return -1;
}
+ if (readlen == 0) {
+ return 0;
+ }
+
buf = emalloc(readlen + 1);
while (readlen > 0) { /* thies loop should not be entered on readlen == 0 */
/* breakthru to open */
}
}
-
+
server = calloc(1,sizeof(oci_server));
server->persistent = persistent;
}
if (!oci_loadlob(descr->conn,descr,&buffer,&loblen)) {
- RETURN_STRINGL(buffer,loblen,0);
+ if (loblen > 0) {
+ RETURN_STRINGL(buffer,loblen,0);
+ }
+ else {
+ RETURN_EMPTY_STRING();
+ }
}
}