CVS update: php3/functions
| From: | thies | Date: | Tue, 18 May 1999 08:45:20 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-5757@lists.php.net to get a copy of this message | ||
Date: Tuesday May 18, 1999 @ 4:45
Author: thies
Update of /repository/php3/functions
In directory php:/tmp/cvs-serv2442/functions
Modified Files:
oracle.c
Log Message:
see Changelog
Index: php3/functions/oracle.c
diff -u php3/functions/oracle.c:1.104 php3/functions/oracle.c:1.105
--- php3/functions/oracle.c:1.104 Thu May 6 03:58:37 1999
+++ php3/functions/oracle.c Tue May 18 04:45:20 1999
@@ -100,7 +100,6 @@
static void ora_del_cursor(HashTable *, int);
static char *ora_error(Cda_Def *);
static int ora_describe_define(oraCursor *);
-static int _cursors_cleanup(list_entry *le);
static int _close_oraconn(oraConnection *conn);
static int _close_orapconn(oraConnection *conn);
static int _close_oracur(oraCursor *cur);
@@ -186,32 +185,6 @@
DLEXPORT php3_module_entry *get_module() { return &oracle_module_entry; };
#endif
-#if 0
-static int _cursors_cleanup(list_entry *le)
-{
- ORACLE_TLS_VARS;
-
- if (le->type == ORACLE_GLOBAL(php3_oracle_module).le_cursor){
- oraCursor *curs = ((oraCursor *) le->ptr);
- oraConnection *conn = curs->conn_ptr;
-
- if (! conn->open)
- return 1;
-
- /*
- if ((!(conn->open)) && (curs->open > 0)){
- oclose(&curs->cda);
- curs->open = 0;
- }
- */
-
- return 1;
- }
-
- return 0;
-}
-#endif
-
static int _close_oraconn(oraConnection *conn)
{
ORACLE_TLS_VARS;
@@ -1141,7 +1114,6 @@
{
pval *arg1, *arr, *flg, *tmp;
oraCursor *cursor;
- ub4 ret_len;
int i;
int flags = 0;
@@ -1233,11 +1205,42 @@
switch(cursor->columns[i].dbtype) {
case SQLT_LNG:
case SQLT_LBI:
- /* XXX 64k max for LONG and LONG RAW */
- oflng(&cursor->cda, (sword)(i + 1), cursor->columns[i].buf, DB_SIZE, 1,
- &ret_len, 0);
-
- tmp->value.str.len = ret_len;
+ {
+ ub4 ret_len;
+ int offset = 0;
+ sb2 result;
+
+ while (1) {
+ cursor->columns[i].buf = erealloc(cursor->columns[i].buf,offset + DB_SIZE + 1);
+
+ if (! cursor->columns[i].buf) {
+ offset = 0;
+ break;
+ }
+
+ result = oflng(&cursor->cda,
+ (sword)(i + 1),
+ cursor->columns[i].buf + offset,
+ DB_SIZE,
+ 1,
+ &ret_len,
+ offset);
+ if (result) {
+ break;
+ }
+
+ if (ret_len <= 0) {
+ break;
+ }
+
+ offset += ret_len;
+ }
+ if (cursor->columns[i].buf && offset) {
+ tmp->value.str.len = offset;
+ } else {
+ tmp->value.str.len = 0;
+ }
+ }
break;
default:
tmp->value.str.len = min(cursor->columns[i].col_retlen,
@@ -1505,11 +1508,40 @@
case SQLT_LNG:
case SQLT_LBI:
{
- ub4 ret_len;
- /* XXX 64k max for LONG and LONG RAW */
- oflng(&cursor->cda, (sword)(colno + 1), column->buf, DB_SIZE, 1,
- &ret_len, 0);
- RETURN_STRINGL(column->buf, ret_len, 1);
+ ub4 ret_len;
+ int offset = 0;
+ sb2 result;
+
+ while (1) {
+ column->buf = erealloc(column->buf,offset + DB_SIZE + 1);
+
+ if (! column->buf) {
+ offset = 0;
+ break;
+ }
+
+ result = oflng(&cursor->cda,
+ (sword)(colno + 1),
+ column->buf + offset,
+ DB_SIZE,
+ 1,
+ &ret_len,
+ offset);
+ if (result) {
+ break;
+ }
+
+ if (ret_len <= 0) {
+ break;
+ }
+
+ offset += ret_len;
+ }
+ if (column->buf && offset) {
+ RETURN_STRINGL(column->buf, offset, 1);
+ } else {
+ RETURN_FALSE;
+ }
}
default:
php3_error(E_WARNING,
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net