CVS update: php3/functions

From: Date: Thu, 03 Jun 1999 11:02:51 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-6503@lists.php.net to get a copy of this message
Date: Thursday June 3, 1999 @ 7:02 Author: thies Update of /repository/php3/functions In directory php:/tmp/cvs-serv24437/functions Modified Files: oracle.c Log Message: this allows LONG > 64K (the last version was OK -> but this removes the limit again!) Index: php3/functions/oracle.c diff -u php3/functions/oracle.c:1.110 php3/functions/oracle.c:1.111 --- php3/functions/oracle.c:1.110 Thu Jun 3 05:21:32 1999 +++ php3/functions/oracle.c Thu Jun 3 07:02:50 1999 @@ -1233,7 +1233,7 @@ switch(cursor->columns[i].dbtype) { case SQLT_LNG: case SQLT_LBI: -#if 1 +#if 0 { ub4 ret_len; /* XXX 64k max for LONG and LONG RAW */ @@ -1245,33 +1245,35 @@ #else { ub4 ret_len; - int offset = 0; + int offset = cursor->columns[i].col_retlen; 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; + if (cursor->columns[i].col_retcode == 1406) { /* truncation -> get the rest! */ + 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; } - - 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; @@ -1286,8 +1288,7 @@ cursor->columns[i].dsize); break; } - tmp->value.str.val = estrndup(cursor->columns[i].buf, - tmp->value.str.len); + tmp->value.str.val = estrndup(cursor->columns[i].buf,tmp->value.str.len); } if (flags&ORA_FETCHINTO_ASSOC){ @@ -1546,7 +1547,7 @@ RETURN_STRINGL(column->buf, min(column->col_retlen, column->dsize), 1); case SQLT_LNG: case SQLT_LBI: -#if 1 +#if 0 { ub4 ret_len; /* XXX 64k max for LONG and LONG RAW */ @@ -1555,42 +1556,44 @@ RETURN_STRINGL(column->buf, ret_len, 1); } #else - { - 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; - } + { + ub4 ret_len; + int offset = column->col_retlen; + sb2 result; - result = oflng(&cursor->cda, - (sword)(colno + 1), - column->buf + offset, - DB_SIZE, - 1, - &ret_len, - offset); - if (result) { - break; + if (column->col_retcode == 1406) { /* truncation -> get the rest! */ + 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 (ret_len <= 0) { - break; + if (column->buf && offset) { + RETURN_STRINGL(column->buf, offset, 1); + } else { + RETURN_FALSE; } - - offset += ret_len; - } - if (column->buf && offset) { - RETURN_STRINGL(column->buf, offset, 1); - } else { - RETURN_FALSE; } - } #endif default: php3_error(E_WARNING,

« previous php.dev (#6503) next »