cvs: /php4/ext/oci8 oci8.c

From: Date: Mon, 07 Feb 2000 10:32:14 +0000
Subject: cvs: /php4/ext/oci8 oci8.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-9902@lists.php.net to get a copy of this message
thies Mon Feb 7 02:32:14 2000 EDT Modified files: /php4/ext/oci8 oci8.c Log: kill warning @- Fixed some OCIBindByName() problems. (Thies) Index: php4/ext/oci8/oci8.c diff -u php4/ext/oci8/oci8.c:1.52 php4/ext/oci8/oci8.c:1.53 --- php4/ext/oci8/oci8.c:1.52 Tue Feb 1 06:39:59 2000 +++ php4/ext/oci8/oci8.c Mon Feb 7 02:31:43 2000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8.c,v 1.52 2000/02/01 14:39:59 thies Exp $ */ +/* $Id: oci8.c,v 1.53 2000/02/07 10:31:43 thies Exp $ */ /* TODO list: * @@ -461,28 +461,6 @@ return SUCCESS; } -#if 0 -static int _session_cleanup(oci_session *session) -{ - if (session->persistent) - return 0; - - _oci_close_session(session); - - return 1; -} - -static int _server_cleanup(oci_server *server) -{ - if (server->persistent) - return 0; - - _oci_close_server(server); - - return 1; -} -#endif - PHP_RSHUTDOWN_FUNCTION(oci) { OCILS_FETCH(); @@ -559,6 +537,23 @@ } /* }}} */ +/* {{{ _oci_bind_post_exec() */ + +static int +_oci_bind_post_exec(void *data) +{ + oci_bind *bind = (oci_bind *) data; + + if (bind->indicator == -1) { /* NULL */ + zval *val = bind->zval; + zval_dtor(val); + ZVAL_NULL(val); + } + + return 0; +} + +/* }}} */ /* {{{ _oci_column_hash_dtor() */ static void @@ -1149,14 +1144,14 @@ iters = 1; } - if (statement->binds) { - zend_hash_apply(statement->binds, (int (*)(void *)) _oci_bind_pre_exec); - } - if (statement->last_query) { /* if we execute refcursors we don't have a query and we don't want to execute!!! */ + if (statement->binds) { + zend_hash_apply(statement->binds, (int (*)(void *)) _oci_bind_pre_exec); + } + statement->error = oci_error(statement->pError, "OCIStmtExecute", @@ -1169,6 +1164,10 @@ NULL, mode)); + if (statement->binds) { + zend_hash_apply(statement->binds, (int (*)(void *)) _oci_bind_post_exec); + } + switch (statement->error) { case 0: break; @@ -1734,8 +1733,9 @@ if (val->type == IS_OBJECT) { retval = OCI_CONTINUE; - } else if (val->type == IS_STRING) { - STR_FREE(val->value.str.val); + } else { + convert_to_string(val); + zval_dtor(val); val->value.str.len = OCI_PIECE_SIZE; /* 64K-1 is max XXX */ val->value.str.val = emalloc(phpbind->zval->value.str.len); @@ -2110,8 +2110,9 @@ /* {{{ _oci_close_server() */ -static int _oci_session_cleanup(list_entry *le) +static int _oci_session_cleanup(void *data) { + list_entry *le = (list_entry *) data; if (le->type == le_session) { oci_server *server = ((oci_session*) le->ptr)->server; if (server->open == 2)

« previous php.version4 (#9902) next »