Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
up to php3 version
returns resources now!
  • Loading branch information
Thies C. Arntzen committed Jul 5, 1999
1 parent eb5c6da commit cab8290
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions ext/oci8/oci8.c
Expand Up @@ -98,6 +98,11 @@
#endif
#include "snprintf.h"

#if PHP_API_VERSION >= 19990421
#define php3tls_pval_destructor(a) zval_dtor(a)
#endif


/* }}} */
/* {{{ thread safety stuff */

Expand Down Expand Up @@ -952,12 +957,8 @@ oci8_make_pval(pval *value,oci8_statement *statement,oci8_out_column *column, ch
/* this seems to be a BUG in oracle with 1-digit numbers */

if (column->rlen <= 0) {
if (column->indicator > 0) { /* XXX this is our "oci-bug" */
/*
size = column->indicator;
*/

size = 1;
if (column->size2 > 0) { /* XXX this is our "oci-bug" */
size = column->size2;
} else {
size = 1;
}
Expand Down Expand Up @@ -1122,6 +1123,10 @@ oci8_execute(oci8_statement *statement, char *func,ub4 mode, HashTable *list)
statement->conn->session->server->open = 0;
return 0;
break;

default:
return 0;
break;
}
}

Expand Down Expand Up @@ -1377,12 +1382,7 @@ oci8_fetch(oci8_statement *statement, ub4 nrows, char *func)
continue;
}

#if PHP_API_VERSION < 19990421
php3tls_pval_destructor(column->define->pval);
#else
pval_destructor(column->define->pval);
#endif


oci8_make_pval(column->define->pval,statement,column,"OCIFetch",0);
}
Expand Down Expand Up @@ -2292,8 +2292,8 @@ static void oci8_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent,int excl

oci8_debug("oci8_do_connect: id=%d",connection->id);

RETURN_LONG(connection->id);
RETURN_RESOURCE(connection->id);

CLEANUP:
oci8_debug("oci8_do_connect: FAILURE -> CLEANUP called");

Expand Down Expand Up @@ -3146,17 +3146,13 @@ PHP_FUNCTION(oci8_fetchinto)
php3_error(E_WARNING, "OCIFetchInto: unable to convert arg 2 to array");
RETURN_FALSE;
}

/*
array->is_ref = 0;
array->refcount = 1;
*/
}

#if PHP_API_VERSION < 19990421
element = emalloc(sizeof(pval));
#endif


for (i = 0; i < statement->ncolumns; i++) {
column = oci8_get_col(statement, i + 1, 0, "OCIFetchInto");
if (column == NULL) { /* should not happen... */
Expand All @@ -3169,8 +3165,6 @@ PHP_FUNCTION(oci8_fetchinto)

#if PHP_API_VERSION >= 19990421
element = emalloc(sizeof(pval));
element->is_ref = 0;
element->refcount = 1;
#endif

if ((mode & OCI_NUM) || (! (mode & OCI_ASSOC))) { /* OCI_NUM is default */
Expand Down Expand Up @@ -3522,7 +3516,7 @@ PHP_FUNCTION(oci8_parse)
RETURN_FALSE;
}

RETURN_LONG(oci8_parse(connection,
RETURN_RESOURCE(oci8_parse(connection,
query->value.str.val,
query->value.str.len,
list));
Expand Down

0 comments on commit cab8290

Please sign in to comment.