Re: [PHP-DEV] OCI patch

2002-10-18 Thread Maxim Maletsky

OK, then.


--
Maxim Maletsky
[EMAIL PROTECTED]



<[EMAIL PROTECTED]> wrote... :

> 
> Thies, Maxim, if you could hang on for a few hours I'll be back with a few ideas and 
>a cleaned up version of the patches + a switch for oracle 9+ to enable the new nls 
>functions.
> 
> Abdul
> 


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: Re: [PHP-DEV] OCI patch

2002-10-18 Thread predator79
Ok, I've attached a pretty ok version. I had to update the config.m4 to inculde a 
HAVE_OCI9 define, but since I'm not really good in this kind of thing, buildconf now 
reports a warning

autoheader: No template for symbol `HAVE_OCI9'

don't know what to do about it. otherwise everything compiles and runs smoothly, so I 
hope you'll enjoy :-).

Abdul

Maxim Maletsky <[EMAIL PROTECTED]> schrieb am 17.10.02 12:45:57:
> OK, then.
> 
> 
> --
> Maxim Maletsky
> [EMAIL PROTECTED]
> 
> 
> 
> <[EMAIL PROTECTED]> wrote... :
> 
> > 
> > Thies, Maxim, if you could hang on for a few hours I'll be back with a few ideas 
>and a cleaned up version of the patches + a switch for oracle 9+ to enable the new 
>nls functions.
> > 
> > Abdul
> > 
> 


--- oci8.c  Wed Oct  9 16:55:16 2002
+++ oci8.c  Thu Oct 17 13:32:09 2002
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.176 2002/09/12 09:48:02 thies Exp $ */
+/* $Id: oci8.c,v 1.175 2002/08/20 07:26:50 edink Exp $ */
 
 /* TODO list:
  *
@@ -199,7 +199,7 @@
 static oci_server *_oci_open_server(char *dbname,int persistent);
 static void _oci_close_server(oci_server *server);
 
-static oci_session *_oci_open_session(oci_server* server,char *username,char 
*password,int persistent,int exclusive);
+static oci_session *_oci_open_session(oci_server* server,char *username,char 
+*password,int persistent,int exclusive,char *charset);
 static void _oci_close_session(oci_session *session);
 
 static sb4 oci_bind_in_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 *, ub1 *, 
dvoid **);
@@ -451,7 +451,7 @@
OCI_DEFAULT, 
0, 
NULL));
-   
+   
CALL_OCI(OCIHandleAlloc(
OCI(pEnv), 
(dvoid **)&OCI(pError), 
@@ -631,7 +631,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
-   php_info_print_table_row(2, "Revision", "$Revision: 1.176 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.175 $");
 #ifndef PHP_WIN32
php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION );
php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR );
@@ -1158,9 +1158,9 @@
php_error(E_WARNING, "Unknown descriptor type 
%d.",Z_TYPE_P(descr));
return 0;
}
-   
+   
CALL_OCI_RETURN(OCI(error), OCIDescriptorAlloc(
-   OCI(pEnv),
+   connection->session->pEnv,
(dvoid*)&(descr->ocidescr), 
Z_TYPE_P(descr), 
(size_t) 0, 
@@ -1244,7 +1244,7 @@
oci_debug("_oci_make_zval: %16s,retlen = %4d,retlen4 = 
%d,storage_size4 = %4d,indicator %4d, retcode = %4d",
  
column->name,column->retlen,column->retlen4,column->storage_size4,column->indicator,column->retcode);

-   if ((! statement->has_data) || (column->indicator == -1)) { /* column is NULL 
or statment has no current data */
+   if (column->indicator == -1) { /* column is NULL */
ZVAL_NULL(value); 
return 0;
}
@@ -1351,14 +1351,14 @@
statement = ecalloc(1,sizeof(oci_statement));
 
 CALL_OCI(OCIHandleAlloc(
-   OCI(pEnv),
+   connection->session->pEnv,
(dvoid **)&statement->pStmt,
OCI_HTYPE_STMT, 
0, 
NULL));
 
 CALL_OCI(OCIHandleAlloc(
-   OCI(pEnv),
+   connection->session->pEnv,
(dvoid **)&statement->pError,
OCI_HTYPE_ERROR,
0,
@@ -1392,9 +1392,7 @@
if (query) {
statement->last_query = estrdup(query);
}
-
statement->conn = connection;
-   statement->has_data = 0;
 
statement->id = zend_list_insert(statement,le_stmt);
 
@@ -1771,7 +1769,6 @@
}
 
statement->error = 0; /* OCI_NO_DATA is NO error for us!!! */
-   statement->has_data = 0;
 
return 0;
}
@@ -1831,16 +1828,12 @@

_oci_make_zval(column->define->zval,statement,column,"OCIFetch",0 TSRMLS_CC);
}
 
-   statement->has_data = 1;
-
return 1;
}
 
oci_error(statement->pError, func, statement->error);
oci_handle_error(statement->conn, statement->error);
 
-   statement->has_data = 0;
-
return 0;
 }
 
@@ -1855