[PHP-CVS] cvs: php-src /ext/oci8 oci8.c /ext/oci8/tests connect_without_oracle_home.phpt connect_without_oracle_home_old.phpt pecl_bug16035.phpt

2009-03-15 Thread Christopher Jones
sixdMon Mar 16 05:29:49 2009 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
/php-src/ext/oci8/tests connect_without_oracle_home.phpt 
connect_without_oracle_home_old.phpt 
pecl_bug16035.phpt 
  Log:
  Mac OSX customization for initialization error message
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.363r2=1.364diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.363 php-src/ext/oci8/oci8.c:1.364
--- php-src/ext/oci8/oci8.c:1.363   Mon Mar  9 20:07:39 2009
+++ php-src/ext/oci8/oci8.c Mon Mar 16 05:29:48 2009
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.363 2009/03/09 20:07:39 sixd Exp $ */
+/* $Id: oci8.c,v 1.364 2009/03/16 05:29:48 sixd Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -51,6 +51,16 @@
 static PHP_GINIT_FUNCTION(oci);
 static PHP_GSHUTDOWN_FUNCTION(oci);
 
+/* For a user friendly message about environment setup */
+/* TODO: add cases for SHLIB_PATH, LIBPATH, LD_LIBRARY_PATH_64 etc */
+#if defined(PHP_WIN32)
+#define PHP_OCI8_LIB_PATH_MSG PATH
+#elif defined(__APPLE__)
+#define PHP_OCI8_LIB_PATH_MSG DYLD_LIBRARY_PATH
+#else
+#define PHP_OCI8_LIB_PATH_MSG LD_LIBRARY_PATH
+#endif
+
 /* True globals, no need for thread safety */
 int le_connection;
 int le_pconnection;
@@ -852,13 +862,9 @@
 
if (errstatus == OCI_ERROR) {
 #ifdef HAVE_OCI_INSTANT_CLIENT
-# ifdef PHP_WIN32
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that PATH 
includes the directory with Oracle Instant Client libraries);
-# else
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries);
-# endif
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that  
PHP_OCI8_LIB_PATH_MSG  includes the directory with Oracle Instant Client 
libraries);
 #else
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
ORACLE_HOME is set and points to the right directory);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
ORACLE_HOME and  PHP_OCI8_LIB_PATH_MSG  are set and point to the right 
directories);
 #endif
OCI_G(env) = NULL;
OCI_G(err) = NULL;
@@ -1084,7 +1090,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, PHP_OCI8_VERSION);
-   php_info_print_table_row(2, Revision, $Revision: 1.363 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.364 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -2599,14 +2605,11 @@
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIEnvNlsCreate, (retenv, 
OCI_G(events) ? PHP_OCI_INIT_MODE | OCI_EVENTS : PHP_OCI_INIT_MODE, 0, NULL, 
NULL, NULL, 0, NULL, charsetid, charsetid));
 
if (OCI_G(errcode) != OCI_SUCCESS) {
+
 #ifdef HAVE_OCI_INSTANT_CLIENT
-# ifdef PHP_WIN32
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that PATH 
includes the directory with Oracle Instant Client libraries);
-# else
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries);
-# endif
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that  
PHP_OCI8_LIB_PATH_MSG  includes the directory with Oracle Instant Client 
libraries);
 #else
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
ORACLE_HOME is set and points to the right directory);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
ORACLE_HOME and  PHP_OCI8_LIB_PATH_MSG  are set and point to the right 
directories);
 #endif
return NULL;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/connect_without_oracle_home.phpt?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/oci8/tests/connect_without_oracle_home.phpt
diff -u php-src/ext/oci8/tests/connect_without_oracle_home.phpt:1.6 

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2009-03-09 Thread Christopher Jones
sixdMon Mar  9 18:03:34 2009 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  PECL Bug #15988 (sqlnet.ora isn't read with older Oracle libraries)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.360r2=1.361diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.360 php-src/ext/oci8/oci8.c:1.361
--- php-src/ext/oci8/oci8.c:1.360   Mon Mar  9 17:40:59 2009
+++ php-src/ext/oci8/oci8.c Mon Mar  9 18:03:34 2009
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.360 2009/03/09 17:40:59 sixd Exp $ */
+/* $Id: oci8.c,v 1.361 2009/03/09 18:03:34 sixd Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -852,6 +852,22 @@
goto oci_error;
}
 
+#if !defined(OCI_MAJOR_VERSION) || (OCI_MAJOR_VERSION  11)
+   /* This works around PECL bug #15988 (sqlnet.ora not being read).
+* The root cause was fixed in Oracle 10.2.0.4 but there is no
+* compile time method to check for that precise patch level, nor
+* can it be guaranteed that runtime will use the same patch level
+* the code was compiled with.  So, we do this code for all non
+* 11g versions.
+*/
+   OCICPool *cpoolh;
+   ub4 cpoolmode = 0x8000; /* Pass invalid mode to 
OCIConnectionPoolCreate */
+   PHP_OCI_CALL(OCIHandleAlloc, (OCI_G(env), (dvoid **) cpoolh, 
OCI_HTYPE_CPOOL, (size_t) 0, (dvoid **) 0));
+   PHP_OCI_CALL(OCIConnectionPoolCreate, (OCI_G(env), OCI_G(err), cpoolh, 
NULL, 0, NULL, 0, 0, 0, 0, NULL, 0, NULL, 0, cpoolmode));
+   PHP_OCI_CALL(OCIConnectionPoolDestroy, (cpoolh, OCI_G(err), 
OCI_DEFAULT));
+   PHP_OCI_CALL(OCIHandleFree, (cpoolh, OCI_HTYPE_CPOOL));
+#endif
+
return;
 
 oci_error:
@@ -1072,7 +1088,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, PHP_OCI8_VERSION);
-   php_info_print_table_row(2, Revision, $Revision: 1.360 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.361 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);



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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c /ext/oci8/tests connect_without_oracle_home.phpt connect_without_oracle_home_old.phpt create_table.inc details.inc pecl_bug16035.phpt

2009-03-09 Thread Christopher Jones
sixdMon Mar  9 18:59:20 2009 UTC

  Added files: 
/php-src/ext/oci8/tests pecl_bug16035.phpt 

  Modified files:  
/php-src/ext/oci8   oci8.c 
/php-src/ext/oci8/tests details.inc 
connect_without_oracle_home.phpt 
connect_without_oracle_home_old.phpt 
create_table.inc 
  Log:
  PECL Bug #16035 (oci_connect without ORACLE_HOME defined causes segfault)
  http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.361r2=1.362diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.361 php-src/ext/oci8/oci8.c:1.362
--- php-src/ext/oci8/oci8.c:1.361   Mon Mar  9 18:03:34 2009
+++ php-src/ext/oci8/oci8.c Mon Mar  9 18:59:20 2009
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.361 2009/03/09 18:03:34 sixd Exp $ */
+/* $Id: oci8.c,v 1.362 2009/03/09 18:59:20 sixd Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -72,6 +72,12 @@
 #define ONUPDATELONGFUNC OnUpdateInt
 #endif
 
+#ifdef ZTS
+#define PHP_OCI_INIT_MODE (OCI_DEFAULT | OCI_OBJECT | OCI_THREADED | 
OCI_NO_MUTEX)
+#else
+#define PHP_OCI_INIT_MODE (OCI_DEFAULT | OCI_OBJECT)
+#endif
+
 /* static protos {{{ */
 static void php_oci_connection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
 static void php_oci_pconnection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
@@ -836,60 +842,65 @@
  */
 static void php_oci_init_global_handles(TSRMLS_D)
 {
-   sword errcode;
-   sb4 error_code = 0;
-   text tmp_buf[PHP_OCI_ERRBUF_LEN];
+   sword errstatus;
+   sb4   ora_error_code = 0;
+   text  tmp_buf[PHP_OCI_ERRBUF_LEN];
 
-   errcode =  OCIEnvNlsCreate(OCI_G(env), OCI_DEFAULT, 0, NULL, NULL, 
NULL, 0, NULL, 0, 0);
+   errstatus = OCIEnvNlsCreate(OCI_G(env), PHP_OCI_INIT_MODE, 0, NULL, 
NULL, NULL, 0, NULL, 0, 0);
 
-   if (errcode == OCI_ERROR) {
-   goto oci_error;
+   if (errstatus == OCI_ERROR) {
+#ifdef HAVE_OCI_INSTANT_CLIENT
+# ifdef PHP_WIN32
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that PATH 
includes the directory with Oracle Instant Client libraries);
+# else
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries);
+# endif
+#else
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
ORACLE_HOME is set and points to the right directory);
+#endif
+   OCI_G(env) = NULL;
+   OCI_G(err) = NULL;
+   return;
}
 
-   errcode = OCIHandleAlloc (OCI_G(env), (dvoid **)OCI_G(err), 
OCI_HTYPE_ERROR, 0, NULL);
-
-   if (errcode == OCI_ERROR || errcode == OCI_SUCCESS_WITH_INFO) {
-   goto oci_error;
-   }
+   errstatus = OCIHandleAlloc (OCI_G(env), (dvoid **)OCI_G(err), 
OCI_HTYPE_ERROR, 0, NULL);
 
+   if (errstatus == OCI_SUCCESS) {
 #if !defined(OCI_MAJOR_VERSION) || (OCI_MAJOR_VERSION  11)
-   /* This works around PECL bug #15988 (sqlnet.ora not being read).
-* The root cause was fixed in Oracle 10.2.0.4 but there is no
-* compile time method to check for that precise patch level, nor
-* can it be guaranteed that runtime will use the same patch level
-* the code was compiled with.  So, we do this code for all non
-* 11g versions.
-*/
-   OCICPool *cpoolh;
-   ub4 cpoolmode = 0x8000; /* Pass invalid mode to 
OCIConnectionPoolCreate */
-   PHP_OCI_CALL(OCIHandleAlloc, (OCI_G(env), (dvoid **) cpoolh, 
OCI_HTYPE_CPOOL, (size_t) 0, (dvoid **) 0));
-   PHP_OCI_CALL(OCIConnectionPoolCreate, (OCI_G(env), OCI_G(err), cpoolh, 
NULL, 0, NULL, 0, 0, 0, 0, NULL, 0, NULL, 0, cpoolmode));
-   PHP_OCI_CALL(OCIConnectionPoolDestroy, (cpoolh, OCI_G(err), 
OCI_DEFAULT));
-   PHP_OCI_CALL(OCIHandleFree, (cpoolh, OCI_HTYPE_CPOOL));
+   /* This fixes PECL bug 15988 (sqlnet.ora not being read).  The
+* root cause was fixed in Oracle 10.2.0.4 but there is no
+* compile time method to check for that precise patch level,
+* nor can it be guaranteed that runtime will use the same
+* patch level the code was compiled with.  So, we do this
+* code for all non 11g versions.
+*/
+   OCICPool *cpoolh;
+   ub4 cpoolmode = 0x8000; /* Pass invalid mode to 
OCIConnectionPoolCreate */
+   PHP_OCI_CALL(OCIHandleAlloc, (OCI_G(env), (dvoid **) cpoolh, 
OCI_HTYPE_CPOOL, (size_t) 0, (dvoid **) 0));
+   

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c php_oci8_int.h /ext/oci8/tests b47243_1.phpt b47243_2.phpt b47243_3.phpt debug.phpt

2009-03-09 Thread Christopher Jones
sixdMon Mar  9 20:07:39 2009 UTC

  Added files: 
/php-src/ext/oci8/tests b47243_1.phpt b47243_2.phpt b47243_3.phpt 

  Modified files:  
/php-src/ext/oci8   oci8.c php_oci8_int.h 
/php-src/ext/oci8/tests debug.phpt 
  Log:
  Bug #47243 (Crash at shutdown on Windows)
  http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.362r2=1.363diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.362 php-src/ext/oci8/oci8.c:1.363
--- php-src/ext/oci8/oci8.c:1.362   Mon Mar  9 18:59:20 2009
+++ php-src/ext/oci8/oci8.c Mon Mar  9 20:07:39 2009
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.362 2009/03/09 18:59:20 sixd Exp $ */
+/* $Id: oci8.c,v 1.363 2009/03/09 20:07:39 sixd Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -39,12 +39,17 @@
 
 #if HAVE_OCI8
 
+#if PHP_MAJOR_VERSION  6
+#error This version of the PHP OCI8 extension is not compatible with PHP 5 or 
earlier
+#endif
+
 #include php_oci8.h
 #include php_oci8_int.h
 #include zend_hash.h
 
 ZEND_DECLARE_MODULE_GLOBALS(oci)
 static PHP_GINIT_FUNCTION(oci);
+static PHP_GSHUTDOWN_FUNCTION(oci);
 
 /* True globals, no need for thread safety */
 int le_connection;
@@ -88,9 +93,6 @@
 static void php_oci_collection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
 
 static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC);
-#ifdef ZTS
-static int php_oci_list_helper(zend_rsrc_list_entry *le, void *le_type 
TSRMLS_DC);
-#endif
 static int php_oci_connection_ping(php_oci_connection * TSRMLS_DC);
 static int php_oci_connection_status(php_oci_connection * TSRMLS_DC);
 static int php_oci_connection_close(php_oci_connection * TSRMLS_DC);
@@ -813,7 +815,7 @@
PHP_OCI8_VERSION,
PHP_MODULE_GLOBALS(oci),  /* globals descriptor */
PHP_GINIT(oci),   /* globals ctor */
-   NULL, /* globals dtor */
+   PHP_GSHUTDOWN(oci),   /* globals dtor */
NULL, /* post deactivate */
STANDARD_MODULE_PROPERTIES_EX
 };
@@ -932,6 +934,16 @@
 }
 /* }}} */
 
+/* {{{ PHP_GSHUTDOWN_FUNCTION
+ *
+ * Called for thread shutdown in ZTS, after module shutdown for non-ZTS
+ */
+static PHP_GSHUTDOWN_FUNCTION(oci)
+{
+   php_oci_cleanup_global_handles(TSRMLS_C);
+}
+/* }}} */
+
 PHP_MINIT_FUNCTION(oci)
 {
zend_class_entry oci_lob_class_entry;
@@ -1051,36 +1063,17 @@
 
UNREGISTER_INI_ENTRIES();
 
-#ifndef ZTS
-   php_oci_cleanup_global_handles(TSRMLS_C);
-#endif
-
return SUCCESS;
 }
 
 PHP_RSHUTDOWN_FUNCTION(oci)
 {
-#ifdef ZTS
-   zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_descriptor TSRMLS_CC);
-   zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_collection TSRMLS_CC);
-   while (OCI_G(num_statements)  0) {
-   zend_hash_apply_with_argument(EG(regular_list), 
(apply_func_arg_t) php_oci_list_helper, (void *)le_statement TSRMLS_CC);
-   }
-#endif
-
/* Check persistent connections and do the necessary actions if needed. 
If persistent_helper is
 * unable to process a pconnection because of a refcount, the 
processing would happen from
 * np-destructor which is called when refcount goes to zero - 
php_oci_pconnection_list_np_dtor
 */
zend_hash_apply(EG(persistent_list), (apply_func_t) 
php_oci_persistent_helper TSRMLS_CC);
 
-#ifdef ZTS
-   while (OCI_G(num_links)  OCI_G(num_persistent)) {
-   zend_hash_apply_with_argument(EG(regular_list), 
(apply_func_arg_t) php_oci_list_helper, (void *)le_connection TSRMLS_CC);
-   }
-   php_oci_cleanup_global_handles(TSRMLS_C);
-#endif
-
return SUCCESS;
 }
 
@@ -1091,7 +1084,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, PHP_OCI8_VERSION);
-   php_info_print_table_row(2, Revision, $Revision: 1.362 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.363 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -3017,24 +3010,6 @@
return OCI_SUCCESS;
 } /* }}} */
 
-#ifdef ZTS
-/* {{{ php_oci_list_helper()
- *
- * Helper function to destroy data on thread shutdown in ZTS mode
- */
-static int php_oci_list_helper(zend_rsrc_list_entry *le, void *le_type 
TSRMLS_DC)
-{
-   int type = (int) le_type;
-
-   if (le-type == type) {
-   if (le-ptr != NULL  --le-refcount=0) {
-   return ZEND_HASH_APPLY_REMOVE;
-   }
-   }
-   return ZEND_HASH_APPLY_KEEP;
-} /* }}} */
-#endif
-
 #endif /* HAVE_OCI8 */
 
 /*

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2008-08-28 Thread Christopher Jones
sixdThu Aug 28 06:32:52 2008 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  Bug #45888 (Refcounting in ZTS mode)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.354r2=1.355diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.354 php-src/ext/oci8/oci8.c:1.355
--- php-src/ext/oci8/oci8.c:1.354   Tue Aug  5 20:56:03 2008
+++ php-src/ext/oci8/oci8.c Thu Aug 28 06:32:52 2008
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.354 2008/08/05 20:56:03 pajoye Exp $ */
+/* $Id: oci8.c,v 1.355 2008/08/28 06:32:52 sixd Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1143,7 +1143,7 @@
 #ifdef ZTS
zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_descriptor TSRMLS_CC);
zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_collection TSRMLS_CC);
-   while (OCI_G(num_statements)) {
+   while (OCI_G(num_statements)  0) {
zend_hash_apply_with_argument(EG(regular_list), 
(apply_func_arg_t) php_oci_list_helper, (void *)le_statement TSRMLS_CC);
}
 #endif
@@ -1155,7 +1155,9 @@
zend_hash_apply(EG(persistent_list), (apply_func_t) 
php_oci_persistent_helper TSRMLS_CC);
 
 #ifdef ZTS
-   zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_connection TSRMLS_CC);
+   while (OCI_G(num_links)  OCI_G(num_persistent)) {
+   zend_hash_apply_with_argument(EG(regular_list), 
(apply_func_arg_t) php_oci_list_helper, (void *)le_connection TSRMLS_CC);
+   }
php_oci_cleanup_global_handles(TSRMLS_C);
 #endif
 
@@ -1169,7 +1171,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, PHP_OCI8_VERSION);
-   php_info_print_table_row(2, Revision, $Revision: 1.354 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.355 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1227,6 +1229,7 @@
if (connection) {
php_oci_connection_close(connection TSRMLS_CC);
OCI_G(num_persistent)--;
+   OCI_G(num_links)--;
}
 } /* }}} */
 
@@ -1870,11 +1873,11 @@
if (persistent) {
zend_bool alloc_non_persistent = 0;
 
-   if (OCI_G(max_persistent)!=-1  
OCI_G(num_persistent)=OCI_G(max_persistent)) {
+   if (OCI_G(max_persistent) != -1  OCI_G(num_persistent) = 
OCI_G(max_persistent)) {
/* try to find an idle connection and kill it */
zend_hash_apply(EG(persistent_list), (apply_func_t) 
php_oci_persistent_helper TSRMLS_CC);
 
-   if (OCI_G(max_persistent)!=-1  
OCI_G(num_persistent)=OCI_G(max_persistent)) {
+   if (OCI_G(max_persistent) != -1  
OCI_G(num_persistent) = OCI_G(max_persistent)) {
/* all persistent connactions are in use, 
fallback to non-persistent connection creation */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Too 
many open persistent connections (%ld), OCI_G(num_persistent));
alloc_non_persistent = 1;
@@ -1964,6 +1967,7 @@
}
zend_hash_update(EG(persistent_list), connection-hash_key, 
connection-hash_key_len+1, (void *)new_le, sizeof(zend_rsrc_list_entry), 
NULL);
OCI_G(num_persistent)++;
+   OCI_G(num_links)++;
} else if (!exclusive) {
connection-rsrc_id = zend_list_insert(connection, 
le_connection);
new_le.ptr = (void *)connection-rsrc_id;



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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2008-08-05 Thread Pierre-Alain Joye
pajoye  Tue Aug  5 20:56:03 2008 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  - fix oci8_11g when build shared (invalid extension)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.353r2=1.354diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.353 php-src/ext/oci8/oci8.c:1.354
--- php-src/ext/oci8/oci8.c:1.353   Thu Jul 24 15:23:29 2008
+++ php-src/ext/oci8/oci8.c Tue Aug  5 20:56:03 2008
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.353 2008/07/24 15:23:29 sixd Exp $ */
+/* $Id: oci8.c,v 1.354 2008/08/05 20:56:03 pajoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -99,7 +99,7 @@
 /* }}} */
 
 /* {{{ dynamically loadable module stuff */
-#ifdef COMPILE_DL_OCI8
+#if defined(COMPILE_DL_OCI8) || defined(COMPILE_DL_OCI8_11G)
 ZEND_GET_MODULE(oci8)
 #endif /* COMPILE_DL */
 /* }}} */
@@ -1169,7 +1169,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, PHP_OCI8_VERSION);
-   php_info_print_table_row(2, Revision, $Revision: 1.353 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.354 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);



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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c php_oci8.h

2008-07-24 Thread Christopher Jones
sixdThu Jul 24 15:23:30 2008 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c php_oci8.h 
  Log:
  1. Fix macro version test for constants
  
  2. [DOC] Increase oci8.default_prefetch to 100.  Better out of box 
experience.  Consistent woth PDO_OCI
  
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.352r2=1.353diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.352 php-src/ext/oci8/oci8.c:1.353
--- php-src/ext/oci8/oci8.c:1.352   Wed Jul 16 23:54:42 2008
+++ php-src/ext/oci8/oci8.c Thu Jul 24 15:23:29 2008
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.352 2008/07/16 23:54:42 sixd Exp $ */
+/* $Id: oci8.c,v 1.353 2008/07/24 15:23:29 sixd Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -915,7 +915,7 @@
STD_PHP_INI_ENTRY(  oci8.ping_interval,   60,   
PHP_INI_SYSTEM, ONUPDATELONGFUNC,   ping_interval,  
zend_oci_globals,   oci_globals)
STD_PHP_INI_BOOLEAN(oci8.privileged_connect,  0,
PHP_INI_SYSTEM, OnUpdateBool,   privileged_connect, 
zend_oci_globals,   oci_globals)
STD_PHP_INI_ENTRY(  oci8.statement_cache_size,20,   
PHP_INI_SYSTEM, ONUPDATELONGFUNC,   statement_cache_size,   
zend_oci_globals,   oci_globals)
-   STD_PHP_INI_ENTRY(  oci8.default_prefetch,10,   
PHP_INI_SYSTEM, ONUPDATELONGFUNC,   default_prefetch,   
zend_oci_globals,   oci_globals)
+   STD_PHP_INI_ENTRY(  oci8.default_prefetch,100,  
PHP_INI_SYSTEM, ONUPDATELONGFUNC,   default_prefetch,   
zend_oci_globals,   oci_globals)
STD_PHP_INI_BOOLEAN(oci8.old_oci_close_semantics, 0,
PHP_INI_SYSTEM, OnUpdateBool,   
old_oci_close_semantics,zend_oci_globals,   oci_globals)
STD_PHP_INI_ENTRY(  oci8.connection_class,, 
PHP_INI_ALL,OnUpdateUTF8String, connection_class,   
zend_oci_globals,   oci_globals)
STD_PHP_INI_BOOLEAN(oci8.events,  
0,PHP_INI_SYSTEM, OnUpdateBool,   events, 
zend_oci_globals,   oci_globals)
@@ -1066,7 +1066,7 @@
REGISTER_LONG_CONSTANT(SQLT_LBI,SQLT_LBI, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(SQLT_BIN,SQLT_BIN, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(SQLT_ODT,SQLT_ODT, CONST_CS | 
CONST_PERSISTENT);
-#if defined(HAVE_OCI_INSTANT_CLIENT) || (defined(OCI_MAJOR_VERSION)  
OCI_MAJOR_VERSION  10)
+#if defined(HAVE_OCI_INSTANT_CLIENT) || (defined(OCI_MAJOR_VERSION)  
OCI_MAJOR_VERSION = 10)
REGISTER_LONG_CONSTANT(SQLT_BDOUBLE,SQLT_BDOUBLE, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(SQLT_BFLOAT,SQLT_BFLOAT, CONST_CS | 
CONST_PERSISTENT);
 #endif
@@ -1169,7 +1169,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, PHP_OCI8_VERSION);
-   php_info_print_table_row(2, Revision, $Revision: 1.352 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.353 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/php_oci8.h?r1=1.47r2=1.48diff_format=u
Index: php-src/ext/oci8/php_oci8.h
diff -u php-src/ext/oci8/php_oci8.h:1.47 php-src/ext/oci8/php_oci8.h:1.48
--- php-src/ext/oci8/php_oci8.h:1.47Thu Jun 19 20:24:00 2008
+++ php-src/ext/oci8/php_oci8.h Thu Jul 24 15:23:29 2008
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: php_oci8.h,v 1.47 2008/06/19 20:24:00 sixd Exp $ */
+/* $Id: php_oci8.h,v 1.48 2008/07/24 15:23:29 sixd Exp $ */
 
 #if HAVE_OCI8
 # ifndef PHP_OCI8_H
@@ -39,7 +39,7 @@
 /*
  * The version of the OCI8 extension.
  */
-#define PHP_OCI8_VERSION 1.3.3
+#define PHP_OCI8_VERSION 1.3.4-dev
 
 extern zend_module_entry oci8_module_entry;
 #define phpext_oci8_ptr oci8_module_entry



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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c /ext/oci8/tests reflection1.phpt reflection2.phpt

2008-07-16 Thread Christopher Jones
sixdWed Jul 16 23:54:42 2008 UTC

  Added files: 
/php-src/ext/oci8/tests reflection2.phpt 

  Modified files:  
/php-src/ext/oci8   oci8.c 
/php-src/ext/oci8/tests reflection1.phpt 
  Log:
  Add LOB  Collection class parameter reflection
  http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.351r2=1.352diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.351 php-src/ext/oci8/oci8.c:1.352
--- php-src/ext/oci8/oci8.c:1.351   Wed Jul 16 22:14:02 2008
+++ php-src/ext/oci8/oci8.c Wed Jul 16 23:54:42 2008
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.351 2008/07/16 22:14:02 sixd Exp $ */
+/* $Id: oci8.c,v 1.352 2008/07/16 23:54:42 sixd Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -104,7 +104,7 @@
 #endif /* COMPILE_DL */
 /* }}} */
 
-/* {{{ arginfo */
+/* {{{ Function arginfo */
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_define_by_name, 0, 0, 3)
ZEND_ARG_INFO(0, statement_resource)
@@ -223,7 +223,7 @@
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_ocisetbufferinglob, 0, 0, 2)
ZEND_ARG_INFO(0, lob_descriptor)
-   ZEND_ARG_INFO(0, flag)
+   ZEND_ARG_INFO(0, mode)
 ZEND_END_ARG_INFO()
 
 static
@@ -467,7 +467,7 @@
 ZEND_END_ARG_INFO()
 
 static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_append, 0, 0, )
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_append, 0, 0, 2)
ZEND_ARG_INFO(0, collection)
ZEND_ARG_INFO(0, value)
 ZEND_END_ARG_INFO()
@@ -504,7 +504,7 @@
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_trim, 0, 0, 2)
ZEND_ARG_INFO(0, collection)
-   ZEND_ARG_INFO(0, num)
+   ZEND_ARG_INFO(0, number)
 ZEND_END_ARG_INFO()
 
 static
@@ -515,6 +515,147 @@
 ZEND_END_ARG_INFO()
 /* }}} */
 
+/* {{{ LOB Method arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_save_method, 0, 0, 1)
+   ZEND_ARG_INFO(0, data)
+   ZEND_ARG_INFO(0, offset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_import_method, 0, 0, 1)
+   ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_load_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_read_method, 0, 0, 1)
+   ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_eof_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_tell_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_rewind_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_seek_method, 0, 0, 1)
+   ZEND_ARG_INFO(0, offset)
+   ZEND_ARG_INFO(0, whence)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_size_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_write_method, 0, 0, 1)
+   ZEND_ARG_INFO(0, string)
+   ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_append_method, 0, 0, 1)
+   ZEND_ARG_INFO(0, lob_descriptor_from)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_truncate_method, 0, 0, 0)
+   ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_erase_method, 0, 0, 0)
+   ZEND_ARG_INFO(0, offset)
+   ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_flush_method, 0, 0, 0)
+   ZEND_ARG_INFO(0, flag)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_setbuffering_method, 0, 0, 1)
+   ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_getbuffering_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_export_method, 0, 0, 1)
+   ZEND_ARG_INFO(0, filename)
+   ZEND_ARG_INFO(0, start)
+   ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_write_temporary_method, 0, 0, 1)
+   ZEND_ARG_INFO(0, data)
+   ZEND_ARG_INFO(0, type)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_close_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_free_descriptor_method, 0)
+ZEND_END_ARG_INFO()
+/* }}} */
+
+/* {{{ Collection Method arginfo */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_collection_free_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_append_method, 0, 0, 1)
+   ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_element_get_method, 0, 0, 1)
+   ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_assign_method, 0, 0, 1)
+   ZEND_ARG_INFO(0, collection_from)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_element_assign_method, 0, 0, 2)
+  

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2008-04-07 Thread Christopher Jones
sixdMon Apr  7 22:33:31 2008 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  MFB: Fix OCIPing 10.2 macro
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.347r2=1.348diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.347 php-src/ext/oci8/oci8.c:1.348
--- php-src/ext/oci8/oci8.c:1.347   Tue Apr  1 18:38:17 2008
+++ php-src/ext/oci8/oci8.c Mon Apr  7 22:33:31 2008
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.347 2008/04/01 18:38:17 sixd Exp $ */
+/* $Id: oci8.c,v 1.348 2008/04/07 22:33:31 sixd Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -677,7 +677,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, PHP_OCI8_VERSION);
-   php_info_print_table_row(2, Revision, $Revision: 1.347 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.348 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1436,7 +1436,7 @@
 * successfully performed a roundtrip and validated the
 * connection. Use OCIServerVersion for Pre-10.2 clients
 */
-#if ( (OCI_MAJOR_VERSION  10) || ((OCI_MAJOR_VERSION == 10)  
(OCI_MINOR_VERSION  2)) ) /* OCIPing available 10.2 onwards */
+#if ( (OCI_MAJOR_VERSION  10) || ((OCI_MAJOR_VERSION == 10)  
(OCI_MINOR_VERSION = 2)) )/* OCIPing available 10.2 onwards */
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPing, (connection-svc, 
OCI_G(err), OCI_DEFAULT));
 #else
char version[256];



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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2008-04-01 Thread Christopher Jones
sixdTue Apr  1 18:38:17 2008 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  Use new version macro
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.346r2=1.347diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.346 php-src/ext/oci8/oci8.c:1.347
--- php-src/ext/oci8/oci8.c:1.346   Tue Mar 25 02:25:02 2008
+++ php-src/ext/oci8/oci8.c Tue Apr  1 18:38:17 2008
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.346 2008/03/25 02:25:02 sixd Exp $ */
+/* $Id: oci8.c,v 1.347 2008/04/01 18:38:17 sixd Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -386,7 +386,7 @@
PHP_RINIT(oci),   /* per-request startup function */
PHP_RSHUTDOWN(oci),   /* per-request shutdown function */
PHP_MINFO(oci),   /* information function */
-   1.3.1,
+   PHP_OCI8_VERSION,
PHP_MODULE_GLOBALS(oci),  /* globals descriptor */
PHP_GINIT(oci),   /* globals ctor */
NULL, /* globals dtor */
@@ -677,7 +677,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, PHP_OCI8_VERSION);
-   php_info_print_table_row(2, Revision, $Revision: 1.346 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.347 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);



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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2008-02-25 Thread Christopher Jones
sixdTue Feb 26 02:18:16 2008 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  Use STD_PHP_INI_BOOLEAN.  Fix whitespace.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.343r2=1.344diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.343 php-src/ext/oci8/oci8.c:1.344
--- php-src/ext/oci8/oci8.c:1.343   Tue Feb 19 01:44:29 2008
+++ php-src/ext/oci8/oci8.c Tue Feb 26 02:18:16 2008
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.343 2008/02/19 01:44:29 sixd Exp $ */
+/* $Id: oci8.c,v 1.344 2008/02/26 02:18:16 sixd Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -395,15 +395,15 @@
 
 /* {{{ PHP_INI */
 PHP_INI_BEGIN()
-STD_PHP_INI_ENTRY(oci8.max_persistent,   -1,   PHP_INI_SYSTEM, 
ONUPDATELONGFUNC,   max_persistent, 
zend_oci_globals,   oci_globals)
-STD_PHP_INI_ENTRY(oci8.persistent_timeout,   -1,   PHP_INI_SYSTEM, 
ONUPDATELONGFUNC,   persistent_timeout, 
zend_oci_globals,   oci_globals)
-STD_PHP_INI_ENTRY(oci8.ping_interval,60,   
PHP_INI_SYSTEM, ONUPDATELONGFUNC,   ping_interval,  
zend_oci_globals,   oci_globals)
-STD_PHP_INI_BOOLEAN(oci8.privileged_connect, 0,PHP_INI_SYSTEM, 
OnUpdateBool,   privileged_connect, 
zend_oci_globals,   oci_globals)
-STD_PHP_INI_ENTRY(oci8.statement_cache_size, 20,   PHP_INI_SYSTEM, 
ONUPDATELONGFUNC,   statement_cache_size,   
zend_oci_globals,   oci_globals)
-STD_PHP_INI_ENTRY(oci8.default_prefetch, 10,   PHP_INI_SYSTEM, 
ONUPDATELONGFUNC,   default_prefetch,   
zend_oci_globals,   oci_globals)
-STD_PHP_INI_ENTRY(oci8.old_oci_close_semantics, 0, PHP_INI_SYSTEM, 
OnUpdateBool,   
old_oci_close_semantics,zend_oci_globals,   oci_globals)
-STD_PHP_INI_ENTRY(oci8.connection_class,  ,PHP_INI_ALL,
OnUpdateUTF8String, connection_class,   
zend_oci_globals,   oci_globals)
-STD_PHP_INI_ENTRY(oci8.events,   0 ,   
PHP_INI_SYSTEM, OnUpdateBool,   events, 
zend_oci_globals,   oci_globals)
+   STD_PHP_INI_ENTRY(  oci8.max_persistent,  -1,   
PHP_INI_SYSTEM, ONUPDATELONGFUNC,   max_persistent, 
zend_oci_globals,   oci_globals)
+   STD_PHP_INI_ENTRY(  oci8.persistent_timeout,  -1,   
PHP_INI_SYSTEM, ONUPDATELONGFUNC,   persistent_timeout, 
zend_oci_globals,   oci_globals)
+   STD_PHP_INI_ENTRY(  oci8.ping_interval,   60,   
PHP_INI_SYSTEM, ONUPDATELONGFUNC,   ping_interval,  
zend_oci_globals,   oci_globals)
+   STD_PHP_INI_BOOLEAN(oci8.privileged_connect,  0,
PHP_INI_SYSTEM, OnUpdateBool,   privileged_connect, 
zend_oci_globals,   oci_globals)
+   STD_PHP_INI_ENTRY(  oci8.statement_cache_size,20,   
PHP_INI_SYSTEM, ONUPDATELONGFUNC,   statement_cache_size,   
zend_oci_globals,   oci_globals)
+   STD_PHP_INI_ENTRY(  oci8.default_prefetch,10,   
PHP_INI_SYSTEM, ONUPDATELONGFUNC,   default_prefetch,   
zend_oci_globals,   oci_globals)
+   STD_PHP_INI_BOOLEAN(oci8.old_oci_close_semantics, 0,
PHP_INI_SYSTEM, OnUpdateBool,   
old_oci_close_semantics,zend_oci_globals,   oci_globals)
+   STD_PHP_INI_ENTRY(  oci8.connection_class,, 
PHP_INI_ALL,OnUpdateUTF8String, connection_class,   
zend_oci_globals,   oci_globals)
+   STD_PHP_INI_BOOLEAN(oci8.events,  
0,PHP_INI_SYSTEM, OnUpdateBool,   events, 
zend_oci_globals,   oci_globals)
 PHP_INI_END()
 /* }}} */
 
@@ -671,7 +671,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.3.1 Beta);
-   php_info_print_table_row(2, Revision, $Revision: 1.343 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.344 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_lob.c

2008-01-24 Thread Rob Richards
rrichards   Thu Jan 24 14:08:45 2008 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_lob.c 
  Log:
  fix zts build
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.341r2=1.342diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.341 php-src/ext/oci8/oci8.c:1.342
--- php-src/ext/oci8/oci8.c:1.341   Fri Jan 18 16:03:23 2008
+++ php-src/ext/oci8/oci8.c Thu Jan 24 14:08:45 2008
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.341 2008/01/18 16:03:23 sixd Exp $ */
+/* $Id: oci8.c,v 1.342 2008/01/24 14:08:45 rrichards Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -674,7 +674,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.341 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.342 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1682,7 +1682,7 @@
lob_fetch_status = php_oci_lob_read(descriptor, -1, 0, 
lob_buffer, lob_length TSRMLS_CC);
lob_fetch_status |= (php_oci_lob_get_type(descriptor, 
lob_type TSRMLS_CC)  0);
 #ifdef HAVE_OCI8_TEMP_LOB
-   php_oci_temp_lob_close(descriptor);
+   php_oci_temp_lob_close(descriptor TSRMLS_CC);
 #endif
if (lob_fetch_status) {
ZVAL_FALSE(value);
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_lob.c?r1=1.32r2=1.33diff_format=u
Index: php-src/ext/oci8/oci8_lob.c
diff -u php-src/ext/oci8/oci8_lob.c:1.32 php-src/ext/oci8/oci8_lob.c:1.33
--- php-src/ext/oci8/oci8_lob.c:1.32Tue Jan 15 20:47:50 2008
+++ php-src/ext/oci8/oci8_lob.c Thu Jan 24 14:08:45 2008
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_lob.c,v 1.32 2008/01/15 20:47:50 sixd Exp $ */
+/* $Id: oci8_lob.c,v 1.33 2008/01/24 14:08:45 rrichards Exp $ */
 
 
 
@@ -584,7 +584,7 @@
return 1;
}
 
-   if (php_oci_temp_lob_close(descriptor)) {
+   if (php_oci_temp_lob_close(descriptor TSRMLS_CC)) {
return 1;
}

@@ -681,7 +681,7 @@
 
 #ifdef HAVE_OCI8_TEMP_LOB
if (descriptor-type == OCI_DTYPE_LOB) {
-   php_oci_temp_lob_close(descriptor);
+   php_oci_temp_lob_close(descriptor TSRMLS_CC);
}
 #endif
 

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_lob.c php_oci8_int.h /ext/oci8/tests bug43497.phpt

2008-01-15 Thread Christopher Jones
sixdTue Jan 15 20:47:50 2008 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_lob.c php_oci8_int.h 
/php-src/ext/oci8/tests bug43497.phpt 
  Log:
  MFB: fix #43497 (OCI8 XML/getClobVal aka temporary LOBs leak UGA memory)
  http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.339r2=1.340diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.339 php-src/ext/oci8/oci8.c:1.340
--- php-src/ext/oci8/oci8.c:1.339   Mon Dec 31 07:12:12 2007
+++ php-src/ext/oci8/oci8.c Tue Jan 15 20:47:50 2008
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.339 2007/12/31 07:12:12 sebastian Exp $ */
+/* $Id: oci8.c,v 1.340 2008/01/15 20:47:50 sixd Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -674,7 +674,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.339 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.340 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1645,7 +1645,10 @@
php_oci_descriptor *descriptor;
ub4 lob_length;
int column_size;
-   zstr lob_buffer, zstr_data = ZSTR(column-data);
+   int lob_fetch_status;
+   zstr lob_buffer;
+   zstr zstr_data = ZSTR(column-data);
+   php_oci_lob_type lob_type;

if (column-indicator == -1) { /* column is NULL */ 
ZVAL_NULL(value); 
@@ -1674,17 +1677,15 @@
}
 
if (column-data_type != SQLT_RDD  (mode  
PHP_OCI_RETURN_LOBS)) {
-   php_oci_lob_type lob_type;
/* PHP_OCI_RETURN_LOBS means that we want the content 
of the LOB back instead of the locator */

-   if (php_oci_lob_read(descriptor, -1, 0, lob_buffer, 
lob_length TSRMLS_CC)) {
+   lob_fetch_status = php_oci_lob_read(descriptor, -1, 0, 
lob_buffer, lob_length TSRMLS_CC);
+   lob_fetch_status |= (php_oci_lob_get_type(descriptor, 
lob_type TSRMLS_CC)  0);
+   php_oci_temp_lob_close(descriptor);
+   if (lob_fetch_status) {
ZVAL_FALSE(value);
return 1;
}
-   
-   if (php_oci_lob_get_type(descriptor, lob_type 
TSRMLS_CC)  0) {
-   return 1;
-   }
 
switch (lob_type) {
case OCI_IS_CLOB:
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_lob.c?r1=1.31r2=1.32diff_format=u
Index: php-src/ext/oci8/oci8_lob.c
diff -u php-src/ext/oci8/oci8_lob.c:1.31 php-src/ext/oci8/oci8_lob.c:1.32
--- php-src/ext/oci8/oci8_lob.c:1.31Mon Dec 31 07:12:12 2007
+++ php-src/ext/oci8/oci8_lob.c Tue Jan 15 20:47:50 2008
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_lob.c,v 1.31 2007/12/31 07:12:12 sebastian Exp $ */
+/* $Id: oci8_lob.c,v 1.32 2008/01/15 20:47:50 sixd Exp $ */
 
 
 
@@ -575,7 +575,6 @@
 int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
 {
php_oci_connection *connection = descriptor-connection;
-   int is_temporary;

PHP_OCI_CALL_RETURN(connection-errcode, OCILobClose, (connection-svc, 
connection-err, descriptor-descriptor));
 
@@ -584,7 +583,21 @@
PHP_OCI_HANDLE_ERROR(connection, connection-errcode);
return 1;
}
+
+   if (php_oci_temp_lob_close(descriptor)) {
+   return 1;
+   }

+   return 0;
+} /* }}} */
+
+/* {{{ php_oci_temp_lob_close() 
+   Close Temporary LOB */
+int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
+{
+   php_oci_connection *connection = descriptor-connection;
+   int is_temporary;
+
PHP_OCI_CALL_RETURN(connection-errcode, OCILobIsTemporary, 
(connection-env,connection-err, descriptor-descriptor, is_temporary));

if (connection-errcode != OCI_SUCCESS) {
@@ -594,7 +607,6 @@
}

if (is_temporary) {
-   
PHP_OCI_CALL_RETURN(connection-errcode, OCILobFreeTemporary, 
(connection-svc, connection-err, descriptor-descriptor));

if (connection-errcode != OCI_SUCCESS) {
@@ -606,6 +618,7 @@
return 0;
 } /* }}} */
 
+
 /* {{{ php_oci_lob_flush() 
  Flush buffers for the LOB (only if they have been used) */
 int php_oci_lob_flush(php_oci_descriptor *descriptor, long flush_flag 
TSRMLS_DC)
@@ -652,7 +665,6 

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c php_oci8_int.h

2007-08-06 Thread Christopher Jones
sixdMon Aug  6 20:31:40 2007 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c php_oci8_int.h 
  Log:
  flush persistent connection after password change
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.335r2=1.336diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.335 php-src/ext/oci8/oci8.c:1.336
--- php-src/ext/oci8/oci8.c:1.335   Thu Aug  2 22:49:58 2007
+++ php-src/ext/oci8/oci8.c Mon Aug  6 20:31:40 2007
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.335 2007/08/02 22:49:58 sixd Exp $ */
+/* $Id: oci8.c,v 1.336 2007/08/06 20:31:40 sixd Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -674,7 +674,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.335 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.336 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1238,6 +1238,9 @@
connection-next_ping = 0;
}

+   /* mark password as unchanged by PHP during the duration of the 
database session */
+   connection-passwd_changed = 0;
+   
smart_str_free_ex(hashed_details, 0);
 
/* allocate environment handle */
@@ -1609,6 +1612,7 @@
PHP_OCI_HANDLE_ERROR(connection, connection-errcode);
return 1;
}
+   connection-passwd_changed = 1;
return 0;
 } /* }}} */
 
@@ -1848,7 +1852,7 @@
 
if (connection-used_this_request) {
if ((PG(connection_status)  PHP_CONNECTION_TIMEOUT) || 
OCI_G(in_call)) {
-   return 1;
+   return ZEND_HASH_APPLY_REMOVE;
}
 
if (connection-descriptors) {
@@ -1861,6 +1865,18 @@
php_oci_connection_rollback(connection 
TSRMLS_CC);
}

+   /* If oci_password_change() changed the password of a
+* persistent connection, close the connection and 
remove
+* it from the persistent connection cache.  This means
+* subsequent scripts will be prevented from being able 
to
+* present the old (now invalid) password to a usable
+* connection to the database; they must use the new
+* password.
+*/
+   if (connection-passwd_changed) {
+   return ZEND_HASH_APPLY_REMOVE;
+   }
+
if (OCI_G(persistent_timeout)  0) {
connection-idle_expiry = timestamp + 
OCI_G(persistent_timeout);
}
@@ -1876,11 +1892,11 @@
} else if (OCI_G(persistent_timeout) != -1) {
if (connection-idle_expiry  timestamp) {
/* connection has timed out */
-   return 1;
+   return ZEND_HASH_APPLY_REMOVE;
}
}
}
-   return 0;
+   return ZEND_HASH_APPLY_KEEP;
 } /* }}} */
 
 #ifdef ZTS
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/php_oci8_int.h?r1=1.36r2=1.37diff_format=u
Index: php-src/ext/oci8/php_oci8_int.h
diff -u php-src/ext/oci8/php_oci8_int.h:1.36 
php-src/ext/oci8/php_oci8_int.h:1.37
--- php-src/ext/oci8/php_oci8_int.h:1.36Tue Jul 31 19:19:39 2007
+++ php-src/ext/oci8/php_oci8_int.h Mon Aug  6 20:31:40 2007
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: php_oci8_int.h,v 1.36 2007/07/31 19:19:39 tony2001 Exp $ */
+/* $Id: php_oci8_int.h,v 1.37 2007/08/06 20:31:40 sixd Exp $ */
 
 #if HAVE_OCI8
 # ifndef PHP_OCI8_INT_H
@@ -117,6 +117,7 @@
unsigned is_persistent:1;   /* self-descriptive */
unsigned used_this_request:1; /* helps to determine if we should reset 
connection's next ping time and check its timeout */
unsigned needs_commit:1;/* helps to determine if we should 
rollback this connection on close/shutdown */
+   unsigned passwd_changed:1;  /* helps determine if a persistent 
connection hash should be invalidated after a password change */
int rsrc_id;/* resource ID */
time_t idle_expiry; /* time when the connection 
will be considered as expired */
time_t next_ping;   /* time of the next ping */

-- 

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2007-08-02 Thread Christopher Jones
sixdThu Aug  2 22:49:58 2007 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  Treat privileged oci_pconnect() as non-persistent
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.334r2=1.335diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.334 php-src/ext/oci8/oci8.c:1.335
--- php-src/ext/oci8/oci8.c:1.334   Tue Jul 31 19:19:39 2007
+++ php-src/ext/oci8/oci8.c Thu Aug  2 22:49:58 2007
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.334 2007/07/31 19:19:39 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.335 2007/08/02 22:49:58 sixd Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -674,7 +674,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.334 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.335 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1043,6 +1043,11 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Privileged connect is disabled. Enable oci8.privileged_connect to be able to 
connect as SYSOPER or SYSDBA);
return NULL;
}
+   /* Increase security by not caching privileged
+* oci_pconnect() connections. The connection becomes
+* equivalent to oci_connect() or oci_new_connect().
+*/
+   persistent = 0;
break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid 
session mode specified (%ld), session_mode);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_collection.c oci8_interface.c oci8_lob.c oci8_statement.c php_oci8_int.h

2007-07-31 Thread Antony Dovgal
tony2001Tue Jul 31 19:19:40 2007 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_collection.c oci8_interface.c 
oci8_lob.c oci8_statement.c php_oci8_int.h 
  Log:
  fix #42134 (oci_error() returns false after oci_new_collection() fails)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.333r2=1.334diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.333 php-src/ext/oci8/oci8.c:1.334
--- php-src/ext/oci8/oci8.c:1.333   Wed Jul 18 15:09:37 2007
+++ php-src/ext/oci8/oci8.c Tue Jul 31 19:19:39 2007
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.333 2007/07/18 15:09:37 sixd Exp $ */
+/* $Id: oci8.c,v 1.334 2007/07/31 19:19:39 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -674,7 +674,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.333 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.334 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1895,3 +1895,12 @@
 #endif
 
 #endif /* HAVE_OCI8 */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim600: noet sw=4 ts=4
+ */
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_collection.c?r1=1.14r2=1.15diff_format=u
Index: php-src/ext/oci8/oci8_collection.c
diff -u php-src/ext/oci8/oci8_collection.c:1.14 
php-src/ext/oci8/oci8_collection.c:1.15
--- php-src/ext/oci8/oci8_collection.c:1.14 Wed Jul 18 15:09:37 2007
+++ php-src/ext/oci8/oci8_collection.c  Tue Jul 31 19:19:39 2007
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_collection.c,v 1.14 2007/07/18 15:09:37 sixd Exp $ */
+/* $Id: oci8_collection.c,v 1.15 2007/07/31 19:19:39 tony2001 Exp $ */
 
 
 
@@ -55,7 +55,8 @@
 
collection-connection = connection;
collection-collection = NULL;
-   
+   zend_list_addref(collection-connection-rsrc_id);
+
/* get type handle by name */
PHP_OCI_CALL_RETURN(connection-errcode, OCITypeByName,
(
@@ -761,3 +762,12 @@
 } /* }}} */
 
 #endif /* HAVE_OCI8 */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim600: noet sw=4 ts=4
+ */
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_interface.c?r1=1.30r2=1.31diff_format=u
Index: php-src/ext/oci8/oci8_interface.c
diff -u php-src/ext/oci8/oci8_interface.c:1.30 
php-src/ext/oci8/oci8_interface.c:1.31
--- php-src/ext/oci8/oci8_interface.c:1.30  Thu Jan 11 11:58:34 2007
+++ php-src/ext/oci8/oci8_interface.c   Tue Jul 31 19:19:39 2007
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_interface.c,v 1.30 2007/01/11 11:58:34 tony2001 Exp $ */
+/* $Id: oci8_interface.c,v 1.31 2007/07/31 19:19:39 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -2208,3 +2208,12 @@
 #endif
 
 #endif /* HAVE_OCI8 */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim600: noet sw=4 ts=4
+ */
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_lob.c?r1=1.29r2=1.30diff_format=u
Index: php-src/ext/oci8/oci8_lob.c
diff -u php-src/ext/oci8/oci8_lob.c:1.29 php-src/ext/oci8/oci8_lob.c:1.30
--- php-src/ext/oci8/oci8_lob.c:1.29Wed Jul 18 15:09:37 2007
+++ php-src/ext/oci8/oci8_lob.c Tue Jul 31 19:19:39 2007
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_lob.c,v 1.29 2007/07/18 15:09:37 sixd Exp $ */
+/* $Id: oci8_lob.c,v 1.30 2007/07/31 19:19:39 tony2001 Exp $ */
 
 
 
@@ -69,6 +69,8 @@
 
descriptor = ecalloc(1, sizeof(php_oci_descriptor));
descriptor-type = type;
+   descriptor-connection = connection;
+   zend_list_addref(descriptor-connection-rsrc_id);
 
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIDescriptorAlloc, 
(connection-env, (dvoid*)(descriptor-descriptor), descriptor-type, (size_t) 
0, (dvoid **) 0));
 
@@ -79,8 +81,6 @@
return NULL;
}
 
-   descriptor-connection = connection;
-
PHP_OCI_REGISTER_RESOURCE(descriptor, le_descriptor);

descriptor-lob_current_position = 0;
@@ -940,3 +940,12 @@
 /* }}} */
 
 #endif /* HAVE_OCI8 */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim600: noet sw=4 ts=4
+ */
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.48r2=1.49diff_format=u

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_collection.c oci8_lob.c oci8_statement.c

2007-07-18 Thread Christopher Jones
sixdWed Jul 18 15:09:37 2007 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_collection.c oci8_lob.c 
oci8_statement.c 
  Log:
  Add casts to fix compilation warnings
  
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.332r2=1.333diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.332 php-src/ext/oci8/oci8.c:1.333
--- php-src/ext/oci8/oci8.c:1.332   Mon Jul 16 19:12:47 2007
+++ php-src/ext/oci8/oci8.c Wed Jul 18 15:09:37 2007
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.332 2007/07/16 19:12:47 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.333 2007/07/18 15:09:37 sixd Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -433,7 +433,7 @@
OCIErrorGet(OCI_G(env), (ub4)1, NULL, error_code, tmp_buf, 
(ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ERROR);
 
if (error_code) {
-   int tmp_buf_len = strlen(tmp_buf);
+   int tmp_buf_len = strlen((char *)tmp_buf);
 
if (tmp_buf_len  0  tmp_buf[tmp_buf_len - 1] == '\n') {
tmp_buf[tmp_buf_len - 1] = '\0';
@@ -674,7 +674,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.332 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.333 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -930,14 +930,14 @@
UChar *tmp_buf;
int tmp_buf_len;
 
-   err_buf_len = strlen(err_buf);
+   err_buf_len = strlen((char *)err_buf);
 
if (err_buf_len  err_buf[err_buf_len - 1] == '\n') {
err_buf[err_buf_len - 1] = '\0';
err_buf_len--;
}
 
-   if (zend_string_to_unicode(UG(ascii_conv), tmp_buf, 
tmp_buf_len, err_buf, err_buf_len TSRMLS_CC) == SUCCESS) {
+   if (zend_string_to_unicode(UG(ascii_conv), tmp_buf, 
tmp_buf_len, (char *)err_buf, err_buf_len TSRMLS_CC) == SUCCESS) {
*error_buf = (text *)eustrndup(tmp_buf, 
tmp_buf_len);
efree(tmp_buf);
}
@@ -948,14 +948,14 @@
err_buf[UBYTES(err_buf_len - 1)] = '\0';
}
} else {
-   err_buf_len = strlen(err_buf);
+   err_buf_len = strlen((char *)err_buf);
if (err_buf_len  err_buf[err_buf_len - 1] == 
'\n') {
err_buf[err_buf_len - 1] = '\0';
}
}

if (err_buf_len  error_buf) {
-   *error_buf = estrndup(err_buf, 
TEXT_BYTES(err_buf_len));
+   *error_buf = (text *)estrndup((char *)err_buf, 
TEXT_BYTES(err_buf_len));
}
}
}
@@ -1073,7 +1073,7 @@
 #if HAVE_OCI_ENV_NLS_CREATE
if (!UG(unicode)) {
if (charset.s  *charset.s) {
-   PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, 
(OCI_G(env), charset.s));
+   PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, 
(OCI_G(env), (CONST oratext *)charset.s));
if (!charsetid) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Invalid character set name: %s, charset.s);
} else {
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_collection.c?r1=1.13r2=1.14diff_format=u
Index: php-src/ext/oci8/oci8_collection.c
diff -u php-src/ext/oci8/oci8_collection.c:1.13 
php-src/ext/oci8/oci8_collection.c:1.14
--- php-src/ext/oci8/oci8_collection.c:1.13 Wed Mar 28 23:05:36 2007
+++ php-src/ext/oci8/oci8_collection.c  Wed Jul 18 15:09:37 2007
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_collection.c,v 1.13 2007/03/28 23:05:36 tony2001 Exp $ */
+/* $Id: oci8_collection.c,v 1.14 2007/07/18 15:09:37 sixd Exp $ */
 
 
 
@@ -296,7 +296,7 @@
php_oci_connection *connection = collection-connection;
 
/* format and language are NULLs, so format is DD-MON-YY and language 
is the default language of the session */
-   PHP_OCI_CALL_RETURN(connection-errcode, OCIDateFromText, 
(connection-err, date.s, TEXT_BYTES(date_len), NULL, 0, NULL, 0, oci_date));
+   

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2007-07-16 Thread Antony Dovgal
tony2001Mon Jul 16 19:12:47 2007 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix win32 build
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.331r2=1.332diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.331 php-src/ext/oci8/oci8.c:1.332
--- php-src/ext/oci8/oci8.c:1.331   Fri Jun  8 08:44:25 2007
+++ php-src/ext/oci8/oci8.c Mon Jul 16 19:12:47 2007
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.331 2007/06/08 08:44:25 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.332 2007/07/16 19:12:47 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -674,7 +674,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.331 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.332 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1636,7 +1636,7 @@
php_oci_descriptor *descriptor;
ub4 lob_length;
int column_size;
-   zstr lob_buffer, zstr_data = (zstr)column-data;
+   zstr lob_buffer, zstr_data = ZSTR(column-data);

if (column-indicator == -1) { /* column is NULL */ 
ZVAL_NULL(value); 

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_statement.c

2007-06-08 Thread Antony Dovgal
tony2001Fri Jun  8 08:44:26 2007 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_statement.c 
  Log:
  enable statement cache for non-persistent connections (patch by Chris Jones)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.330r2=1.331diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.330 php-src/ext/oci8/oci8.c:1.331
--- php-src/ext/oci8/oci8.c:1.330   Sat Feb 24 16:25:54 2007
+++ php-src/ext/oci8/oci8.c Fri Jun  8 08:44:25 2007
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.330 2007/02/24 16:25:54 helly Exp $ */
+/* $Id: oci8.c,v 1.331 2007/06/08 08:44:25 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -674,7 +674,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.330 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.331 $);
 
snprintf(buf, sizeof(buf), %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1417,7 +1417,7 @@
}
 
 #if HAVE_OCI_STMT_PREPARE2
-   if (connection-is_persistent) {
+   {
ub4 statement_cache_size = (OCI_G(statement_cache_size)  0) ? 
OCI_G(statement_cache_size) : 0;
 
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) 
connection-svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) statement_cache_size, 0, 
(ub4) OCI_ATTR_STMTCACHESIZE, OCI_G(err)));
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.45r2=1.46diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.45 
php-src/ext/oci8/oci8_statement.c:1.46
--- php-src/ext/oci8/oci8_statement.c:1.45  Tue Jun  5 07:48:16 2007
+++ php-src/ext/oci8/oci8_statement.c   Fri Jun  8 08:44:26 2007
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_statement.c,v 1.45 2007/06/05 07:48:16 tony2001 Exp $ */
+/* $Id: oci8_statement.c,v 1.46 2007/06/08 08:44:26 tony2001 Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -82,7 +82,7 @@
php_oci_error(connection-err, connection-errcode 
TSRMLS_CC);
 
 #if HAVE_OCI_STMT_PREPARE2
-   PHP_OCI_CALL(OCIStmtRelease, (statement-stmt, 
statement-err, NULL, 0, OCI_DEFAULT));
+   PHP_OCI_CALL(OCIStmtRelease, (statement-stmt, 
statement-err, NULL, 0, statement-errcode ? OCI_STRLS_CACHE_DELETE : 
OCI_DEFAULT));
PHP_OCI_CALL(OCIHandleFree,(statement-err, 
OCI_HTYPE_ERROR));
 #else
PHP_OCI_CALL(OCIHandleFree,(statement-stmt, 
OCI_HTYPE_STMT));
@@ -746,7 +746,7 @@
if (statement-stmt) {
 #if HAVE_OCI_STMT_PREPARE2
if (statement-last_query_len) { /* FIXME: magical */
-   PHP_OCI_CALL(OCIStmtRelease, (statement-stmt, 
statement-err, NULL, 0, OCI_DEFAULT));
+   PHP_OCI_CALL(OCIStmtRelease, (statement-stmt, 
statement-err, NULL, 0, statement-errcode ? OCI_STRLS_CACHE_DELETE : 
OCI_DEFAULT));
} else {
PHP_OCI_CALL(OCIHandleFree, (statement-stmt, 
OCI_HTYPE_STMT));
}

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_statement.c

2007-01-31 Thread Antony Dovgal
tony2001Wed Jan 31 12:45:56 2007 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_statement.c 
  Log:
  fix compile failure in ZTS mode when collections support is missing
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.327r2=1.328diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.327 php-src/ext/oci8/oci8.c:1.328
--- php-src/ext/oci8/oci8.c:1.327   Thu Jan 11 11:26:36 2007
+++ php-src/ext/oci8/oci8.c Wed Jan 31 12:45:55 2007
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.327 2007/01/11 11:26:36 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.328 2007/01/31 12:45:55 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -89,7 +89,9 @@
 static void php_oci_pconnection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
 static void php_oci_statement_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
 static void php_oci_descriptor_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
+#ifdef PHP_OCI8_HAVE_COLLECTIONS
 static void php_oci_collection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
+#endif
 
 static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC);
 #ifdef ZTS
@@ -646,7 +648,9 @@
 {
 #ifdef ZTS
zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_descriptor TSRMLS_CC);
+#ifdef PHP_OCI8_HAVE_COLLECTIONS
zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_collection TSRMLS_CC);
+#endif
while (OCI_G(num_statements)) { 
zend_hash_apply_with_argument(EG(regular_list), 
(apply_func_arg_t) php_oci_list_helper, (void *)le_statement TSRMLS_CC);
}
@@ -670,7 +674,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.327 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.328 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -742,6 +746,7 @@
php_oci_lob_free(descriptor TSRMLS_CC);
 } /* }}} */
 
+#ifdef PHP_OCI8_HAVE_COLLECTIONS
 /* {{{ php_oci_collection_list_dtor()
  Collection destructor */
 static void php_oci_collection_list_dtor(zend_rsrc_list_entry *entry TSRMLS_DC)
@@ -749,6 +754,7 @@
php_oci_collection *collection = (php_oci_collection *)entry-ptr;
php_oci_collection_close(collection TSRMLS_CC);
 } /* }}} */
+#endif
 
 /* }}} */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.42r2=1.43diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.42 
php-src/ext/oci8/oci8_statement.c:1.43
--- php-src/ext/oci8/oci8_statement.c:1.42  Wed Jan 31 10:36:20 2007
+++ php-src/ext/oci8/oci8_statement.c   Wed Jan 31 12:45:56 2007
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_statement.c,v 1.42 2007/01/31 10:36:20 tony2001 Exp $ */
+/* $Id: oci8_statement.c,v 1.43 2007/01/31 12:45:56 tony2001 Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -863,7 +863,9 @@
  Bind zval to the given placeholder */
 int php_oci_bind_by_name(php_oci_statement *statement, zstr name, int 
name_len, zval* var, long maxlength, long type, zend_uchar uni_type TSRMLS_DC)
 {
+#ifdef PHP_OCI8_HAVE_COLLECTIONS
php_oci_collection *bind_collection = NULL;
+#endif
php_oci_descriptor *bind_descriptor = NULL;
php_oci_statement  *bind_statement  = NULL;
dvoid *oci_desc = NULL;

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_statement.c php_oci8_int.h /ext/oci8/tests bug40078.phpt

2007-01-11 Thread Antony Dovgal
tony2001Thu Jan 11 11:26:36 2007 UTC

  Added files: 
/php-src/ext/oci8/tests bug40078.phpt 

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_statement.c php_oci8_int.h 
  Log:
  fix #40078 (ORA-01405 when fetching NULL values using 
oci_bind_array_by_name())
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.326r2=1.327diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.326 php-src/ext/oci8/oci8.c:1.327
--- php-src/ext/oci8/oci8.c:1.326   Mon Jan  1 09:29:26 2007
+++ php-src/ext/oci8/oci8.c Thu Jan 11 11:26:36 2007
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.326 2007/01/01 09:29:26 sebastian Exp $ */
+/* $Id: oci8.c,v 1.327 2007/01/11 11:26:36 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -670,7 +670,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.326 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.327 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -778,13 +778,16 @@
if (bind-array.elements) {
efree(bind-array.elements);
}
+
if (bind-array.element_lengths) {
efree(bind-array.element_lengths);
}
-/*
+
if (bind-array.indicators) {
efree(bind-array.indicators);
-   } 
+   }
+
+/*
if (bind-array.retcodes) {
efree(bind-array.retcodes);
} 
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.39r2=1.40diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.39 
php-src/ext/oci8/oci8_statement.c:1.40
--- php-src/ext/oci8/oci8_statement.c:1.39  Mon Jan  1 09:29:26 2007
+++ php-src/ext/oci8/oci8_statement.c   Thu Jan 11 11:26:36 2007
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_statement.c,v 1.39 2007/01/01 09:29:26 sebastian Exp $ */
+/* $Id: oci8_statement.c,v 1.40 2007/01/11 11:26:36 tony2001 Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -1336,7 +1336,7 @@
(dvoid *) 
bindp-array.elements, 
(sb4) 
bind-array.max_length,
type,
-   (dvoid *)0, /* 
bindp-array.indicators, */
+   (dvoid 
*)bindp-array.indicators,
(ub2 
*)bind-array.element_lengths,
(ub2 *)0, /* 
bindp-array.retcodes, */
(ub4) 
max_table_length,
@@ -1391,13 +1391,18 @@
bind-array.max_length  = TEXT_BYTES(maxlength);
bind-array.element_lengths = safe_emalloc(max_table_length, 
sizeof(ub2), 0);
memset(bind-array.element_lengths, 0, max_table_length * sizeof(ub2));
-   
+   bind-array.indicators  = safe_emalloc(max_table_length, 
sizeof(sb2), 0);
+   memset(bind-array.indicators, 0, max_table_length*sizeof(sb2));
+
zend_hash_internal_pointer_reset(hash);

for (i = 0; i  bind-array.current_length; i++) {
if (zend_hash_get_current_data(hash, (void **) entry) != 
FAILURE) {
convert_to_text_ex(entry);
bind-array.element_lengths[i] = 
TEXT_BYTES(Z_UNILEN_PP(entry)); 
+   if (Z_UNILEN_PP(entry) == 0) {
+   bind-array.indicators[i] = -1;
+   }
zend_hash_move_forward(hash);
} else {
break;
@@ -1447,6 +1452,7 @@
bind-array.max_length  = sizeof(ub4);
bind-array.element_lengths = safe_emalloc(max_table_length, 
sizeof(ub2), 0);
memset(bind-array.element_lengths, 0, max_table_length * sizeof(ub2));
+   bind-array.indicators  = NULL;

zend_hash_internal_pointer_reset(hash);
for (i = 0; i  max_table_length; i++) {
@@ -1484,6 +1490,7 @@
bind-array.max_length  = sizeof(double);
bind-array.element_lengths = safe_emalloc(max_table_length, 
sizeof(ub2), 0);
memset(bind-array.element_lengths, 0, max_table_length * sizeof(ub2));
+   bind-array.indicators  = NULL;


[PHP-CVS] cvs: php-src /ext/oci8 oci8.c /ext/oci8/tests error1.phpt

2006-11-23 Thread Antony Dovgal
tony2001Thu Nov 23 16:08:41 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
/php-src/ext/oci8/tests error1.phpt 
  Log:
  fix error messages in Unicode mode when global error handle is used
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.324r2=1.325diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.324 php-src/ext/oci8/oci8.c:1.325
--- php-src/ext/oci8/oci8.c:1.324   Fri Nov 10 16:56:19 2006
+++ php-src/ext/oci8/oci8.c Thu Nov 23 16:08:41 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.324 2006/11/10 16:56:19 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.325 2006/11/23 16:08:41 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -670,7 +670,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.324 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.325 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -906,29 +906,48 @@
 sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC)
 {
sb4 error_code = 0;
-   text tmp_buf[PHP_OCI_ERRBUF_LEN];
+   text err_buf[PHP_OCI_ERRBUF_LEN];
 
-   tmp_buf[0] = '\0';
+   err_buf[0] = '\0';
+
+   memset(err_buf, 0, sizeof(err_buf));
+   PHP_OCI_CALL(OCIErrorGet, (error_handle, (ub4)1, NULL, error_code, 
err_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ERROR));
 
-   memset(tmp_buf, 0, sizeof(tmp_buf));
-   PHP_OCI_CALL(OCIErrorGet, (error_handle, (ub4)1, NULL, error_code, 
tmp_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ERROR));
-   
if (error_code) {
-   int tmp_buf_len;
-   if (UG(unicode)) {
-   tmp_buf_len = u_strlen((UChar *)tmp_buf);
-   if (tmp_buf_len  tmp_buf[UBYTES(tmp_buf_len - 1)] == 
'\n') {
-   tmp_buf[UBYTES(tmp_buf_len - 1)] = '\0';
+   int err_buf_len;
+
+   if (UG(unicode)  error_handle == OCI_G(err)) {
+   /* global err handle is not Unicode aware */
+   UChar *tmp_buf;
+   int tmp_buf_len;
+
+   err_buf_len = strlen(err_buf);
+
+   if (err_buf_len  err_buf[err_buf_len - 1] == '\n') {
+   err_buf[err_buf_len - 1] = '\0';
+   err_buf_len--;
+   }
+
+   if (zend_string_to_unicode(UG(ascii_conv), tmp_buf, 
tmp_buf_len, err_buf, err_buf_len TSRMLS_CC) == SUCCESS) {
+   *error_buf = (text *)eustrndup(tmp_buf, 
tmp_buf_len);
+   efree(tmp_buf);
}
} else {
-   tmp_buf_len = strlen(tmp_buf);
-   if (tmp_buf_len  tmp_buf[tmp_buf_len - 1] == '\n') {
-   tmp_buf[tmp_buf_len - 1] = '\0';
+   if (UG(unicode)) {
+   err_buf_len = u_strlen((UChar *)err_buf);
+   if (err_buf_len  err_buf[UBYTES(err_buf_len - 
1)] == '\n') { /* UTODO */
+   err_buf[UBYTES(err_buf_len - 1)] = '\0';
+   }
+   } else {
+   err_buf_len = strlen(err_buf);
+   if (err_buf_len  err_buf[err_buf_len - 1] == 
'\n') {
+   err_buf[err_buf_len - 1] = '\0';
+   }
+   }
+   
+   if (err_buf_len  error_buf) {
+   *error_buf = estrndup(err_buf, 
TEXT_BYTES(err_buf_len));
}
-   }
-   
-   if (tmp_buf_len  error_buf) {
-   *error_buf = estrndup(tmp_buf, TEXT_BYTES(tmp_buf_len));
}
}
return error_code;
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/error1.phpt?r1=1.7r2=1.8diff_format=u
Index: php-src/ext/oci8/tests/error1.phpt
diff -u php-src/ext/oci8/tests/error1.phpt:1.7 
php-src/ext/oci8/tests/error1.phpt:1.8
--- php-src/ext/oci8/tests/error1.phpt:1.7  Fri Nov 10 16:56:19 2006
+++ php-src/ext/oci8/tests/error1.phpt  Thu Nov 23 16:08:41 2006
@@ -25,3 +25,17 @@
   string(0) 
 }
 Done
+--UEXPECTF--
+Warning: oci_connect(): ORA-12154: TNS:could not resolve %s in %s on line %d
+bool(false)
+array(4) {
+  [code]=
+  int(12154)
+  [message]=
+  unicode(45) ORA-12154: TNS:could not resolve %s

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_statement.c php_oci8_int.h

2006-11-10 Thread Antony Dovgal
tony2001Fri Nov 10 16:33:28 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_statement.c php_oci8_int.h 
  Log:
  fix segfault in ZTS mode when statements containing sub-statements are 
destroyed in wrong order
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.322r2=1.323diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.322 php-src/ext/oci8/oci8.c:1.323
--- php-src/ext/oci8/oci8.c:1.322   Wed Oct 18 14:22:04 2006
+++ php-src/ext/oci8/oci8.c Fri Nov 10 16:33:28 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.322 2006/10/18 14:22:04 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.323 2006/11/10 16:33:28 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -647,7 +647,9 @@
 #ifdef ZTS
zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_descriptor TSRMLS_CC);
zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_collection TSRMLS_CC);
-   zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_statement TSRMLS_CC);
+   while (OCI_G(num_statements)) { 
+   zend_hash_apply_with_argument(EG(regular_list), 
(apply_func_arg_t) php_oci_list_helper, (void *)le_statement TSRMLS_CC);
+   }
 #endif
 
/* check persistent connections and do the necessary actions if needed 
*/
@@ -668,7 +670,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.322 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.323 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1810,13 +1812,13 @@
 static int php_oci_list_helper(zend_rsrc_list_entry *le, void *le_type 
TSRMLS_DC)
 {
int type = (int) le_type;
-   
+
if (le-type == type) {
-   if (le-ptr != NULL) {
-   return 1;
+   if (le-ptr != NULL  --le-refcount=0) {
+   return ZEND_HASH_APPLY_REMOVE;
}
}
-   return 0;
+   return ZEND_HASH_APPLY_KEEP;
 } /* }}} */
 #endif
 
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.32r2=1.33diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.32 
php-src/ext/oci8/oci8_statement.c:1.33
--- php-src/ext/oci8/oci8_statement.c:1.32  Fri Oct 13 14:26:14 2006
+++ php-src/ext/oci8/oci8_statement.c   Fri Nov 10 16:33:28 2006
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_statement.c,v 1.32 2006/10/13 14:26:14 tony2001 Exp $ */
+/* $Id: oci8_statement.c,v 1.33 2006/11/10 16:33:28 tony2001 Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -113,6 +113,8 @@
}

PHP_OCI_REGISTER_RESOURCE(statement, le_statement);
+
+   OCI_G(num_statements)++;

return statement;
 }
@@ -520,6 +522,7 @@
outcol-retlen = -1;
dynamic = OCI_DEFAULT;
buf = (outcol-statement-stmt);
+   zend_list_addref(statement-id);
break;
 
case SQLT_RDD:   /* ROWID */
@@ -694,6 +697,8 @@

zend_list_delete(statement-connection-rsrc_id);
efree(statement);
+   
+   OCI_G(num_statements)--;
 } /* }}} */
 
 /* {{{ php_oci_bind_pre_exec() 
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/php_oci8_int.h?r1=1.22r2=1.23diff_format=u
Index: php-src/ext/oci8/php_oci8_int.h
diff -u php-src/ext/oci8/php_oci8_int.h:1.22 
php-src/ext/oci8/php_oci8_int.h:1.23
--- php-src/ext/oci8/php_oci8_int.h:1.22Tue Aug 22 11:08:28 2006
+++ php-src/ext/oci8/php_oci8_int.h Fri Nov 10 16:33:28 2006
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: php_oci8_int.h,v 1.22 2006/08/22 11:08:28 tony2001 Exp $ */
+/* $Id: php_oci8_int.h,v 1.23 2006/11/10 16:33:28 tony2001 Exp $ */
 
 #if HAVE_OCI8
 # ifndef PHP_OCI8_INT_H
@@ -411,6 +411,7 @@
long max_persistent;/* maximum number of persistent connections per 
process */
long num_persistent;/* number of existing persistent connections */
long num_links; /* non-persistent + persistent 
connections */
+   long num_statements;/* number of statements open */
long ping_interval; /* time interval between pings */
long 

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-10-18 Thread Antony Dovgal
tony2001Wed Oct 18 14:22:04 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix PECL bug #9061 (oci8 might reuse wrong persistent connection)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.321r2=1.322diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.321 php-src/ext/oci8/oci8.c:1.322
--- php-src/ext/oci8/oci8.c:1.321   Tue Sep 12 20:26:59 2006
+++ php-src/ext/oci8/oci8.c Wed Oct 18 14:22:04 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.321 2006/09/12 20:26:59 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.322 2006/10/18 14:22:04 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -668,7 +668,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.321 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.322 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1104,15 +1104,19 @@
/* server died */
} else {
int rsrc_type;
+   php_oci_connection *tmp;
 
/* okay, the connection 
is open and the server is still alive */

connection-used_this_request = 1;
-   
smart_str_free_ex(hashed_details, 0);
-   if 
(zend_list_find(connection-rsrc_id, rsrc_type)  (rsrc_type == 
le_pconnection)  zend_list_addref(connection-rsrc_id) == SUCCESS) {
+   tmp = 
(php_oci_connection *)zend_list_find(connection-rsrc_id, rsrc_type);
+
+   if (tmp != NULL  
rsrc_type == le_pconnection  strlen(tmp-hash_key) == hashed_details.len 
+   
memcmp(tmp-hash_key, hashed_details.c, hashed_details.len) == 0  
zend_list_addref(connection-rsrc_id) == SUCCESS) {
/* do nothing */
} else {

connection-rsrc_id = zend_list_insert(connection, le_pconnection);
}
+   
smart_str_free_ex(hashed_details, 0);
return connection;
}
}

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-09-12 Thread Antony Dovgal
tony2001Tue Sep 12 20:26:59 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  uhm.. declare oci_lob_seek() along with OCI-Lob-seek() method
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.320r2=1.321diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.320 php-src/ext/oci8/oci8.c:1.321
--- php-src/ext/oci8/oci8.c:1.320   Thu Aug 24 13:02:53 2006
+++ php-src/ext/oci8/oci8.c Tue Sep 12 20:26:59 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.320 2006/08/24 13:02:53 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.321 2006/09/12 20:26:59 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -254,6 +254,7 @@
PHP_FE(oci_lob_append,  NULL)
PHP_FE(oci_lob_copy,NULL)
PHP_FE(oci_lob_export,  NULL)
+   PHP_FE(oci_lob_seek,NULL)
PHP_FE(oci_commit,  NULL)
PHP_FE(oci_rollback,NULL)
PHP_FE(oci_new_descriptor,  NULL)
@@ -667,7 +668,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.2);
-   php_info_print_table_row(2, Revision, $Revision: 1.320 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.321 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-08-24 Thread Antony Dovgal
tony2001Thu Aug 24 12:46:52 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  bump version number
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.318r2=1.319diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.318 php-src/ext/oci8/oci8.c:1.319
--- php-src/ext/oci8/oci8.c:1.318   Tue Aug 22 11:08:28 2006
+++ php-src/ext/oci8/oci8.c Thu Aug 24 12:46:52 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.318 2006/08/22 11:08:28 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.319 2006/08/24 12:46:52 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -374,7 +374,7 @@
PHP_RINIT(oci),   /* per-request startup function */
PHP_RSHUTDOWN(oci),   /* per-request shutdown function */
PHP_MINFO(oci),   /* information function */
-   1.2.1,
+   1.2.2,
 #if (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION  1) || (PHP_MAJOR_VERSION  
5)
PHP_MODULE_GLOBALS(oci),  /* globals descriptor */
PHP_GINIT(oci),   /* globals ctor */
@@ -667,7 +667,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.318 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.319 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-08-24 Thread Antony Dovgal
tony2001Thu Aug 24 13:02:53 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  update version in phpinfo()
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.319r2=1.320diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.319 php-src/ext/oci8/oci8.c:1.320
--- php-src/ext/oci8/oci8.c:1.319   Thu Aug 24 12:46:52 2006
+++ php-src/ext/oci8/oci8.c Thu Aug 24 13:02:53 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.319 2006/08/24 12:46:52 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.320 2006/08/24 13:02:53 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -666,8 +666,8 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.319 $);
+   php_info_print_table_row(2, Version, 1.2.2);
+   php_info_print_table_row(2, Revision, $Revision: 1.320 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_interface.c oci8_lob.c oci8_statement.c php_oci8_int.h /ext/oci8/tests statement_cache.phpt

2006-08-22 Thread Antony Dovgal
tony2001Tue Aug 22 11:08:28 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_interface.c oci8_lob.c 
oci8_statement.c php_oci8_int.h 
/php-src/ext/oci8/tests statement_cache.phpt 
  Log:
  minor improvements
  dropped unused parameters, changed long to int where it should be int
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.317r2=1.318diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.317 php-src/ext/oci8/oci8.c:1.318
--- php-src/ext/oci8/oci8.c:1.317   Mon Aug 21 16:40:45 2006
+++ php-src/ext/oci8/oci8.c Tue Aug 22 11:08:28 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.317 2006/08/21 16:40:45 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.318 2006/08/22 11:08:28 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -667,7 +667,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.317 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.318 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -912,12 +912,12 @@
if (error_code) {
int tmp_buf_len = strlen(tmp_buf);

-   if (tmp_buf[tmp_buf_len - 1] == '\n') {
+   if (tmp_buf_len  tmp_buf[tmp_buf_len - 1] == '\n') {
tmp_buf[tmp_buf_len - 1] = '\0';
}
-   if (error_buf) {
+   if (tmp_buf_len  error_buf) {
*error_buf = NULL;
-   *error_buf = estrndup(tmp_buf, tmp_buf_len + 1);
+   *error_buf = estrndup(tmp_buf, tmp_buf_len);
}
}
return error_code;
@@ -1157,7 +1157,7 @@

if (alloc_non_persistent) {
connection = (php_oci_connection *) ecalloc(1, 
sizeof(php_oci_connection));
-   connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len+1);
+   connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len);
connection-is_persistent = 0;
} else {
connection = (php_oci_connection *) calloc(1, 
sizeof(php_oci_connection));
@@ -1166,7 +1166,7 @@
}
} else {
connection = (php_oci_connection *) ecalloc(1, 
sizeof(php_oci_connection));
-   connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len+1);
+   connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len);
connection-is_persistent = 0;
}
 
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_interface.c?r1=1.17r2=1.18diff_format=u
Index: php-src/ext/oci8/oci8_interface.c
diff -u php-src/ext/oci8/oci8_interface.c:1.17 
php-src/ext/oci8/oci8_interface.c:1.18
--- php-src/ext/oci8/oci8_interface.c:1.17  Sun Jul 30 20:50:53 2006
+++ php-src/ext/oci8/oci8_interface.c   Tue Aug 22 11:08:28 2006
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_interface.c,v 1.17 2006/07/30 20:50:53 tony2001 Exp $ */
+/* $Id: oci8_interface.c,v 1.18 2006/08/22 11:08:28 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1632,15 +1632,14 @@
php_oci_statement *statement;
char *query;
int query_len;
-   zend_bool cached = 0;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs|b, 
z_connection, query, query_len, cached) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs, 
z_connection, query, query_len) == FAILURE) {
return;
}
 
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
 
-   statement = php_oci_statement_create(connection, query, query_len, 
cached TSRMLS_CC);
+   statement = php_oci_statement_create(connection, query, query_len 
TSRMLS_CC);
 
if (statement) {
RETURN_RESOURCE(statement-id);
@@ -1738,7 +1737,7 @@
 
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
 
-   statement = php_oci_statement_create(connection, NULL, 0, 0 TSRMLS_CC);
+   statement = php_oci_statement_create(connection, NULL, 0 TSRMLS_CC);

if (statement) {
RETURN_RESOURCE(statement-id);
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_lob.c?r1=1.17r2=1.18diff_format=u
Index: php-src/ext/oci8/oci8_lob.c
diff -u php-src/ext/oci8/oci8_lob.c:1.17 php-src/ext/oci8/oci8_lob.c:1.18
--- php-src/ext/oci8/oci8_lob.c:1.17Mon Aug 21 16:40:46 2006
+++ 

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_collection.c oci8_lob.c oci8_statement.c php_oci8_int.h

2006-08-21 Thread Antony Dovgal
tony2001Mon Aug 21 16:40:46 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_collection.c oci8_lob.c 
oci8_statement.c php_oci8_int.h 
  Log:
  fix PECL bug #8112 (OCI8 persistent connections misbehave when Apache process 
times out)
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.316r2=1.317diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.316 php-src/ext/oci8/oci8.c:1.317
--- php-src/ext/oci8/oci8.c:1.316   Tue Aug 15 13:08:18 2006
+++ php-src/ext/oci8/oci8.c Mon Aug 21 16:40:45 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.316 2006/08/15 13:08:18 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.317 2006/08/21 16:40:45 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -667,7 +667,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.316 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.317 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -931,14 +931,14 @@
*sqltext = NULL;
*error_offset = 0;
 
-   statement-errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid 
*)statement-stmt, OCI_HTYPE_STMT, (text *) sqltext, (ub4 *)0, 
OCI_ATTR_STATEMENT, statement-err));
+   PHP_OCI_CALL_RETURN(statement-errcode, OCIAttrGet, ((dvoid 
*)statement-stmt, OCI_HTYPE_STMT, (text *) sqltext, (ub4 *)0, 
OCI_ATTR_STATEMENT, statement-err));

if (statement-errcode != OCI_SUCCESS) { 
php_oci_error(statement-err, statement-errcode TSRMLS_CC);
return 1;
}
 
-   statement-errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid 
*)statement-stmt, OCI_HTYPE_STMT, (ub2 *)error_offset, (ub4 *)0, 
OCI_ATTR_PARSE_ERROR_OFFSET, statement-err));
+   PHP_OCI_CALL_RETURN(statement-errcode, OCIAttrGet, ((dvoid 
*)statement-stmt, OCI_HTYPE_STMT, (ub2 *)error_offset, (ub4 *)0, 
OCI_ATTR_PARSE_ERROR_OFFSET, statement-err));

if (statement-errcode != OCI_SUCCESS) { 
php_oci_error(statement-err, statement-errcode TSRMLS_CC);
@@ -1029,7 +1029,7 @@
 
 #if HAVE_OCI_ENV_NLS_CREATE
if (charset  *charset) {
-   charsetid = PHP_OCI_CALL(OCINlsCharSetNameToId, (OCI_G(env), 
charset));
+   PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, 
(OCI_G(env), charset));
if (!charsetid) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid 
character set name: %s, charset);
} else {
@@ -1042,7 +1042,7 @@
size_t rsize = 0;
sword result;
 
-   result = PHP_OCI_CALL(OCINlsEnvironmentVariableGet, 
(charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, rsize))
+   PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, 
(charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, rsize))
if (result != OCI_SUCCESS) {
charsetid_nls_lang = 0;
}
@@ -1191,18 +1191,18 @@
}
 
/* create an environment using the character set id, Oracle 9i+ ONLY */
-   OCI_G(errcode) = PHP_OCI_CALL(OCIEnvNlsCreate, ((connection-env), 
PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL, connection-charset, 
connection-charset));
+   PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIEnvNlsCreate, 
((connection-env), PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL, 
connection-charset, connection-charset));
 
 #elif HAVE_OCI_ENV_CREATE
 #define PHP_OCI_INIT_FUNC_NAME OCIEnvCreate

/* allocate env handle without NLS support */
-   OCI_G(errcode) = PHP_OCI_CALL(OCIEnvCreate, ((connection-env), 
PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL));
+   PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIEnvCreate, ((connection-env), 
PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL));
 #else
 #define PHP_OCI_INIT_FUNC_NAME OCIEnvInit

/* the simpliest way */
-   OCI_G(errcode) = PHP_OCI_CALL(OCIEnvInit, ((connection-env), 
OCI_DEFAULT, 0, NULL));
+   PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIEnvInit, ((connection-env), 
OCI_DEFAULT, 0, NULL));
 #endif
 
if (OCI_G(errcode) != OCI_SUCCESS) {
@@ -1220,7 +1220,7 @@
}

/* allocate our server handle {{{ */
-   OCI_G(errcode) = PHP_OCI_CALL(OCIHandleAlloc, (connection-env, (dvoid 
**)(connection-server), OCI_HTYPE_SERVER, 0, NULL));
+   PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection-env, 
(dvoid **)(connection-server), OCI_HTYPE_SERVER, 0, NULL));

if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) 

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-08-15 Thread Antony Dovgal
tony2001Tue Aug 15 12:19:39 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  OCIBreak() is not supported on Windows
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.313r2=1.314diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.313 php-src/ext/oci8/oci8.c:1.314
--- php-src/ext/oci8/oci8.c:1.313   Thu Aug 10 12:15:24 2006
+++ php-src/ext/oci8/oci8.c Tue Aug 15 12:19:39 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.313 2006/08/10 12:15:24 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.314 2006/08/15 12:19:39 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -668,7 +668,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.313 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.314 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1770,14 +1770,7 @@
 
if (connection-used_this_request) {
if ((PG(connection_status)  PHP_CONNECTION_TIMEOUT)) {
-   /* call OCIBreak() on timeout to avoid 
appearance of deadlocked persistent connections */
-   connection-errcode = PHP_OCI_CALL(OCIBreak, 
(connection-svc, connection-err));
-   if (connection-errcode != OCI_SUCCESS) {
-   php_oci_error(connection-err, 
connection-errcode TSRMLS_CC);
-   PHP_OCI_HANDLE_ERROR(connection, 
connection-errcode);
-   /* OCIBreak() failed. delete the 
connection */
-   return 1;
-   }
+   return 1;
}
 
if (connection-descriptors) {

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-08-15 Thread Antony Dovgal
tony2001Tue Aug 15 12:27:04 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  error message might be NULL
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.314r2=1.315diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.314 php-src/ext/oci8/oci8.c:1.315
--- php-src/ext/oci8/oci8.c:1.314   Tue Aug 15 12:19:39 2006
+++ php-src/ext/oci8/oci8.c Tue Aug 15 12:27:04 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.314 2006/08/15 12:19:39 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.315 2006/08/15 12:27:04 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -432,7 +432,7 @@
if (error_code) {
int tmp_buf_len = strlen(tmp_buf);
 
-   if (tmp_buf[tmp_buf_len - 1] == '\n') {
+   if (tmp_buf_len  0  tmp_buf[tmp_buf_len - 1] == '\n') {
tmp_buf[tmp_buf_len - 1] = '\0';
}

@@ -668,7 +668,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.314 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.315 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -860,8 +860,12 @@
break;
case OCI_SUCCESS_WITH_INFO:
errcode = php_oci_fetch_errmsg(err_p, errbuf 
TSRMLS_CC);
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
OCI_SUCCESS_WITH_INFO: %s, errbuf);
-   efree(errbuf);
+   if (errbuf) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
OCI_SUCCESS_WITH_INFO: %s, errbuf);
+   efree(errbuf);
+   } else {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
OCI_SUCCESS_WITH_INFO: failed to fetch error message);
+   }
break;
case OCI_NEED_DATA:
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
OCI_NEED_DATA);
@@ -871,8 +875,12 @@
break;
case OCI_ERROR: 
errcode = php_oci_fetch_errmsg(err_p, errbuf 
TSRMLS_CC);
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, %s, 
errbuf);
-   efree(errbuf);
+   if (errbuf) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
%s, errbuf);
+   efree(errbuf);
+   } else {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
failed to fetch error message);
+   }
break;
case OCI_INVALID_HANDLE:
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
OCI_INVALID_HANDLE);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_collection.c oci8_lob.c oci8_statement.c

2006-08-15 Thread Antony Dovgal
tony2001Tue Aug 15 13:08:18 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_collection.c oci8_lob.c 
oci8_statement.c 
  Log:
  minor CS/WS fixes
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.315r2=1.316diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.315 php-src/ext/oci8/oci8.c:1.316
--- php-src/ext/oci8/oci8.c:1.315   Tue Aug 15 12:27:04 2006
+++ php-src/ext/oci8/oci8.c Tue Aug 15 13:08:18 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.315 2006/08/15 12:27:04 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.316 2006/08/15 13:08:18 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -443,8 +443,7 @@

OCI_G(env) = NULL;
OCI_G(err) = NULL;
-   }
-   else {
+   } else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
OCI_SUCCESS_WITH_INFO: %s, tmp_buf);
}
}
@@ -668,7 +667,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.315 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.316 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1072,8 +1071,7 @@
if (le-type == le_pconnection) {
connection = (php_oci_connection *)le-ptr; 
}
-   }
-   else if (!persistent  zend_hash_find(EG(regular_list), 
hashed_details.c, hashed_details.len+1, (void **) le) == SUCCESS) {
+   } else if (!persistent  zend_hash_find(EG(regular_list), 
hashed_details.c, hashed_details.len+1, (void **) le) == SUCCESS) {
found = 1;
if (le-type == le_index_ptr) {
int type, link;
@@ -1103,8 +1101,7 @@
 * */
if ( (connection-next_ping  
0)  (timestamp = connection-next_ping)  
!php_oci_connection_ping(connection TSRMLS_CC)) {
/* server died */
-   }
-   else {
+   } else {
int rsrc_type;
 
/* okay, the connection 
is open and the server is still alive */
@@ -1123,8 +1120,7 @@
zend_hash_del(EG(persistent_list), 
hashed_details.c, hashed_details.len+1);
connection = NULL;
goto open;
-   }
-   else {
+   } else {
/* we do not ping non-persistent 
connections */
smart_str_free_ex(hashed_details, 0);
zend_list_addref(connection-rsrc_id);
@@ -1139,8 +1135,7 @@
/* found something, but it's not a connection, delete 
it */
if (persistent) {
zend_hash_del(EG(persistent_list), 
hashed_details.c, hashed_details.len+1);
-   }
-   else {
+   } else {
zend_hash_del(EG(regular_list), 
hashed_details.c, hashed_details.len+1);
}
}
@@ -1164,14 +1159,12 @@
connection = (php_oci_connection *) ecalloc(1, 
sizeof(php_oci_connection));
connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len+1);
connection-is_persistent = 0;
-   }
-   else {
+   } else {
connection = (php_oci_connection *) calloc(1, 
sizeof(php_oci_connection));
connection-hash_key = zend_strndup(hashed_details.c, 
hashed_details.len);
connection-is_persistent = 1;
}
-   }
-   else {
+   } else {
connection = (php_oci_connection *) ecalloc(1, 
sizeof(php_oci_connection));
connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len+1);
connection-is_persistent = 0;
@@ -1180,8 +1173,7 @@
connection-idle_expiry = (OCI_G(persistent_timeout)  

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-08-09 Thread Antony Dovgal
tony2001Wed Aug  9 10:16:21 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix #8112 (Persistent connections misbehave when Apache process times out)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.311r2=1.312diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.311 php-src/ext/oci8/oci8.c:1.312
--- php-src/ext/oci8/oci8.c:1.311   Sun Aug  6 14:09:46 2006
+++ php-src/ext/oci8/oci8.c Wed Aug  9 10:16:20 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.311 2006/08/06 14:09:46 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.312 2006/08/09 10:16:20 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -668,7 +668,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.311 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.312 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1760,6 +1760,17 @@
connection = (php_oci_connection *)le-ptr;
 
if (connection-used_this_request) {
+   if ((PG(connection_status)  PHP_CONNECTION_TIMEOUT)) {
+   /* call OCIBreak() on timeout to avoid 
appearance of deadlocked persistent connections */
+   connection-errcode = PHP_OCI_CALL(OCIBreak, 
(connection-svc, connection-err));
+   if (connection-errcode != OCI_SUCCESS) {
+   php_oci_error(connection-err, 
connection-errcode TSRMLS_CC);
+   PHP_OCI_HANDLE_ERROR(connection, 
connection-errcode);
+   /* OCIBreak() failed. delete the 
connection */
+   return 1;
+   }
+   }
+
if (connection-descriptors) {
zend_hash_destroy(connection-descriptors);
efree(connection-descriptors);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-08-06 Thread Antony Dovgal
tony2001Sun Aug  6 14:09:46 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  long - int
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.310r2=1.311diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.310 php-src/ext/oci8/oci8.c:1.311
--- php-src/ext/oci8/oci8.c:1.310   Sat Aug  5 20:56:12 2006
+++ php-src/ext/oci8/oci8.c Sun Aug  6 14:09:46 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.310 2006/08/05 20:56:12 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.311 2006/08/06 14:09:46 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -668,7 +668,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.310 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.311 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1057,11 +1057,10 @@
else if (!persistent  zend_hash_find(EG(regular_list), 
hashed_details.c, hashed_details.len+1, (void **) le) == SUCCESS) {
found = 1;
if (le-type == le_index_ptr) {
-   int type;
-   long link;
+   int type, link;
void *ptr;
 
-   link = (long) le-ptr;
+   link = (int) le-ptr;
ptr = zend_list_find(link,type);
if (ptr  (type == le_connection)) {
connection = (php_oci_connection *)ptr;

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-08-05 Thread Antony Dovgal
tony2001Sat Aug  5 20:56:12 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix PECL bug #7827
  add small optimization - no need to do anything if hash lookup failed, just 
move along
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.309r2=1.310diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.309 php-src/ext/oci8/oci8.c:1.310
--- php-src/ext/oci8/oci8.c:1.309   Tue Aug  1 12:08:10 2006
+++ php-src/ext/oci8/oci8.c Sat Aug  5 20:56:12 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.309 2006/08/01 12:08:10 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.310 2006/08/05 20:56:12 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -48,6 +48,7 @@
 
 #include php_oci8.h
 #include php_oci8_int.h
+#include zend_hash.h
 
 ZEND_DECLARE_MODULE_GLOBALS(oci)
 #if (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION  1) || (PHP_MAJOR_VERSION  
5)
@@ -667,7 +668,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.309 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.310 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1001,6 +1002,13 @@
smart_str_appendl_ex(hashed_details, oci8___, sizeof(oci8___) - 1, 
0);
smart_str_appendl_ex(hashed_details, username, username_len, 0);
smart_str_appendl_ex(hashed_details, __, sizeof(__) - 1, 0);
+   if (password_len) {
+   ulong password_hash;
+   password_hash = zend_inline_hash_func(password, password_len);
+   smart_str_append_unsigned_ex(hashed_details, password_hash, 0);
+   }
+   smart_str_appendl_ex(hashed_details, __, sizeof(__) - 1, 0);
+
if (dbname) {
smart_str_appendl_ex(hashed_details, dbname, dbname_len, 0);
}
@@ -1037,14 +1045,17 @@
}

if (!exclusive  !new_password) {
-   
+   zend_bool found = 0;
+
if (persistent  zend_hash_find(EG(persistent_list), 
hashed_details.c, hashed_details.len+1, (void **) le) == SUCCESS) {
+   found = 1;
/* found */
if (le-type == le_pconnection) {
connection = (php_oci_connection *)le-ptr; 
}
}
else if (!persistent  zend_hash_find(EG(regular_list), 
hashed_details.c, hashed_details.len+1, (void **) le) == SUCCESS) {
+   found = 1;
if (le-type == le_index_ptr) {
int type;
long link;
@@ -1106,8 +1117,7 @@
connection = NULL;
goto open;
}
-   }
-   else {
+   } else if (found) {
/* found something, but it's not a connection, delete 
it */
if (persistent) {
zend_hash_del(EG(persistent_list), 
hashed_details.c, hashed_details.len+1);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-08-01 Thread Antony Dovgal
tony2001Tue Aug  1 12:08:10 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  improve error message on Win32
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.308r2=1.309diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.308 php-src/ext/oci8/oci8.c:1.309
--- php-src/ext/oci8/oci8.c:1.308   Mon Jul 31 10:28:46 2006
+++ php-src/ext/oci8/oci8.c Tue Aug  1 12:08:10 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.308 2006/07/31 10:28:46 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.309 2006/08/01 12:08:10 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -667,7 +667,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.308 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.309 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1189,7 +1189,11 @@
 
if (OCI_G(errcode) != OCI_SUCCESS) {
 #ifdef HAVE_OCI_INSTANT_CLIENT
+# ifdef PHP_WIN32
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
PHP_OCI_INIT_FUNC_NAME () failed. There is something wrong with your system - 
please check that PATH includes the directory with Oracle Instant Client 
libraries);
+# else
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
PHP_OCI_INIT_FUNC_NAME () failed. There is something wrong with your system - 
please check that LD_LIBRARY_PATH includes the directory with Oracle Instant 
Client libraries);
+# endif
 #else
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
PHP_OCI_INIT_FUNC_NAME () failed. There is something wrong with your system - 
please check that ORACLE_HOME is set and points to the right directory);
 #endif

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-06-28 Thread Antony Dovgal
tony2001Wed Jun 28 15:03:16 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix #37931 (possible crash after database restart when using persistent 
connections)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.305r2=1.306diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.305 php-src/ext/oci8/oci8.c:1.306
--- php-src/ext/oci8/oci8.c:1.305   Fri Jun 23 08:25:58 2006
+++ php-src/ext/oci8/oci8.c Wed Jun 28 15:03:16 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.305 2006/06/23 08:25:58 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.306 2006/06/28 15:03:16 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -667,7 +667,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.305 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.306 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1089,8 +1089,8 @@
}
}
/* server died */
+   connection-is_open = 0;
zend_hash_del(EG(persistent_list), 
hashed_details.c, hashed_details.len+1);
-   php_oci_connection_close(connection 
TSRMLS_CC);
connection = NULL;
goto open;
}

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-06-23 Thread Antony Dovgal
tony2001Fri Jun 23 08:25:58 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix typo and bug #37886
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.304r2=1.305diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.304 php-src/ext/oci8/oci8.c:1.305
--- php-src/ext/oci8/oci8.c:1.304   Wed Jun 21 10:51:55 2006
+++ php-src/ext/oci8/oci8.c Fri Jun 23 08:25:58 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.304 2006/06/21 10:51:55 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.305 2006/06/23 08:25:58 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -667,7 +667,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.304 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.305 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1007,7 +1007,7 @@
 
 #if HAVE_OCI_ENV_NLS_CREATE
if (charset  *charset) {
-   smart_str_appends_ex(hashed_details, charset, 1);
+   smart_str_appends_ex(hashed_details, charset, 0);
}
else {
size_t rsize = 0;

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-06-19 Thread Antony Dovgal
tony2001Mon Jun 19 18:21:19 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  display oci8 version in phpinfo()
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.302r2=1.303diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.302 php-src/ext/oci8/oci8.c:1.303
--- php-src/ext/oci8/oci8.c:1.302   Tue Jun 13 13:12:19 2006
+++ php-src/ext/oci8/oci8.c Mon Jun 19 18:21:19 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.302 2006/06/13 13:12:19 dmitry Exp $ */
+/* $Id: oci8.c,v 1.303 2006/06/19 18:21:19 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -371,7 +371,7 @@
PHP_RINIT(oci),   /* per-request startup function */
PHP_RSHUTDOWN(oci),   /* per-request shutdown function */
PHP_MINFO(oci),   /* information function */
-   1.1,
+   1.2.1,
PHP_MODULE_GLOBALS(oci),  /* globals descriptor */
PHP_GINIT(oci),   /* globals ctor */
NULL, /* globals dtor */
@@ -651,7 +651,8 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.302 $);
+   php_info_print_table_row(2, Version, 1.2.1);
+   php_info_print_table_row(2, Revision, $Revision: 1.303 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_interface.c

2006-06-05 Thread Antony Dovgal
tony2001Mon Jun  5 07:34:00 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8_interface.c oci8.c 
  Log:
  fix OCIPasswordChange() parameters (patch by pholdaway at technocom-wireless 
dot com)
  prevent username. password and new password from being empty
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8_interface.c?r1=1.15r2=1.16diff_format=u
Index: php-src/ext/oci8/oci8_interface.c
diff -u php-src/ext/oci8/oci8_interface.c:1.15 
php-src/ext/oci8/oci8_interface.c:1.16
--- php-src/ext/oci8/oci8_interface.c:1.15  Tue Mar 28 09:13:22 2006
+++ php-src/ext/oci8/oci8_interface.c   Mon Jun  5 07:34:00 2006
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_interface.c,v 1.15 2006/03/28 09:13:22 tony2001 Exp $ */
+/* $Id: oci8_interface.c,v 1.16 2006/06/05 07:34:00 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1679,12 +1679,38 @@
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() 
TSRMLS_CC, rsss, z_connection, user, user_len, pass_old, pass_old_len, 
pass_new, pass_new_len) == SUCCESS) {
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
 
+   if (!user_len) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, username 
cannot be empty);
+   RETURN_FALSE;
+   }
+   if (!pass_old_len) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, old 
password cannot be empty);
+   RETURN_FALSE;
+   }
+   if (!pass_new_len) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, new 
password cannot be empty);
+   RETURN_FALSE;
+   }
+
if (php_oci_password_change(connection, user, user_len, 
pass_old, pass_old_len, pass_new, pass_new_len TSRMLS_CC)) {
RETURN_FALSE;
}
RETURN_TRUE;
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 
ZEND_NUM_ARGS() TSRMLS_CC, , dbname, dbname_len, user, user_len, 
pass_old, pass_old_len, pass_new, pass_new_len) == SUCCESS) {
 
+   if (!user_len) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, username 
cannot be empty);
+   RETURN_FALSE;
+   }
+   if (!pass_old_len) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, old 
password cannot be empty);
+   RETURN_FALSE;
+   }
+   if (!pass_new_len) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, new 
password cannot be empty);
+   RETURN_FALSE;
+   }
+
connection = php_oci_do_connect_ex(user, user_len, pass_old, 
pass_old_len, pass_new, pass_new_len, dbname, dbname_len, NULL, OCI_DEFAULT, 0, 
0 TSRMLS_CC);
if (!connection) {
RETURN_FALSE;
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.300r2=1.301diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.300 php-src/ext/oci8/oci8.c:1.301
--- php-src/ext/oci8/oci8.c:1.300   Mon May 29 10:59:15 2006
+++ php-src/ext/oci8/oci8.c Mon Jun  5 07:34:00 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.300 2006/05/29 10:59:15 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.301 2006/06/05 07:34:00 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -647,7 +647,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.300 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.301 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1264,7 +1264,7 @@
 
if (new_password) {
/* try to change password if new one was provided {{{ */
-   OCI_G(errcode) = PHP_OCI_CALL(OCIPasswordChange, 
(connection-svc, OCI_G(err), (text *)username, username_len+1, (text 
*)password, password_len+1, (text *)new_password, new_password_len+1, 
OCI_AUTH));
+   OCI_G(errcode) = PHP_OCI_CALL(OCIPasswordChange, 
(connection-svc, OCI_G(err), (text *)username, username_len, (text *)password, 
password_len, (text *)new_password, new_password_len, OCI_AUTH));
 
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1496,7 +1496,7 @@
  Change password for the user with the username given */
 int php_oci_password_change(php_oci_connection *connection, char *user, int 
user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len 

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-05-29 Thread Antony Dovgal
tony2001Mon May 29 10:59:15 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix #37531 (oci8 persistent connection corruption)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.299r2=1.300diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.299 php-src/ext/oci8/oci8.c:1.300
--- php-src/ext/oci8/oci8.c:1.299   Thu May 18 13:20:00 2006
+++ php-src/ext/oci8/oci8.c Mon May 29 10:59:15 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.299 2006/05/18 13:20:00 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.300 2006/05/29 10:59:15 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -647,7 +647,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.299 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.300 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1055,10 +1055,14 @@
/* server died */
}
else {
+   int rsrc_type;
+
/* okay, the connection 
is open and the server is still alive */

connection-used_this_request = 1;

smart_str_free_ex(hashed_details, 0);
-   if 
(zend_list_addref(connection-rsrc_id) == FAILURE) {
+   if 
(zend_list_find(connection-rsrc_id, rsrc_type)  (rsrc_type == 
le_pconnection)  zend_list_addref(connection-rsrc_id) == SUCCESS) {
+   /* do nothing */
+   } else {

connection-rsrc_id = zend_list_insert(connection, le_pconnection);
}
return connection;

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-05-10 Thread Antony Dovgal
tony2001Wed May 10 10:06:57 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix #37392 (Unnecessary call to OCITransRollback() at the end of request)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.297r2=1.298diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.297 php-src/ext/oci8/oci8.c:1.298
--- php-src/ext/oci8/oci8.c:1.297   Wed Apr 12 19:22:12 2006
+++ php-src/ext/oci8/oci8.c Wed May 10 10:06:57 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.297 2006/04/12 19:22:12 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.298 2006/05/10 10:06:57 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -647,7 +647,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.297 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.298 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1718,7 +1718,9 @@
connection-descriptors = NULL;
}

-   php_oci_connection_rollback(connection TSRMLS_CC);
+   if (connection-needs_commit) {
+   php_oci_connection_rollback(connection 
TSRMLS_CC);
+   }

if (OCI_G(persistent_timeout)  0) {
connection-idle_expiry = timestamp + 
OCI_G(persistent_timeout);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-04-12 Thread Antony Dovgal
tony2001Wed Apr 12 13:38:05 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  MF51: fix #37055 (incorrect reference counting for persistent OCI8 
connections)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.294r2=1.295diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.294 php-src/ext/oci8/oci8.c:1.295
--- php-src/ext/oci8/oci8.c:1.294   Wed Mar 22 09:46:13 2006
+++ php-src/ext/oci8/oci8.c Wed Apr 12 13:38:05 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.294 2006/03/22 09:46:13 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.295 2006/04/12 13:38:05 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -645,7 +645,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.294 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.295 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1056,7 +1056,7 @@
/* okay, the connection 
is open and the server is still alive */

connection-used_this_request = 1;

smart_str_free_ex(hashed_details, 0);
-   connection-rsrc_id = 
zend_list_insert(connection, le_pconnection);
+   
zend_list_addref(connection-rsrc_id);
return connection;
}
}

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-04-12 Thread Antony Dovgal
tony2001Wed Apr 12 17:59:57 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  MF51: correct fix for bug #37055
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.295r2=1.296diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.295 php-src/ext/oci8/oci8.c:1.296
--- php-src/ext/oci8/oci8.c:1.295   Wed Apr 12 13:38:05 2006
+++ php-src/ext/oci8/oci8.c Wed Apr 12 17:59:57 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.295 2006/04/12 13:38:05 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.296 2006/04/12 17:59:57 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -645,7 +645,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.295 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.296 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1056,7 +1056,9 @@
/* okay, the connection 
is open and the server is still alive */

connection-used_this_request = 1;

smart_str_free_ex(hashed_details, 0);
-   
zend_list_addref(connection-rsrc_id);
+   if 
(zend_list_addref(connection-rsrc_id) == FAILURE) {
+   
connection-rsrc_id = zend_list_insert(connection, le_pconnection);
+   }
return connection;
}
}

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_statement.c /ext/oci8/tests bind_long.phpt bind_long_raw.phpt bind_raw.phpt test.gif

2006-04-12 Thread Antony Dovgal
tony2001Wed Apr 12 19:22:12 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_statement.c 
/php-src/ext/oci8/tests bind_long.phpt bind_long_raw.phpt 
bind_raw.phpt test.gif 
  Log:
  MF51: fix #37059 (oci_bind_by_name() doesn't support RAW and LONG RAW fields)
  add tests
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.296r2=1.297diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.296 php-src/ext/oci8/oci8.c:1.297
--- php-src/ext/oci8/oci8.c:1.296   Wed Apr 12 17:59:57 2006
+++ php-src/ext/oci8/oci8.c Wed Apr 12 19:22:12 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.296 2006/04/12 17:59:57 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.297 2006/04/12 19:22:12 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -541,6 +541,8 @@
REGISTER_LONG_CONSTANT(SQLT_FLT,SQLT_FLT, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(SQLT_UIN,SQLT_UIN, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(SQLT_LNG,SQLT_LNG, CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(SQLT_LBI,SQLT_LBI, CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(SQLT_BIN,SQLT_BIN, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(SQLT_ODT,SQLT_ODT, CONST_CS | 
CONST_PERSISTENT);
 #if defined(HAVE_OCI_INSTANT_CLIENT) || (defined(OCI_MAJOR_VERSION)  
OCI_MAJOR_VERSION  10)
REGISTER_LONG_CONSTANT(SQLT_BDOUBLE,SQLT_BDOUBLE, CONST_CS | 
CONST_PERSISTENT);
@@ -645,7 +647,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.296 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.297 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.18r2=1.19diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.18 
php-src/ext/oci8/oci8_statement.c:1.19
--- php-src/ext/oci8/oci8_statement.c:1.18  Sat Mar 18 22:06:45 2006
+++ php-src/ext/oci8/oci8_statement.c   Wed Apr 12 19:22:12 2006
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_statement.c,v 1.18 2006/03/18 22:06:45 tony2001 Exp $ */
+/* $Id: oci8_statement.c,v 1.19 2006/04/12 19:22:12 tony2001 Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -493,6 +493,9 @@
case SQLT_BIN:
default:
define_type = SQLT_CHR;
+   if (outcol-data_type == SQLT_BIN) {
+   define_type = SQLT_BIN;
+   }
if ((outcol-data_type == SQLT_DAT) || 
(outcol-data_type == SQLT_NUM)
 #ifdef SQLT_TIMESTAMP
|| (outcol-data_type == 
SQLT_TIMESTAMP)
@@ -813,6 +816,9 @@
mode = OCI_DEFAULT;
break;

+   case SQLT_LBI:
+   case SQLT_BIN:
+   case SQLT_LNG:
case SQLT_CHR:
/* this is the default case when type was not specified 
*/
convert_to_string(var);
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/tests/bind_long.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/oci8/tests/bind_long.phpt
diff -u /dev/null php-src/ext/oci8/tests/bind_long.phpt:1.2
--- /dev/null   Wed Apr 12 19:22:12 2006
+++ php-src/ext/oci8/tests/bind_long.phpt   Wed Apr 12 19:22:12 2006
@@ -0,0 +1,38 @@
+--TEST--
+bind LONG field
+--SKIPIF--
+?php if (!extension_loaded('oci8')) die(skip no oci8 extension); ?
+--FILE--
+?php
+
+require dirname(__FILE__)./connect.inc;
+
+$stmt = oci_parse($c, create table phptestlng( id number(10), fileimage 
long));
+oci_execute($stmt);
+
+$stmt = oci_parse ($c, insert into phptestlng (id, fileimage) values (:id, 
:fileimage));
+$i=1;
+$fileimage = file_get_contents( dirname(__FILE__)./test.gif);
+
+oci_bind_by_name( $stmt, :id, $i, -1);
+oci_bind_by_name( $stmt, :fileimage, $fileimage, -1, SQLT_LNG);
+oci_execute($stmt, OCI_DEFAULT);
+oci_commit($c);
+
+$stmt = oci_parse($c, SELECT fileimage FROM phptestlng);
+oci_execute($stmt);
+
+$row = oci_fetch_row($stmt);
+var_dump(md5($row[0]));
+var_dump(strlen($row[0]));
+
+$stmt = oci_parse($c, drop table phptestlng);
+oci_execute($stmt);
+
+echo Done\n;
+
+?
+--EXPECT--
+string(32) d04e7036e2f4221abc88fd14e960a45b
+int(2523)
+Done

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-03-22 Thread Antony Dovgal
tony2001Wed Mar 22 09:46:13 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  MF51: fix #36820 (Privileged connection with an Oracle password file fails)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.293r2=1.294diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.293 php-src/ext/oci8/oci8.c:1.294
--- php-src/ext/oci8/oci8.c:1.293   Tue Mar  7 07:45:59 2006
+++ php-src/ext/oci8/oci8.c Wed Mar 22 09:46:13 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.293 2006/03/07 07:45:59 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.294 2006/03/22 09:46:13 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -645,7 +645,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.293 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.294 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1286,7 +1286,11 @@
case OCI_SYSDBA:
case OCI_SYSOPER:
default:
-   OCI_G(errcode) = PHP_OCI_CALL(OCISessionBegin, 
(connection-svc, OCI_G(err), connection-session, (ub4) OCI_CRED_EXT, (ub4) 
session_mode));
+   if (username_len == 1  username[0] == '/'  
password_len == 0) {
+   OCI_G(errcode) = 
PHP_OCI_CALL(OCISessionBegin, (connection-svc, OCI_G(err), 
connection-session, (ub4) OCI_CRED_EXT, (ub4) session_mode));
+   } else {
+   OCI_G(errcode) = 
PHP_OCI_CALL(OCISessionBegin, (connection-svc, OCI_G(err), 
connection-session, (ub4) OCI_CRED_RDBMS, (ub4) session_mode));
+   }
break;
}
 

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-03-06 Thread Antony Dovgal
tony2001Tue Mar  7 07:45:59 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  add workaround for Oracle server crash, use OCIServerVersion() instead of 
OCIPing()
  fix #36250 (PHP Causes ORA-07445 Core dump in Oracle server 9.2.x)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.292r2=1.293diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.292 php-src/ext/oci8/oci8.c:1.293
--- php-src/ext/oci8/oci8.c:1.292   Wed Jan 18 10:11:12 2006
+++ php-src/ext/oci8/oci8.c Tue Mar  7 07:45:59 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.292 2006/01/18 10:11:12 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.293 2006/03/07 07:45:59 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -645,7 +645,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.292 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.293 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -988,7 +988,7 @@
smart_str_appends_ex(hashed_details, charset, 1);
}
else {
-   size_t rsize;
+   size_t rsize = 0;
 
PHP_OCI_CALL(OCINlsEnvironmentVariableGet, (charsetid, 2, 
OCI_NLS_CHARSET_ID, 0, rsize));
smart_str_append_unsigned_ex(hashed_details, charsetid, 0);
@@ -1347,8 +1347,8 @@
  * Ping connection. Uses OCIPing() or OCIServerVersion() depending on the 
Oracle Client version */
 static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC)
 {
-#if OCI_MAJOR_VERSION = 10  OCI_MINOR_VERSION = 2
-   /* OCIPing() is usable only in 10.2 */
+   /* OCIPing() crashes Oracle servers older than 10.2 */
+#if 0
OCI_G(errcode) = PHP_OCI_CALL(OCIPing, (connection-svc, OCI_G(err), 
OCI_DEFAULT));
 #else
char version[256];

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-01-18 Thread Antony Dovgal
tony2001Wed Jan 18 10:11:12 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  reorganize resource destruction.
  - use one helper function for all resource types
  - destroy all resources when connections are still available
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.291r2=1.292diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.291 php-src/ext/oci8/oci8.c:1.292
--- php-src/ext/oci8/oci8.c:1.291   Tue Jan 17 23:44:11 2006
+++ php-src/ext/oci8/oci8.c Wed Jan 18 10:11:12 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.291 2006/01/17 23:44:11 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.292 2006/01/18 10:11:12 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -89,8 +89,7 @@
 
 static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC);
 #ifdef ZTS
-static int php_oci_statement_helper(zend_rsrc_list_entry *le TSRMLS_DC);
-static int php_oci_regular_helper(zend_rsrc_list_entry *le TSRMLS_DC);
+static int php_oci_list_helper(zend_rsrc_list_entry *le, void *le_type 
TSRMLS_DC);
 #endif
 static int php_oci_connection_ping(php_oci_connection * TSRMLS_DC);
 static int php_oci_connection_status(php_oci_connection * TSRMLS_DC);
@@ -624,14 +623,16 @@
 PHP_RSHUTDOWN_FUNCTION(oci)
 {
 #ifdef ZTS
-   zend_hash_apply(EG(regular_list), (apply_func_t) 
php_oci_statement_helper TSRMLS_CC);
+   zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_descriptor TSRMLS_CC);
+   zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_collection TSRMLS_CC);
+   zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_statement TSRMLS_CC);
 #endif
 
/* check persistent connections and do the necessary actions if needed 
*/
zend_hash_apply(EG(persistent_list), (apply_func_t) 
php_oci_persistent_helper TSRMLS_CC);
 
 #ifdef ZTS
-   zend_hash_apply(EG(regular_list), (apply_func_t) 
php_oci_regular_helper TSRMLS_CC);
+   zend_hash_apply_with_argument(EG(regular_list), (apply_func_arg_t) 
php_oci_list_helper, (void *)le_connection TSRMLS_CC);
php_oci_cleanup_global_handles(TSRMLS_C);
 #endif
 
@@ -644,7 +645,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.291 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.292 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1736,30 +1737,14 @@
 } /* }}} */
 
 #ifdef ZTS
-/* {{{ php_oci_regular_helper() 
- Helper function to close non-persistent connections at the end of request in 
ZTS mode */
-static int php_oci_regular_helper(zend_rsrc_list_entry *le TSRMLS_DC)
+/* {{{ php_oci_list_helper() 
+ Helper function to destroy data on thread shutdown in ZTS mode */
+static int php_oci_list_helper(zend_rsrc_list_entry *le, void *le_type 
TSRMLS_DC)
 {
-   php_oci_connection *connection;
-
-   if (le-type == le_connection) {
-   connection = (php_oci_connection *)le-ptr;
-   if (connection) {
-   return 1;
-   }
-   }
-   return 0;
-} /* }}} */
-
-/* {{{ php_oci_statement_helper() 
- Helper function to destroy statements on thread shutdown in ZTS mode */
-static int php_oci_statement_helper(zend_rsrc_list_entry *le TSRMLS_DC)
-{
-   php_oci_statement *statement;
-
-   if (le-type == le_statement) {
-   statement = (php_oci_statement *)le-ptr;
-   if (statement) {
+   int type = (int) le_type;
+   
+   if (le-type == type) {
+   if (le-ptr != NULL) {
return 1;
}
}

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-01-17 Thread Antony Dovgal
tony2001Tue Jan 17 23:44:11 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix #36055 (possible OCI8 crash in multithreaded environment)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.290r2=1.291diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.290 php-src/ext/oci8/oci8.c:1.291
--- php-src/ext/oci8/oci8.c:1.290   Tue Jan 10 08:32:49 2006
+++ php-src/ext/oci8/oci8.c Tue Jan 17 23:44:11 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.290 2006/01/10 08:32:49 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.291 2006/01/17 23:44:11 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -89,6 +89,7 @@
 
 static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC);
 #ifdef ZTS
+static int php_oci_statement_helper(zend_rsrc_list_entry *le TSRMLS_DC);
 static int php_oci_regular_helper(zend_rsrc_list_entry *le TSRMLS_DC);
 #endif
 static int php_oci_connection_ping(php_oci_connection * TSRMLS_DC);
@@ -622,6 +623,10 @@
 
 PHP_RSHUTDOWN_FUNCTION(oci)
 {
+#ifdef ZTS
+   zend_hash_apply(EG(regular_list), (apply_func_t) 
php_oci_statement_helper TSRMLS_CC);
+#endif
+
/* check persistent connections and do the necessary actions if needed 
*/
zend_hash_apply(EG(persistent_list), (apply_func_t) 
php_oci_persistent_helper TSRMLS_CC);
 
@@ -639,7 +644,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.290 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.291 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1745,6 +1750,21 @@
}
return 0;
 } /* }}} */
+
+/* {{{ php_oci_statement_helper() 
+ Helper function to destroy statements on thread shutdown in ZTS mode */
+static int php_oci_statement_helper(zend_rsrc_list_entry *le TSRMLS_DC)
+{
+   php_oci_statement *statement;
+
+   if (le-type == le_statement) {
+   statement = (php_oci_statement *)le-ptr;
+   if (statement) {
+   return 1;
+   }
+   }
+   return 0;
+} /* }}} */
 #endif
 
 #endif /* HAVE_OCI8 */

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-01-10 Thread Antony Dovgal
tony2001Tue Jan 10 08:29:19 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  destroy regular connections in RSHUTDOWN if ZTS is used
  this fixes problem with Oracle9 (not Oracle10) and Apache2/worker - 
connections are not being closed correctly
  see #35205 and similar issues
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.288r2=1.289diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.288 php-src/ext/oci8/oci8.c:1.289
--- php-src/ext/oci8/oci8.c:1.288   Thu Jan  5 13:40:10 2006
+++ php-src/ext/oci8/oci8.c Tue Jan 10 08:29:19 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.288 2006/01/05 13:40:10 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.289 2006/01/10 08:29:19 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -88,6 +88,7 @@
 static void php_oci_collection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
 
 static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC);
+static int php_oci_regular_helper(zend_rsrc_list_entry *le TSRMLS_DC);
 static int php_oci_connection_ping(php_oci_connection * TSRMLS_DC);
 static int php_oci_connection_status(php_oci_connection * TSRMLS_DC);
 static int php_oci_connection_close(php_oci_connection * TSRMLS_DC);
@@ -623,6 +624,7 @@
zend_hash_apply(EG(persistent_list), (apply_func_t) 
php_oci_persistent_helper TSRMLS_CC);
 
 #ifdef ZTS
+   zend_hash_apply(EG(regular_list), (apply_func_t) 
php_oci_regular_helper TSRMLS_CC);
php_oci_cleanup_global_handles(TSRMLS_C);
 #endif
 
@@ -635,7 +637,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.288 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.289 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1726,4 +1728,19 @@
return 0;
 } /* }}} */
 
+/* {{{ php_oci_regular_helper() 
+ Helper function to close non-persistent connections at the end of request in 
ZTS mode */
+static int php_oci_regular_helper(zend_rsrc_list_entry *le TSRMLS_DC)
+{
+   php_oci_connection *connection;
+
+   if (le-type == le_connection) {
+   connection = (php_oci_connection *)le-ptr;
+   if (connection) {
+   return 1;
+   }
+   }
+   return 0;
+} /* }}} */
+
 #endif /* HAVE_OCI8 */

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2006-01-10 Thread Antony Dovgal
tony2001Tue Jan 10 08:32:50 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  silence compile warning in non-ZTS mode
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.289r2=1.290diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.289 php-src/ext/oci8/oci8.c:1.290
--- php-src/ext/oci8/oci8.c:1.289   Tue Jan 10 08:29:19 2006
+++ php-src/ext/oci8/oci8.c Tue Jan 10 08:32:49 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.289 2006/01/10 08:29:19 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.290 2006/01/10 08:32:49 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -88,7 +88,9 @@
 static void php_oci_collection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
 
 static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC);
+#ifdef ZTS
 static int php_oci_regular_helper(zend_rsrc_list_entry *le TSRMLS_DC);
+#endif
 static int php_oci_connection_ping(php_oci_connection * TSRMLS_DC);
 static int php_oci_connection_status(php_oci_connection * TSRMLS_DC);
 static int php_oci_connection_close(php_oci_connection * TSRMLS_DC);
@@ -637,7 +639,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.289 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.290 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -1728,6 +1730,7 @@
return 0;
 } /* }}} */
 
+#ifdef ZTS
 /* {{{ php_oci_regular_helper() 
  Helper function to close non-persistent connections at the end of request in 
ZTS mode */
 static int php_oci_regular_helper(zend_rsrc_list_entry *le TSRMLS_DC)
@@ -1742,5 +1745,6 @@
}
return 0;
 } /* }}} */
+#endif
 
 #endif /* HAVE_OCI8 */

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_interface.c oci8_lob.c php_oci8_int.h /ext/oci8/tests descriptors.phpt

2006-01-05 Thread Antony Dovgal
tony2001Thu Jan  5 13:40:10 2006 UTC

  Added files: 
/php-src/ext/oci8/tests descriptors.phpt 

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_interface.c oci8_lob.c php_oci8_int.h 
  Log:
  delete descriptor from the hash and avoid crashes on commit/rollback
  
  http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.287r2=1.288diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.287 php-src/ext/oci8/oci8.c:1.288
--- php-src/ext/oci8/oci8.c:1.287   Sun Jan  1 13:09:52 2006
+++ php-src/ext/oci8/oci8.c Thu Jan  5 13:40:10 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.287 2006/01/01 13:09:52 sniper Exp $ */
+/* $Id: oci8.c,v 1.288 2006/01/05 13:40:10 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -635,7 +635,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.287 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.288 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -761,7 +761,7 @@
 /* {{{ php_oci_column_hash_dtor()
  Column hash destructor */
 void php_oci_column_hash_dtor(void *data)
-{  
+{
php_oci_out_column *column = (php_oci_out_column *) data;
TSRMLS_FETCH();
 
@@ -790,10 +790,25 @@
php_oci_descriptor *descriptor = *(php_oci_descriptor **)data;
TSRMLS_FETCH();

-   if (descriptor-buffering == PHP_OCI_LOB_BUFFER_USED  
(descriptor-type == OCI_DTYPE_LOB || descriptor-type == OCI_DTYPE_FILE)) {
+   if (descriptor  descriptor-buffering == PHP_OCI_LOB_BUFFER_USED  
(descriptor-type == OCI_DTYPE_LOB || descriptor-type == OCI_DTYPE_FILE)) {
php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE TSRMLS_CC);
descriptor-buffering = PHP_OCI_LOB_BUFFER_ENABLED;
}
+   data = NULL;
+}
+/* }}} */
+
+/* {{{ php_oci_descriptor_delete_from_hash()
+ Delete descriptor from the hash */
+int php_oci_descriptor_delete_from_hash(void *data, void *id TSRMLS_DC)
+{
+   php_oci_descriptor *descriptor = *(php_oci_descriptor **)data;
+   int *desc_id = (int *) id;
+   
+   if (descriptor  desc_id  descriptor-id == *desc_id) {
+   return 1;
+   }
+   return 0;
 }
 /* }}} */
 
@@ -1379,10 +1394,6 @@
  Commit connection */
 int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC)
 {
-   if (connection-descriptors) {
-   zend_hash_apply(connection-descriptors,(apply_func_t) 
php_oci_descriptor_flush_hash_dtor TSRMLS_CC);
-   }
-
connection-errcode = PHP_OCI_CALL(OCITransCommit, (connection-svc, 
connection-err, (ub4) 0));
connection-needs_commit = 0;
 
@@ -1683,14 +1694,14 @@
connection = (php_oci_connection *)le-ptr;
 
if (connection-used_this_request) {
-   php_oci_connection_rollback(connection TSRMLS_CC);
-   
if (connection-descriptors) {
zend_hash_destroy(connection-descriptors);
efree(connection-descriptors);
connection-descriptors = NULL;
}

+   php_oci_connection_rollback(connection TSRMLS_CC);
+   
if (OCI_G(persistent_timeout)  0) {
connection-idle_expiry = timestamp + 
OCI_G(persistent_timeout);
}
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8_interface.c?r1=1.9r2=1.10diff_format=u
Index: php-src/ext/oci8/oci8_interface.c
diff -u php-src/ext/oci8/oci8_interface.c:1.9 
php-src/ext/oci8/oci8_interface.c:1.10
--- php-src/ext/oci8/oci8_interface.c:1.9   Sun Jan  1 13:09:52 2006
+++ php-src/ext/oci8/oci8_interface.c   Thu Jan  5 13:40:10 2006
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_interface.c,v 1.9 2006/01/01 13:09:52 sniper Exp $ */
+/* $Id: oci8_interface.c,v 1.10 2006/01/05 13:40:10 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1058,7 +1058,9 @@
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
 
if (connection-descriptors) {
-   zend_hash_apply(connection-descriptors,(apply_func_t) 
php_oci_descriptor_flush_hash_dtor TSRMLS_CC);
+   zend_hash_destroy(connection-descriptors);
+   efree(connection-descriptors);
+   connection-descriptors = NULL;
}
 
if (php_oci_connection_rollback(connection TSRMLS_CC)) {
@@ -1082,7 +1084,9 @@

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2005-09-08 Thread Antony Dovgal
tony2001Thu Sep  8 09:16:27 2005 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  use connections instead of links everywhere to avoid possible confusion
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.273r2=1.274ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.273 php-src/ext/oci8/oci8.c:1.274
--- php-src/ext/oci8/oci8.c:1.273   Tue Sep  6 17:42:26 2005
+++ php-src/ext/oci8/oci8.c Thu Sep  8 09:16:24 2005
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.273 2005/09/06 21:42:26 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.274 2005/09/08 13:16:24 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -609,12 +609,12 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.273 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.274 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
-   php_info_print_table_row(2, Active Persistent Links, buf);
+   php_info_print_table_row(2, Active Persistent Connections, buf);
sprintf(buf, %ld, OCI_G(num_links));
-   php_info_print_table_row(2, Active Links, buf);
+   php_info_print_table_row(2, Active Connections, buf);
 
 #if !defined(PHP_WIN32)  !defined(HAVE_OCI_INSTANT_CLIENT)
php_info_print_table_row(2, Oracle Version, PHP_OCI8_VERSION );
@@ -1017,7 +1017,7 @@

if (OCI_G(max_persistent)!=-1  
OCI_G(num_persistent)=OCI_G(max_persistent)) {
/* all persistent connactions are in use, 
fallback to non-persistent connection creation */
-   php_error_docref(NULL TSRMLS_CC, E_NOTICE, Too 
many open persistent links (%ld), OCI_G(num_persistent));
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, Too 
many open persistent connections (%ld), OCI_G(num_persistent));
alloc_non_persistent = 1;
}
}

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_collection.c oci8_interface.c oci8_lob.c oci8_statement.c php_oci8.h php_oci8_int.h

2005-09-06 Thread Edin Kadribasic
edink   Tue Sep  6 17:30:30 2005 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_collection.c oci8_interface.c 
oci8_lob.c oci8_statement.c php_oci8.h 
php_oci8_int.h 
  Log:
  Remove utf-8 chars
  http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.271r2=1.272ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.271 php-src/ext/oci8/oci8.c:1.272
--- php-src/ext/oci8/oci8.c:1.271   Tue Sep  6 15:31:59 2005
+++ php-src/ext/oci8/oci8.c Tue Sep  6 17:30:25 2005
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to  |
| [EMAIL PROTECTED] so we can mail you a copy immediately.   |
+--+
-   | Authors: Stig Sæther Bakken [EMAIL PROTECTED]  
  |
+   | Authors: Stig Sæther Bakken [EMAIL PROTECTED]   
 |
|  Thies C. Arntzen [EMAIL PROTECTED] |
| Redesigned by: Antony Dovgal [EMAIL PROTECTED]   |
|Andi Gutmans [EMAIL PROTECTED]  |
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.271 2005/09/06 19:31:59 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.272 2005/09/06 21:30:25 edink Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -603,7 +603,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.271 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.272 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Links, buf);
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8_collection.c?r1=1.1r2=1.2ty=u
Index: php-src/ext/oci8/oci8_collection.c
diff -u php-src/ext/oci8/oci8_collection.c:1.1 
php-src/ext/oci8/oci8_collection.c:1.2
--- php-src/ext/oci8/oci8_collection.c:1.1  Tue Sep  6 15:31:59 2005
+++ php-src/ext/oci8/oci8_collection.c  Tue Sep  6 17:30:28 2005
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to  |
| [EMAIL PROTECTED] so we can mail you a copy immediately.   |
+--+
-   | Authors: Stig Sæther Bakken [EMAIL PROTECTED]  
  |
+   | Authors: Stig Sæther Bakken [EMAIL PROTECTED]   
 |
|  Thies C. Arntzen [EMAIL PROTECTED] |
| Redesigned by: Antony Dovgal [EMAIL PROTECTED]   |
|Andi Gutmans [EMAIL PROTECTED]  |
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: oci8_collection.c,v 1.1 2005/09/06 19:31:59 tony2001 Exp $ */
+/* $Id: oci8_collection.c,v 1.2 2005/09/06 21:30:28 edink Exp $ */
 
 
 
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8_interface.c?r1=1.1r2=1.2ty=u
Index: php-src/ext/oci8/oci8_interface.c
diff -u php-src/ext/oci8/oci8_interface.c:1.1 
php-src/ext/oci8/oci8_interface.c:1.2
--- php-src/ext/oci8/oci8_interface.c:1.1   Tue Sep  6 15:31:59 2005
+++ php-src/ext/oci8/oci8_interface.c   Tue Sep  6 17:30:28 2005
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to  |
| [EMAIL PROTECTED] so we can mail you a copy immediately.   |
+--+
-   | Authors: Stig Sæther Bakken [EMAIL PROTECTED]  
  |
+   | Authors: Stig Sæther Bakken [EMAIL PROTECTED]   
 |
|  Thies C. Arntzen [EMAIL PROTECTED] |
| Redesigned by: Antony Dovgal [EMAIL PROTECTED]   |
|Andi Gutmans [EMAIL PROTECTED]  |
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: oci8_interface.c,v 1.1 2005/09/06 19:31:59 tony2001 Exp $ */
+/* $Id: oci8_interface.c,v 1.2 2005/09/06 21:30:28 edink Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8_lob.c?r1=1.1r2=1.2ty=u
Index: php-src/ext/oci8/oci8_lob.c
diff -u php-src/ext/oci8/oci8_lob.c:1.1 php-src/ext/oci8/oci8_lob.c:1.2
--- php-src/ext/oci8/oci8_lob.c:1.1 Tue Sep  6 15:31:59 2005
+++ php-src/ext/oci8/oci8_lob.c Tue Sep  6 17:30:28 2005
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to  |
| [EMAIL PROTECTED] so we can mail you a copy immediately.   |
+--+

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c /ext/openssl openssl.c /ext/oracle oracle.c /ext/pcre php_pcre.c /ext/session mod_files.c /ext/simplexml simplexml.c /ext/snmp winsnmp.c /ext/standard as

2005-08-18 Thread Jani Taskinen
sniper  Thu Aug 18 09:34:09 2005 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
/php-src/ext/opensslopenssl.c 
/php-src/ext/oracle oracle.c 
/php-src/ext/pcre   php_pcre.c 
/php-src/ext/sessionmod_files.c 
/php-src/ext/simplexml  simplexml.c 
/php-src/ext/snmp   winsnmp.c 
/php-src/ext/standard   assert.c php_fopen_wrapper.c 
/php-src/ext/sybase_ct  php_sybase_ct.c 
  Log:
  Nuked EOLs from error messages
  http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.269r2=1.270ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.269 php-src/ext/oci8/oci8.c:1.270
--- php-src/ext/oci8/oci8.c:1.269   Wed Aug  3 10:07:32 2005
+++ php-src/ext/oci8/oci8.c Thu Aug 18 09:33:54 2005
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.269 2005/08/03 14:07:32 sniper Exp $ */
+/* $Id: oci8.c,v 1.270 2005/08/18 13:33:54 sniper Exp $ */
 
 /* TODO list:
  *
@@ -126,7 +126,7 @@
 #define CALL_OCI(call) \
 { \
if (OCI(in_call)) { \
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCI8 Recursive 
call!\n); \
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCI8 Recursive 
call!); \
exit(-1); \
} else { \
OCI(in_call)=1; \
@@ -139,7 +139,7 @@
 { \
if (OCI(in_call)) { \
retcode=-1; \
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCI8 Recursive 
call!\n); \
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, OCI8 Recursive 
call!); \
exit(-1); \
} else { \
OCI(in_call)=1; \
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.269 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.270 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
http://cvs.php.net/diff.php/php-src/ext/openssl/openssl.c?r1=1.98r2=1.99ty=u
Index: php-src/ext/openssl/openssl.c
diff -u php-src/ext/openssl/openssl.c:1.98 php-src/ext/openssl/openssl.c:1.99
--- php-src/ext/openssl/openssl.c:1.98  Wed Aug  3 10:07:35 2005
+++ php-src/ext/openssl/openssl.c   Thu Aug 18 09:33:58 2005
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: openssl.c,v 1.98 2005/08/03 14:07:35 sniper Exp $ */
+/* $Id: openssl.c,v 1.99 2005/08/18 13:33:58 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -3274,7 +3274,7 @@
 
if (cafile || capath) {
if (!SSL_CTX_load_verify_locations(ctx, cafile, 
capath)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Unable to set verify locations `%s' `%s'\n, cafile, capath);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Unable to set verify locations `%s' `%s', cafile, capath);
return NULL;
}
}
http://cvs.php.net/diff.php/php-src/ext/oracle/oracle.c?r1=1.95r2=1.96ty=u
Index: php-src/ext/oracle/oracle.c
diff -u php-src/ext/oracle/oracle.c:1.95 php-src/ext/oracle/oracle.c:1.96
--- php-src/ext/oracle/oracle.c:1.95Wed Aug  3 10:07:36 2005
+++ php-src/ext/oracle/oracle.c Thu Aug 18 09:33:59 2005
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: oracle.c,v 1.95 2005/08/03 14:07:36 sniper Exp $ */
+/* $Id: oracle.c,v 1.96 2005/08/18 13:33:59 sniper Exp $ */
 
 /* comment out the next line if you're on Oracle 7.x and don't have the olog 
call. */
@@ -565,7 +565,7 @@
 #endif
) {
ORA(db_err_conn) = *db_conn;
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Oracle: 
Connection Failed: %s\n,ora_error(db_conn-lda));
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Oracle: 
Connection Failed: %s,ora_error(db_conn-lda));
efree(hashed_details);
efree(db_conn);
RETURN_FALSE;
http://cvs.php.net/diff.php/php-src/ext/pcre/php_pcre.c?r1=1.168r2=1.169ty=u
Index: php-src/ext/pcre/php_pcre.c
diff -u php-src/ext/pcre/php_pcre.c:1.168 php-src/ext/pcre/php_pcre.c:1.169
--- php-src/ext/pcre/php_pcre.c:1.168   Wed Aug  3 10:07:37 2005
+++ php-src/ext/pcre/php_pcre.c Thu Aug 18 09:34:00 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_pcre.c,v 1.168 2005/08/03 14:07:37 sniper Exp $ */
+/* $Id: php_pcre.c,v 1.169 2005/08/18 13:34:00 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -792,7 +792,7 @@
/* Run the code */
if (zend_eval_string(code.c, retval, compiled_string_description 

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2005-06-13 Thread Antony Dovgal
tony2001Mon Jun 13 05:30:52 2005 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  destroy session after destroying error handle
  SQLT_CHR is allowed too
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.267r2=1.268ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.267 php-src/ext/oci8/oci8.c:1.268
--- php-src/ext/oci8/oci8.c:1.267   Thu Apr 28 10:10:42 2005
+++ php-src/ext/oci8/oci8.c Mon Jun 13 05:30:49 2005
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.267 2005/04/28 14:10:42 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.268 2005/06/13 09:30:49 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.267 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.268 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -1015,6 +1015,15 @@
)
);
}
+   
+   if (connection-pError) {
+   CALL_OCI(
+   OCIHandleFree(
+   (dvoid *) connection-pError, 
+   (ub4) OCI_HTYPE_ERROR
+   )
+   );
+   }
 
if (connection-session  connection-session-exclusive) {
/* close associated session when destructed */
@@ -1026,15 +1035,6 @@
efree(connection-descriptors);
}
 
-   if (connection-pError) {
-   CALL_OCI(
-   OCIHandleFree(
-   (dvoid *) connection-pError, 
-   (ub4) OCI_HTYPE_ERROR
-   )
-   );
-   }
-
oci_debug(END   _oci_conn_list_dtor: id=%d,connection-id);
 
efree(connection);
@@ -3694,6 +3694,8 @@
}
value_sz = sizeof(void*);
break;
+   case SQLT_CHR:
+   break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown or 
unsupported datatype given: %u, ocitype);
RETURN_FALSE;

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2005-04-28 Thread Antony Dovgal
tony2001Thu Apr 28 10:10:43 2005 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  handle unsupported datatype (OCIBindByName segfaults somewhere in OCI lib when
  unknown type is provided)
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.266r2=1.267ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.266 php-src/ext/oci8/oci8.c:1.267
--- php-src/ext/oci8/oci8.c:1.266   Thu Jan 20 13:39:48 2005
+++ php-src/ext/oci8/oci8.c Thu Apr 28 10:10:42 2005
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.266 2005/01/20 18:39:48 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.267 2005/04/28 14:10:42 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.266 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.267 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -3694,6 +3694,10 @@
}
value_sz = sizeof(void*);
break;
+   default:
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown or 
unsupported datatype given: %u, ocitype);
+   RETURN_FALSE;
+   break;
}

if ((ocitype == SQLT_CHR)  (value_sz == -1)) {

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2005-01-20 Thread Antony Dovgal
tony2001Thu Jan 20 13:39:49 2005 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix bug #31623 (OCILogin does not support password grace period)
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.265r2=1.266ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.265 php-src/ext/oci8/oci8.c:1.266
--- php-src/ext/oci8/oci8.c:1.265   Mon Nov 22 16:44:42 2004
+++ php-src/ext/oci8/oci8.c Thu Jan 20 13:39:48 2005
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.265 2004/11/22 21:44:42 andi Exp $ */
+/* $Id: oci8.c,v 1.266 2005/01/20 18:39:48 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.265 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.266 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -2863,7 +2863,12 @@
 
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), OCISessionBegin, OCI(error));
-   goto CLEANUP;
+   /* OCISessionBegin returns OCI_SUCCESS_WITH_INFO when
+* user's password has expired, but is still usable.
+* */
+   if (OCI(error) != OCI_SUCCESS_WITH_INFO) {
+   goto CLEANUP;
+   }
}
 
/* Free Temporary Service Context */

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-11-22 Thread Andi Gutmans
andiMon Nov 22 16:44:42 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  - Don't reuse Oracle connections in multi-threaded environments until
  - we decide to either not support ZTS connection pooling (kind of
  - pointless as PHP isn't stable in ZTS mode) or fix the 100% reproducable
  - crash bug on oci_connect() under Windows most probably due to this
  - problem.
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.264r2=1.265ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.264 php-src/ext/oci8/oci8.c:1.265
--- php-src/ext/oci8/oci8.c:1.264   Sun Nov 21 01:17:32 2004
+++ php-src/ext/oci8/oci8.c Mon Nov 22 16:44:42 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.264 2004/11/21 06:17:32 andi Exp $ */
+/* $Id: oci8.c,v 1.265 2004/11/22 21:44:42 andi Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.264 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.265 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -5840,7 +5840,7 @@
Connect to an Oracle database and log on. Returns a new session. */
 PHP_FUNCTION(oci_connect)
 {
-   oci_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 0);
+   oci_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 1);
 }
 /* }}} */
 

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-11-20 Thread Andi Gutmans
andiSun Nov 21 01:17:35 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.263r2=1.264ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.263 php-src/ext/oci8/oci8.c:1.264
--- php-src/ext/oci8/oci8.c:1.263   Sat Oct 23 05:32:44 2004
+++ php-src/ext/oci8/oci8.c Sun Nov 21 01:17:32 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.263 2004/10/23 09:32:44 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.264 2004/11/21 06:17:32 andi Exp $ */
 
 /* TODO list:
  *
@@ -576,21 +576,21 @@
);
 }
 
-static int _sessions_pcleanup(zend_llist *session_list TSRMLS_DC)
+static int _sessions_pcleanup(zend_llist *session_list)
 {
zend_llist_destroy(session_list);
 
return 1;
 }
 
-static int _session_pcleanup(oci_session *session TSRMLS_DC)
+static int _session_pcleanup(oci_session *session)
 {
_oci_close_session(session);
 
return 1;
 }
 
-static int _server_pcleanup(oci_server *server TSRMLS_DC)
+static int _server_pcleanup(oci_server *server)
 {
_oci_close_server(server);
 
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.263 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.264 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);

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



Re: [PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-11-20 Thread Andi Gutmans
Hmm my log message didn't come through. The callback prototypes don't take 
TSRMLS_CC

At 06:17 AM 11/21/2004 +, Andi Gutmans wrote:
andiSun Nov 21 01:17:35 2004 EDT
  Modified files:
/php-src/ext/oci8   oci8.c
  Log:

http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.263r2=1.264ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.263 php-src/ext/oci8/oci8.c:1.264
--- php-src/ext/oci8/oci8.c:1.263   Sat Oct 23 05:32:44 2004
+++ php-src/ext/oci8/oci8.c Sun Nov 21 01:17:32 2004
@@ -22,7 +22,7 @@
+--+
  */
-/* $Id: oci8.c,v 1.263 2004/10/23 09:32:44 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.264 2004/11/21 06:17:32 andi Exp $ */
 /* TODO list:
  *
@@ -576,21 +576,21 @@
);
 }
-static int _sessions_pcleanup(zend_llist *session_list TSRMLS_DC)
+static int _sessions_pcleanup(zend_llist *session_list)
 {
zend_llist_destroy(session_list);
return 1;
 }
-static int _session_pcleanup(oci_session *session TSRMLS_DC)
+static int _session_pcleanup(oci_session *session)
 {
_oci_close_session(session);
return 1;
 }
-static int _server_pcleanup(oci_server *server TSRMLS_DC)
+static int _server_pcleanup(oci_server *server)
 {
_oci_close_server(server);
@@ -786,7 +786,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.263 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.264 $);
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-11-20 Thread Antony Dovgal
On Sat, 20 Nov 2004 22:18:51 -0800
Andi Gutmans [EMAIL PROTECTED] wrote:

 Hmm my log message didn't come through. The callback prototypes don't
 take TSRMLS_CC

Thanks, Andi, it was quite clear from the diff =)

Btw, something very strange is happening:
you committed it to HEAD, but it seems, that the patch appeared in 5_0 instead.

I've checked and rechecked it a couple of times and still can't believe my eyes.
Furthermore, I've checked out a clean HEAD from the CVS and your patch is not 
there.

CVS is b0rked ?

-- 
Wbr,
Antony Dovgal aka tony2001
[EMAIL PROTECTED] || [EMAIL PROTECTED]

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



Re: [PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-11-20 Thread Andi Gutmans
Weird. Did you look via web interface or CVS?
When  check with cvs update -A and cvs update -r PHP_5_0 I do get the 
result as seen by the CVS commit message (HEAD is changed, PHP_5_0 isn't). 
Any chance you are doing something wrong? :)

Andi
At 09:59 AM 11/21/2004 +0300, Antony Dovgal wrote:
On Sat, 20 Nov 2004 22:18:51 -0800
Andi Gutmans [EMAIL PROTECTED] wrote:
 Hmm my log message didn't come through. The callback prototypes don't
 take TSRMLS_CC
Thanks, Andi, it was quite clear from the diff =)
Btw, something very strange is happening:
you committed it to HEAD, but it seems, that the patch appeared in 5_0 
instead.

I've checked and rechecked it a couple of times and still can't believe my 
eyes.
Furthermore, I've checked out a clean HEAD from the CVS and your patch is 
not there.

CVS is b0rked ?
--
Wbr,
Antony Dovgal aka tony2001
[EMAIL PROTECTED] || [EMAIL PROTECTED]
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-11-20 Thread Antony Dovgal
On Sat, 20 Nov 2004 23:07:49 -0800
Andi Gutmans [EMAIL PROTECTED] wrote:

 Weird. Did you look via web interface or CVS?
 When  check with cvs update -A and cvs update -r PHP_5_0 I do get the 
 result as seen by the CVS commit message (HEAD is changed, PHP_5_0
 isn't). Any chance you are doing something wrong? :)

# cvs -d :pserver:[EMAIL PROTECTED]:/repository co -r HEAD 
php-src/ext/oci8/oci8.c
U php-src/ext/oci8/oci8.c
# cat php-src/ext/oci8/oci8.c | grep pcleanup

static int _sessions_pcleanup(zend_llist *session_list)
static int _session_pcleanup(oci_session *session)
static int _server_pcleanup(oci_server *server)
zend_ts_hash_init(persistent_servers, 13, NULL, (dtor_func_t) 
_server_pcleanup, 1);
zend_ts_hash_init(persistent_sessions, 13, NULL, (dtor_func_t) 
_sessions_pcleanup, 1);
zend_llist_init(tmp, sizeof(oci_session), 
(llist_dtor_func_t) _session_pcleanup, 1);

and in the same time:

# cvs -d :pserver:[EMAIL PROTECTED]:/repository co -r PHP_5_0 
php-src/ext/oci8/oci8.c
U php-src/ext/oci8/oci8.c
# cat php-src/ext/oci8/oci8.c | grep pcleanup
static int _sessions_pcleanup(zend_llist *session_list TSRMLS_DC)
static int _session_pcleanup(oci_session *session TSRMLS_DC)
static int _server_pcleanup(oci_server *server TSRMLS_DC)

:/

-- 
Wbr,
Antony Dovgal aka tony2001
[EMAIL PROTECTED] || [EMAIL PROTECTED]

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-10-23 Thread Antony Dovgal
tony2001Sat Oct 23 05:32:51 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  commit fixes by mikael dot suvi at trigger dot ee
  (segfaults under heavy load)
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.262r2=1.263ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.262 php-src/ext/oci8/oci8.c:1.263
--- php-src/ext/oci8/oci8.c:1.262   Sun Oct 10 11:04:21 2004
+++ php-src/ext/oci8/oci8.c Sat Oct 23 05:32:44 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.262 2004/10/10 15:04:21 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.263 2004/10/23 09:32:44 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.262 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.263 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -1016,7 +1016,7 @@
);
}
 
-   if (connection-session) {
+   if (connection-session  connection-session-exclusive) {
/* close associated session when destructed */
zend_list_delete(connection-session-num);
}
@@ -2907,7 +2907,7 @@
oci_session *sess1 = (oci_session*) a;
oci_session *sess2 = (oci_session*) b;

-   return sess1-num = sess2-num;
+   return sess1-num == sess2-num;
 }
 
 static void _oci_close_session(oci_session *session)



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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-09-28 Thread Antony Dovgal
tony2001Tue Sep 28 12:59:10 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix bug #29652 (number of FD to ocius.msb is growing)
  many thanks to Sergei V. Rozinov S dot Rozinov at sibron dot ru for testing
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.259r2=1.260ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.259 php-src/ext/oci8/oci8.c:1.260
--- php-src/ext/oci8/oci8.c:1.259   Mon Jul 19 03:35:41 2004
+++ php-src/ext/oci8/oci8.c Tue Sep 28 12:59:10 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.259 2004/07/19 07:35:41 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.260 2004/09/28 16:59:10 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.259 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.260 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -3009,6 +3009,15 @@
}
mutex_unlock(mx_lock);
 
+#ifdef HAVE_OCI_9_2
+   /* free environment handle (and fix bug #29652 with growing .msb FD number 
under weirdie Solarises) */
+   CALL_OCI(
+   OCIHandleFree(
+   (dvoid *) session-pEnv, 
+   OCI_HTYPE_ENV
+   )
+   );
+#endif
if (session-exclusive) {
efree(session);
}

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-07-19 Thread Antony Dovgal
tony2001Mon Jul 19 03:35:44 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix build
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.258r2=1.259ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.258 php-src/ext/oci8/oci8.c:1.259
--- php-src/ext/oci8/oci8.c:1.258   Mon Jul 19 03:19:40 2004
+++ php-src/ext/oci8/oci8.c Mon Jul 19 03:35:41 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.258 2004/07/19 07:19:40 andi Exp $ */
+/* $Id: oci8.c,v 1.259 2004/07/19 07:35:41 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.258 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.259 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -880,7 +880,7 @@
 
if (bind-indicator == -1) { /* NULL */
zval *val = bind-zval;
-   if (Z_TYPE_P(val) == IS_STRING)) {
+   if (Z_TYPE_P(val) == IS_STRING) {
*Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */
}
zval_dtor(val);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-07-15 Thread Antony Dovgal
tony2001Thu Jul 15 07:00:14 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix #29012 (Potential race during first connection) thanks to cjbj at hotmail dot com
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.256r2=1.257ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.256 php-src/ext/oci8/oci8.c:1.257
--- php-src/ext/oci8/oci8.c:1.256   Mon Jul 12 03:40:05 2004
+++ php-src/ext/oci8/oci8.c Thu Jul 15 07:00:14 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.256 2004/07/12 07:40:05 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.257 2004/07/15 11:00:14 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.256 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.257 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -2673,13 +2673,13 @@
smart_str_0(hashed_details);
 
if (!exclusive) {
+   mutex_lock(mx_lock);
if (zend_ts_hash_find(persistent_sessions, hashed_details.c, 
hashed_details.len+1, (void **) session_list) != SUCCESS) {
zend_llist tmp;
/* first session, set up a session list */
zend_llist_init(tmp, sizeof(oci_session), (llist_dtor_func_t) 
_session_pcleanup, 1);
zend_ts_hash_update(persistent_sessions, hashed_details.c, 
hashed_details.len+1, tmp, sizeof(zend_llist), (void **) session_list);
} else {
-   mutex_lock(mx_lock);
 
/* session list found, search for an idle session or an 
already opened session by the current thread */
session = zend_llist_get_first(session_list);
@@ -2692,7 +2692,6 @@
session-thread = thread_id();
}
 
-   mutex_unlock(mx_lock);
}
 
if (session) {
@@ -2707,6 +2706,7 @@
/* breakthru to open */
}
}
+   mutex_unlock(mx_lock);
}
 
session = ecalloc(1,sizeof(oci_session));

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-07-12 Thread Antony Dovgal
tony2001Mon Jul 12 03:40:05 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix #28978 (multiple OCIBindByName on the same placeholder eats memory)
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.255r2=1.256ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.255 php-src/ext/oci8/oci8.c:1.256
--- php-src/ext/oci8/oci8.c:1.255   Mon Apr 26 10:49:41 2004
+++ php-src/ext/oci8/oci8.c Mon Jul 12 03:40:05 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.255 2004/04/26 14:49:41 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.256 2004/07/12 07:40:05 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.255 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.256 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -3698,8 +3698,8 @@
}
 
memset((void*)bind,0,sizeof(oci_bind));
-   zend_hash_next_index_insert(statement-binds,bind,sizeof(oci_bind),(void 
**)bindp);
-
+   zend_hash_update(statement-binds, Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, 
bind, sizeof(oci_bind), (void **)bindp);
+   
bindp-descr = mydescr;
bindp-pStmt = mystmt;
bindp-zval = *var;

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-04-26 Thread Antony Dovgal
tony2001Mon Apr 26 10:49:41 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  hmm. this comma is supposed to be a semicolon.
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.254r2=1.255ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.254 php-src/ext/oci8/oci8.c:1.255
--- php-src/ext/oci8/oci8.c:1.254   Wed Feb 25 15:16:23 2004
+++ php-src/ext/oci8/oci8.c Mon Apr 26 10:49:41 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.254 2004/02/25 20:16:23 abies Exp $ */
+/* $Id: oci8.c,v 1.255 2004/04/26 14:49:41 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.254 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.255 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -5666,7 +5666,7 @@
}
}
 
-   zend_hash_next_index_insert(Z_ARRVAL_PP(array), row, 
sizeof(zval*), NULL),
+   zend_hash_next_index_insert(Z_ARRVAL_PP(array), row, 
sizeof(zval*), NULL);
 
rows++;
 

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-02-20 Thread Antony Dovgal
tony2001Fri Feb 20 07:47:56 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  this should really fix compile failure with gcc 2.96
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.252r2=1.253ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.252 php-src/ext/oci8/oci8.c:1.253
--- php-src/ext/oci8/oci8.c:1.252   Thu Feb 19 22:16:51 2004
+++ php-src/ext/oci8/oci8.c Fri Feb 20 07:47:56 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.252 2004/02/20 03:16:51 sniper Exp $ */
+/* $Id: oci8.c,v 1.253 2004/02/20 12:47:56 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.252 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.253 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -836,9 +836,9 @@
  */
 static void _oci_desc_flush_hash_dtor(void *data)
 {
+   oci_descriptor *descr = *(oci_descriptor **)data;
TSRMLS_FETCH();

-   oci_descriptor *descr = *(oci_descriptor **)data;
if (descr-buffering == 2  (descr-type == OCI_DTYPE_LOB || descr-type == 
OCI_DTYPE_FILE)) {
oci_lob_flush(descr,OCI_LOB_BUFFER_FREE TSRMLS_CC);
descr-buffering = 1;

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-02-19 Thread Jani Taskinen
sniper  Thu Feb 19 22:05:43 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  Only use Z_TYPE* with zvals..
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.250r2=1.251ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.250 php-src/ext/oci8/oci8.c:1.251
--- php-src/ext/oci8/oci8.c:1.250   Thu Feb 12 14:05:39 2004
+++ php-src/ext/oci8/oci8.c Thu Feb 19 22:05:42 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.250 2004/02/12 19:05:39 ssb Exp $ */
+/* $Id: oci8.c,v 1.251 2004/02/20 03:05:42 sniper Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.250 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.251 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -1061,7 +1061,7 @@
 
/* Note sure if we need to free the object.  Have an
   oracle TAR out on this one.
-  OCIDescriptorFree(descr-ocidescr, Z_TYPE_P(descr)); */
+  OCIDescriptorFree(descr-ocidescr, descr-type); */
 
oci_debug(END   _oci_coll_list_dtor: %d,coll-id);
 
@@ -1086,7 +1086,7 @@
CALL_OCI(
OCIDescriptorFree(
descr-ocidescr, 
-   Z_TYPE_P(descr)
+   descr-type
)
);
 
@@ -1350,23 +1350,23 @@
 
 /* {{{ oci_new_desc()
 */
-static oci_descriptor *oci_new_desc(int type,oci_connection *connection)
+static oci_descriptor *oci_new_desc(int type, oci_connection *connection)
 {
oci_descriptor *descr;
TSRMLS_FETCH();
 
descr = emalloc(sizeof(oci_descriptor));

-   Z_TYPE_P(descr) = type;
+   descr-type = type;
 
-   switch (Z_TYPE_P(descr)) {
+   switch (descr-type) {
case OCI_DTYPE_FILE:
case OCI_DTYPE_LOB:
case OCI_DTYPE_ROWID:
break;
 
default:
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown 
descriptor type %d.,Z_TYPE_P(descr));
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown 
descriptor type %d., descr-type);
efree(descr);
return 0;
}
@@ -1375,7 +1375,7 @@
OCIDescriptorAlloc(
connection-session-pEnv,
(dvoid*)(descr-ocidescr), 
-   Z_TYPE_P(descr), 
+   descr-type, 
(size_t) 0, 
(dvoid **) 0
)
@@ -2149,7 +2149,7 @@
if (mydescr-lob_size = 0) {
*loblen = mydescr-lob_size;
} else {
-   if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) {
+   if (mydescr-type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection-error,
OCILobFileOpen(
connection-pServiceContext, 
@@ -2181,7 +2181,7 @@
}
mydescr-lob_size = *loblen;
 
-   if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) {
+   if (mydescr-type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection-error,
OCILobFileClose(
connection-pServiceContext, 
@@ -2207,7 +2207,7 @@
 /* {{{ oci_loadlob()
 */
 #define LOBREADSIZE 1048576l /* 1MB */
-static int oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char 
**buffer,ub4 *loblen)
+static int oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char 
**buffer, ub4 *loblen)
 {
ub4 siz = 0;
ub4 readlen = 0;
@@ -2216,7 +2216,7 @@
 
*loblen = 0;

-   if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) {
+   if (mydescr-type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection-error,
OCILobFileOpen(
connection-pServiceContext, 
@@ -2285,7 +2285,7 @@
return -1;
}
 
-   if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) {
+   if (mydescr-type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection-error,
OCILobFileClose(
connection-pServiceContext, 
@@ -2330,7 +2330,7 @@
return -1;
}
 
-   if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) {
+   if (mydescr-type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection-error,
OCILobFileOpen(
connection-pServiceContext, 
@@ -2418,7 +2418,7 @@
return -1;
}
 
-   if (Z_TYPE_P(mydescr) == 

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-02-19 Thread Jani Taskinen
sniper  Thu Feb 19 22:16:59 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  Fix compile failure
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.251r2=1.252ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.251 php-src/ext/oci8/oci8.c:1.252
--- php-src/ext/oci8/oci8.c:1.251   Thu Feb 19 22:05:42 2004
+++ php-src/ext/oci8/oci8.c Thu Feb 19 22:16:51 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.251 2004/02/20 03:05:42 sniper Exp $ */
+/* $Id: oci8.c,v 1.252 2004/02/20 03:16:51 sniper Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.251 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.252 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -838,7 +838,7 @@
 {
TSRMLS_FETCH();

-   oci_descriptor *descr = *((oci_descriptor **)data);
+   oci_descriptor *descr = *(oci_descriptor **)data;
if (descr-buffering == 2  (descr-type == OCI_DTYPE_LOB || descr-type == 
OCI_DTYPE_FILE)) {
oci_lob_flush(descr,OCI_LOB_BUFFER_FREE TSRMLS_CC);
descr-buffering = 1;

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-02-12 Thread Stig Bakken
ssb Thu Feb 12 14:03:08 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  * update my email address
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.248r2=1.249ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.248 php-src/ext/oci8/oci8.c:1.249
--- php-src/ext/oci8/oci8.c:1.248   Thu Feb  5 03:29:16 2004
+++ php-src/ext/oci8/oci8.c Thu Feb 12 14:03:03 2004
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to  |
| [EMAIL PROTECTED] so we can mail you a copy immediately.   |
+--+
-   | Authors: Stig Sæther Bakken [EMAIL PROTECTED]|
+   | Authors: Stig Sæther Bakken [EMAIL PROTECTED]   |
|  Thies C. Arntzen [EMAIL PROTECTED] |
|  Maxim Maletsky [EMAIL PROTECTED] |
|  |
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.248 2004/02/05 08:29:16 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.249 2004/02/12 19:03:03 ssb Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.248 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.249 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c /ext/standard crypt.c php_crypt.h

2004-02-12 Thread Stig Bakken
ssb Thu Feb 12 14:05:42 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
/php-src/ext/standard   crypt.c php_crypt.h 
  Log:
  * email address update
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.249r2=1.250ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.249 php-src/ext/oci8/oci8.c:1.250
--- php-src/ext/oci8/oci8.c:1.249   Thu Feb 12 14:03:03 2004
+++ php-src/ext/oci8/oci8.c Thu Feb 12 14:05:39 2004
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to  |
| [EMAIL PROTECTED] so we can mail you a copy immediately.   |
+--+
-   | Authors: Stig Sæther Bakken [EMAIL PROTECTED]   |
+   | Authors: Stig Sæther Bakken [EMAIL PROTECTED]|
|  Thies C. Arntzen [EMAIL PROTECTED] |
|  Maxim Maletsky [EMAIL PROTECTED] |
|  |
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.249 2004/02/12 19:03:03 ssb Exp $ */
+/* $Id: oci8.c,v 1.250 2004/02/12 19:05:39 ssb Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.249 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.250 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
http://cvs.php.net/diff.php/php-src/ext/standard/crypt.c?r1=1.60r2=1.61ty=u
Index: php-src/ext/standard/crypt.c
diff -u php-src/ext/standard/crypt.c:1.60 php-src/ext/standard/crypt.c:1.61
--- php-src/ext/standard/crypt.c:1.60   Sun Jan 18 22:14:58 2004
+++ php-src/ext/standard/crypt.cThu Feb 12 14:05:41 2004
@@ -12,12 +12,12 @@
| obtain it through the world-wide-web, please send a note to  |
| [EMAIL PROTECTED] so we can mail you a copy immediately.   |
+--+
-   | Authors: Stig Bakken [EMAIL PROTECTED]   |
+   | Authors: Stig Bakken [EMAIL PROTECTED]   |
|  Zeev Suraski [EMAIL PROTECTED]|
|  Rasmus Lerdorf [EMAIL PROTECTED] |
+--+
  */
-/* $Id: crypt.c,v 1.60 2004/01/19 03:14:58 sniper Exp $ */
+/* $Id: crypt.c,v 1.61 2004/02/12 19:05:41 ssb Exp $ */
 #include stdlib.h
 
 #include php.h
http://cvs.php.net/diff.php/php-src/ext/standard/php_crypt.h?r1=1.16r2=1.17ty=u
Index: php-src/ext/standard/php_crypt.h
diff -u php-src/ext/standard/php_crypt.h:1.16 php-src/ext/standard/php_crypt.h:1.17
--- php-src/ext/standard/php_crypt.h:1.16   Thu Jan  8 12:32:51 2004
+++ php-src/ext/standard/php_crypt.hThu Feb 12 14:05:41 2004
@@ -12,13 +12,13 @@
| obtain it through the world-wide-web, please send a note to  |
| [EMAIL PROTECTED] so we can mail you a copy immediately.   |
+--+
-   | Authors: Stig Bakken [EMAIL PROTECTED]   |
+   | Authors: Stig Bakken [EMAIL PROTECTED]   |
|  Zeev Suraski [EMAIL PROTECTED]|
|  Rasmus Lerdorf [EMAIL PROTECTED] |
+--+
 */
 
-/* $Id: php_crypt.h,v 1.16 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_crypt.h,v 1.17 2004/02/12 19:05:41 ssb Exp $ */
 
 #ifndef PHP_CRYPT_H
 #define PHP_CRYPT_H

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-02-05 Thread Antony Dovgal
tony2001Thu Feb  5 03:29:17 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix bug #27149
  (offset should start with 1)
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.247r2=1.248ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.247 php-src/ext/oci8/oci8.c:1.248
--- php-src/ext/oci8/oci8.c:1.247   Tue Feb  3 09:21:09 2004
+++ php-src/ext/oci8/oci8.c Thu Feb  5 03:29:16 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.247 2004/02/03 14:21:09 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.248 2004/02/05 08:29:16 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -786,7 +786,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.247 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.248 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -3841,11 +3841,11 @@
 
if (offparam == -1) {
offset = curloblen;
-   } else if (offparam = curloblen) {
+   } else if ((ub4)offparam = curloblen) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Offset is 
bigger than current LOB-Size - appending);
offset = curloblen;
} else {
-   offset = offparam;
+   offset = (ub4)offparam;
}
} else if (zend_get_parameters_ex(1, arg) == FAILURE) {
WRONG_PARAM_COUNT;
@@ -3859,6 +3859,10 @@
RETURN_FALSE;
}
 
+   if (offset = 0) {
+   offset = 1;
+   }
+   
CALL_OCI_RETURN(connection-error,
OCILobWrite(
connection-pServiceContext, 

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-02-02 Thread Antony Dovgal
tony2001Mon Feb  2 03:09:54 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix yet another possible segfault
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.244r2=1.245ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.244 php-src/ext/oci8/oci8.c:1.245
--- php-src/ext/oci8/oci8.c:1.244   Wed Jan 28 02:15:55 2004
+++ php-src/ext/oci8/oci8.c Mon Feb  2 03:09:53 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.244 2004/01/28 07:15:55 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.245 2004/02/02 08:09:53 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -785,7 +785,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.244 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.245 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -6011,6 +6011,10 @@
WRONG_PARAM_COUNT;
}
 
+   convert_to_string_ex(user_param);
+   convert_to_string_ex(pass_old_param);
+   convert_to_string_ex(pass_new_param);
+   
user  = Z_STRVAL_PP(user_param);
pass_old  = Z_STRVAL_PP(pass_old_param);
pass_new  = Z_STRVAL_PP(pass_new_param);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-28 Thread Antony Dovgal
tony2001Wed Jan 28 02:15:56 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  two fixes:
  -oci_lob_load shouldn't reset LOB's length to zero
  -Oracle feels bad, but reports no error, when trying to erase LOB with offset bigger 
than LOB
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.243r2=1.244ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.243 php-src/ext/oci8/oci8.c:1.244
--- php-src/ext/oci8/oci8.c:1.243   Mon Jan 26 10:42:24 2004
+++ php-src/ext/oci8/oci8.c Wed Jan 28 02:15:55 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.243 2004/01/26 15:42:24 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.244 2004/01/28 07:15:55 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -785,7 +785,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.243 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.244 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -2284,8 +2284,6 @@
return -1;
}
 
-   mydescr-lob_size = *loblen;
-   
if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection-error,
OCILobFileClose(
@@ -4475,6 +4473,10 @@
if (erase_length  1) {
RETURN_LONG(0);
}
+
+   if (erase_offset  descr-lob_size) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, oci_lob_erase(): 
offset is greater than LOB's length);
+   }

CALL_OCI_RETURN(connection-error,
OCILobErase(

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-26 Thread Antony Dovgal
tony2001Mon Jan 26 08:59:42 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix oci_field_type_raw's proto
  oci_collection_element_get should return FALSE only if there is no such element and 
NULL, if it's null
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.238r2=1.239ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.238 php-src/ext/oci8/oci8.c:1.239
--- php-src/ext/oci8/oci8.c:1.238   Thu Jan 22 03:39:50 2004
+++ php-src/ext/oci8/oci8.c Mon Jan 26 08:59:42 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.238 2004/01/22 08:39:50 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.239 2004/01/26 13:59:42 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -785,7 +785,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.238 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.239 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -5449,7 +5449,7 @@
 }
 /* }}} */
 
-/* {{{ proto mixed oci_field_type_raw(resource stmt, int col)
+/* {{{ proto int oci_field_type_raw(resource stmt, int col)
Tell the raw oracle data type of a column */
 PHP_FUNCTION(oci_field_type_raw)
 {
@@ -6505,7 +6505,7 @@
 
/* Return null if the value is null */
if (*elemind == OCI_IND_NULL) {
-   RETURN_FALSE;
+   RETURN_NULL;
} 
 
switch (coll-element_typecode) {

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-26 Thread Antony Dovgal
tony2001Mon Jan 26 09:02:09 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  oops =(
  forgot these brackets..
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.239r2=1.240ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.239 php-src/ext/oci8/oci8.c:1.240
--- php-src/ext/oci8/oci8.c:1.239   Mon Jan 26 08:59:42 2004
+++ php-src/ext/oci8/oci8.c Mon Jan 26 09:02:08 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.239 2004/01/26 13:59:42 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.240 2004/01/26 14:02:08 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -785,7 +785,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.239 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.240 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -6505,7 +6505,7 @@
 
/* Return null if the value is null */
if (*elemind == OCI_IND_NULL) {
-   RETURN_NULL;
+   RETURN_NULL();
} 
 
switch (coll-element_typecode) {

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-26 Thread Antony Dovgal
tony2001Mon Jan 26 10:21:53 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  improve debug messages
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.240r2=1.241ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.240 php-src/ext/oci8/oci8.c:1.241
--- php-src/ext/oci8/oci8.c:1.240   Mon Jan 26 09:02:08 2004
+++ php-src/ext/oci8/oci8.c Mon Jan 26 10:21:52 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.240 2004/01/26 14:02:08 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.241 2004/01/26 15:21:52 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -785,7 +785,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.240 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.241 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -2197,7 +2197,7 @@
}
}

-   oci_debug(OCILobGetLen: len=%d,*loblen);
+   oci_debug(oci_lobgetlen: len=%d,*loblen);
 
return 0;
 }
@@ -2309,7 +2309,7 @@
*buffer = buf;
*loblen = siz;
 
-   oci_debug(OCIloadlob: size=%d,siz);
+   oci_debug(oci_loadlob: size=%d,siz);
 
return 0;
 }
@@ -2442,7 +2442,7 @@
*buffer = buf;
*len = bytes;
 
-   oci_debug(OCIreadlob: size=%d,bytes);
+   oci_debug(oci_readlob: size=%d,bytes);
 
return 0;
 }
@@ -3400,7 +3400,7 @@
)
);
 
-   oci_debug(OCILobFlushBuffer: flush_flag=%d,flush_flag);
+   oci_debug(oci_lob_flush: flush_flag=%d,flush_flag);
 
if (connection-error) {
oci_error(connection-pError, OCILobFlushBuffer, connection-error);
@@ -3786,7 +3786,7 @@
if ((id = getThis()) != 0) {
inx = _oci_get_ocidesc(id,descriptor TSRMLS_CC);
if (inx) {
-   oci_debug(OCIfreedesc: descr=%d,inx);
+   oci_debug(oci_free_descriptor: descr=%d,inx);
zend_list_delete(inx);
RETURN_TRUE;
}
@@ -3838,7 +3838,7 @@
)
);
 
-   oci_debug(OCIsavedesc: curloblen=%d,curloblen);
+   oci_debug(oci_lob_save: curloblen=%d,curloblen);
 
if (offparam == -1) {
offset = curloblen;
@@ -3877,7 +3877,7 @@
)
);
 
-   oci_debug(OCIsavedesc: size=%d offset=%d,loblen,offset);
+   oci_debug(oci_lob_save: size=%d offset=%d,loblen,offset);
 
if (connection-error) {
oci_error(connection-pError, OCILobWrite, 
connection-error);
@@ -3954,7 +3954,7 @@
)
);
 
-   oci_debug(OCIsavelob: size=%d,loblen);
+   oci_debug(oci_lob_import: size=%d,loblen);
 
if (connection-error) {
oci_error(connection-pError, OCILobWrite, 
connection-error);
@@ -4254,7 +4254,7 @@
)
);
 
-   oci_debug(OCILobWrite: size=%d 
offset=%d,loblen,descr-lob_current_position);
+   oci_debug(oci_lob_write: size=%d 
offset=%d,loblen,descr-lob_current_position);
 
if (connection-error) {
oci_error(connection-pError, OCILobWrite, 
connection-error);
@@ -4408,7 +4408,7 @@
)
);
 
-   oci_debug(OCILobTrim: trim_length=%d,trim_length);
+   oci_debug(oci_lob_truncate: trim_length=%d,trim_length);
 
if (connection-error) {
oci_error(connection-pError, OCILobTrim, connection-error);
@@ -4486,7 +4486,7 @@
)
);
 
-   oci_debug(OCILobErase: erase_length=%d, 
erase_offset=%d,erase_length,erase_offset);
+   oci_debug(oci_lob_erase: erase_length=%d, 
erase_offset=%d,erase_length,erase_offset);
 
if (connection-error) {
oci_error(connection-pError, OCILobErase, 
connection-error);
@@ -4615,7 +4615,7 @@
break;
}

-   oci_debug(OCIsavedesc: buffering_flag=%d,buffering_flag);
+   oci_debug(oci_lob_set_buffering: buffering_flag=%d,buffering_flag);
 
if (connection-error) {
oci_error(connection-pError, OCILobFlushBuffer, 
connection-error);
@@ -4904,7 +4904,7 @@
 
coffs = start;
 
-   oci_debug(ociwritelobtofile(start = %d, length = %d, loblen = 
%d,start,length,loblen);
+   

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-26 Thread Antony Dovgal
tony2001Mon Jan 26 10:25:32 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix this annoying notice about limited range
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.241r2=1.242ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.241 php-src/ext/oci8/oci8.c:1.242
--- php-src/ext/oci8/oci8.c:1.241   Mon Jan 26 10:21:52 2004
+++ php-src/ext/oci8/oci8.c Mon Jan 26 10:25:32 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.241 2004/01/26 15:21:52 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.242 2004/01/26 15:25:32 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -785,7 +785,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.241 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.242 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -2649,7 +2649,7 @@
)
);
 
-   smart_str_append_long_ex(hashed_details, charsetid, 1);
+   smart_str_append_unsigned(hashed_details, charsetid);
 
charsetid = 0;
}

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



Re: [PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-26 Thread Sascha Schumann
On Mon, 26 Jan 2004, Antony Dovgal wrote:

 tony2001  Mon Jan 26 10:25:32 2004 EDT

   Modified files:
 /php-src/ext/oci8 oci8.c
   Log:
   fix this annoying notice about limited range

You need to use a different allocator (.._ex(.., 1)).

 - smart_str_append_long_ex(hashed_details, charsetid, 1);
 + smart_str_append_unsigned(hashed_details, charsetid);

- Sascha

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-26 Thread Antony Dovgal
tony2001Mon Jan 26 10:42:25 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  change to use different allocator (Sascha, thanks =) )
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.242r2=1.243ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.242 php-src/ext/oci8/oci8.c:1.243
--- php-src/ext/oci8/oci8.c:1.242   Mon Jan 26 10:25:32 2004
+++ php-src/ext/oci8/oci8.c Mon Jan 26 10:42:24 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.242 2004/01/26 15:25:32 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.243 2004/01/26 15:42:24 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -785,7 +785,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.242 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.243 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -2649,7 +2649,7 @@
)
);
 
-   smart_str_append_unsigned(hashed_details, charsetid);
+   smart_str_append_unsigned_ex(hashed_details, charsetid, 1);
 
charsetid = 0;
}

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



Re: [PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-26 Thread Antony Dovgal
On Mon, 26 Jan 2004 16:37:38 +0100 (CET)
Sascha Schumann [EMAIL PROTECTED] wrote:

 On Mon, 26 Jan 2004, Antony Dovgal wrote:
 
  tony2001Mon Jan 26 10:25:32 2004 EDT
 
Modified files:
  /php-src/ext/oci8   oci8.c
Log:
fix this annoying notice about limited range
 
 You need to use a different allocator (.._ex(.., 1)).

fixed, thanks =)

---
WBR,
Antony Dovgal aka tony2001
[EMAIL PROTECTED]

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-22 Thread Antony Dovgal
tony2001Thu Jan 22 03:05:16 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  MFB
  oci_lob_save() should be removed indeed, but we're already in feature freeze =(
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.236r2=1.237ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.236 php-src/ext/oci8/oci8.c:1.237
--- php-src/ext/oci8/oci8.c:1.236   Wed Jan 21 11:18:58 2004
+++ php-src/ext/oci8/oci8.c Thu Jan 22 03:05:14 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.236 2004/01/21 16:18:58 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.237 2004/01/22 08:05:14 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -785,7 +785,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.236 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.237 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -3842,8 +3842,8 @@
 
if (offparam == -1) {
offset = curloblen;
-   } else if ((ub4) offparam = curloblen) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Offset 
smaller than current LOB-Size - appending);
+   } else if (offparam = curloblen) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Offset is 
bigger than current LOB-Size - appending);
offset = curloblen;
} else {
offset = offparam;
@@ -3852,7 +3852,6 @@
WRONG_PARAM_COUNT;
}
 
-   offset++;
convert_to_string_ex(arg);
loblen = Z_STRLEN_PP(arg);


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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-22 Thread Antony Dovgal
tony2001Thu Jan 22 03:39:51 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  add missing protos
  and some minor changes
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.237r2=1.238ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.237 php-src/ext/oci8/oci8.c:1.238
--- php-src/ext/oci8/oci8.c:1.237   Thu Jan 22 03:05:14 2004
+++ php-src/ext/oci8/oci8.c Thu Jan 22 03:39:50 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.237 2004/01/22 08:05:14 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.238 2004/01/22 08:39:50 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -785,7 +785,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.237 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.238 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -3798,7 +3798,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool oci_lob_save()
+/* {{{ proto bool oci_lob_save( string data [, int offset ])
Saves a large object */
 PHP_FUNCTION(oci_lob_save)
 {
@@ -3892,7 +3892,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool oci_lob_import()
+/* {{{ proto bool oci_lob_import( string filename )
Saves a large object to file */
 PHP_FUNCTION(oci_lob_import)
 {
@@ -4002,7 +4002,7 @@
 }
 /* }}} */
 
-/* {{{ proto string oci_lob_read()
+/* {{{ proto string oci_lob_read( int length )
Reads particular part of a large object */
 PHP_FUNCTION(oci_lob_read)
 {
@@ -4105,7 +4105,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool oci_lob_seek()
+/* {{{ proto bool oci_lob_seek( int offset [, int whence ])
Moves the pointer of a LOB */
 PHP_FUNCTION(oci_lob_seek)
 {
@@ -4189,7 +4189,7 @@
 }
 /* }}} */
 
-/* {{{ proto int oci_lob_write()
+/* {{{ proto int oci_lob_write( string string [, int length ])
Writes data to current position of a LOB */
 PHP_FUNCTION(oci_lob_write)
 {
@@ -4280,7 +4280,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool oci_lob_append()
+/* {{{ proto bool oci_lob_append( object lob )
Appends data from a LOB to another LOB */
 PHP_FUNCTION(oci_lob_append)
 {
@@ -4311,6 +4311,7 @@
}

if (zend_get_parameters_ex(1, arg) == SUCCESS) {
+   convert_to_object_ex(arg);
if ((inx = _oci_get_ocidesc(*arg,from_descr TSRMLS_CC)) == 0) 
{
RETURN_FALSE;
}
@@ -4355,7 +4356,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool oci_lob_truncate()
+/* {{{ proto bool oci_lob_truncate( [ int length ])
Truncates a LOB */
 PHP_FUNCTION(oci_lob_truncate)
 {
@@ -4424,7 +4425,7 @@
 }
 /* }}} */
 
-/* {{{ proto int oci_lob_erase()
+/* {{{ proto int oci_lob_erase( [ int offset [, int length ] ] )
Erases a specified portion of the internal LOB, starting at a specified offset */
 PHP_FUNCTION(oci_lob_erase)
 {
@@ -4501,7 +4502,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool oci_lob_flush()
+/* {{{ proto bool oci_lob_flush( [ int flag ] )
Flushes the LOB buffer */
 PHP_FUNCTION(oci_lob_flush)
 {
@@ -4549,7 +4550,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool ocisetbufferinglob()
+/* {{{ proto bool ocisetbufferinglob( boolean flag )
Enables/disables buffering for a LOB */
 PHP_FUNCTION(ocisetbufferinglob)
 {
@@ -4671,7 +4672,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool oci_lob_copy()
+/* {{{ proto bool oci_lob_copy( object lob_to, object lob_from [, int length ] )
Copies data from a LOB to another LOB */
 PHP_FUNCTION(oci_lob_copy)
 {
@@ -4686,9 +4687,8 @@
WRONG_PARAM_COUNT;
}
 
-   if ((*arg1)-type != IS_OBJECT || (*arg2)-type != IS_OBJECT) {
-   RETURN_FALSE;
-   }
+   convert_to_object_ex(arg1);
+   convert_to_object_ex(arg2);

if ((inx = _oci_get_ocidesc(*arg1,descr TSRMLS_CC)) == 0 || (inx = 
_oci_get_ocidesc(*arg2,from_descr TSRMLS_CC)) == 0) {
RETURN_FALSE;
@@ -4743,7 +4743,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool oci_lob_is_equal()
+/* {{{ proto bool oci_lob_is_equal( object lob1, object lob2 )
Tests to see if two LOB/FILE locators are equal */
 PHP_FUNCTION(oci_lob_is_equal)
 {
@@ -4758,10 +4758,9 @@
WRONG_PARAM_COUNT;
}
 
-   if ((*arg1)-type != IS_OBJECT || (*arg2)-type != IS_OBJECT) {
-   RETURN_FALSE;
-   }
-
+   convert_to_object_ex(arg1);
+   convert_to_object_ex(arg2);
+   
if ((inx = _oci_get_ocidesc(*arg1,first_descr TSRMLS_CC)) == 0 || 
(inx = _oci_get_ocidesc(*arg2,second_descr TSRMLS_CC)) == 0) {
RETURN_FALSE;
}

-- 
PHP CVS Mailing List (http://www.php.net/)

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-21 Thread Antony Dovgal
tony2001Wed Jan 21 07:30:07 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix potential segfault in oci_lob_write()
  change oci_lob_trim() - truncate length should be 0 by default.
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.234r2=1.235ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.234 php-src/ext/oci8/oci8.c:1.235
--- php-src/ext/oci8/oci8.c:1.234   Thu Jan 15 10:06:57 2004
+++ php-src/ext/oci8/oci8.c Wed Jan 21 07:30:05 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.234 2004/01/15 15:06:57 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.235 2004/01/21 12:30:05 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -784,7 +784,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.234 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.235 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -2196,7 +2196,7 @@
}
}

-   oci_debug(OCILobGetLen: len=%d,loblen);
+   oci_debug(OCILobGetLen: len=%d,*loblen);
 
return 0;
 }
@@ -4221,6 +4221,7 @@
}

if (zend_get_parameters_ex(2, data, length) == SUCCESS) {
+   convert_to_string_ex(data);
convert_to_long_ex(length);
write_length = Z_LVAL_PP(length);
} else if (zend_get_parameters_ex(1, data) == SUCCESS) {
@@ -4389,7 +4390,7 @@
convert_to_long_ex(length); 
trim_length = Z_LVAL_PP(length);
} else {
-   WRONG_PARAM_COUNT;
+   trim_length = 0;
}
 
if (trim_length  0) {

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-21 Thread Antony Dovgal
tony2001Wed Jan 21 11:18:59 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  *change constant name, coz it doesn't comply with others
  *add constant's alias, coz others do have aliases
  *change protos (oops =))
  *add notices to collection functions
  *change coll_element_get  coll_assign to inform user, that this type of element is 
not supported yet.
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.235r2=1.236ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.235 php-src/ext/oci8/oci8.c:1.236
--- php-src/ext/oci8/oci8.c:1.235   Wed Jan 21 07:30:05 2004
+++ php-src/ext/oci8/oci8.c Wed Jan 21 11:18:58 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.235 2004/01/21 12:30:05 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.236 2004/01/21 16:18:58 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -683,7 +683,8 @@
REGISTER_LONG_CONSTANT(SQLT_RDD,SQLT_RDD, CONST_CS | CONST_PERSISTENT);
 
 #ifdef PHP_OCI8_HAVE_COLLECTIONS
-   REGISTER_LONG_CONSTANT(OCI_B_SQLT_NTY,SQLT_NTY, CONST_CS | CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(OCI_B_NTY,SQLT_NTY, CONST_CS | CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(SQLT_NTY,SQLT_NTY, CONST_CS | CONST_PERSISTENT);  
 
REGISTER_STRING_CONSTANT(OCI_SYSDATE,SYSDATE,CONST_PERSISTENT);
 #endif
 
@@ -784,7 +785,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.235 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.236 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -5734,7 +5735,7 @@
 }
 /* }}} */
 
-/* {{{ proto object oci_fetch_row( resource stmt )
+/* {{{ proto array oci_fetch_row( resource stmt )
Fetch a result row as an enumerated array */
 PHP_FUNCTION(oci_fetch_row)
 {
@@ -5742,7 +5743,7 @@
 }
 /* }}} */
 
-/* {{{ proto object oci_fetch_assoc( resource stmt )
+/* {{{ proto array oci_fetch_assoc( resource stmt )
Fetch a result row as an associative array */
 PHP_FUNCTION(oci_fetch_assoc)
 {
@@ -5750,7 +5751,7 @@
 }
 /* }}} */
 
-/* {{{ proto object oci_fetch_array( resource stmt [, int mode ])
+/* {{{ proto array oci_fetch_array( resource stmt [, int mode ])
Fetch a result row as an array */
 PHP_FUNCTION(oci_fetch_array)
 {
@@ -6438,9 +6439,14 @@
 
RETURN_TRUE;
break;
+   default:
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, Unknown or 
unsupported type of element);
+   RETURN_FALSE;
+   break;
}
}
-
+   
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, oci_collection_append() should not 
be called like this. Use $collection-append($element) to append an element to the 
collection);
RETURN_FALSE;
 }
 /* }}} */
@@ -6552,9 +6558,14 @@
}
RETURN_DOUBLE(dnum);
break;
+   default:
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, Unknown or 
unsupported type of element);
+   RETURN_FALSE;
+   break;
}
}
 
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, oci_collection_element_get() 
should not be called like this. Use $collection-getelem($index) to get an element of 
the collection with the given index);
RETURN_FALSE;
 }
 /* }}} */
@@ -6599,6 +6610,7 @@
RETURN_TRUE;
}
 
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, oci_collection_assign() should not 
be called like this. Use $collection-assign($collection_value) to assign value to the 
collection);
RETURN_FALSE;
 }
 /* }}} */
@@ -6782,6 +6794,8 @@
break;
}
}
+
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, oci_collection_element_assign() 
should not be called like this. Use $collection-assignelem($index, $value) to assign 
value to an element of the collection);
RETURN_FALSE;
 }
 /* }}} */
@@ -6818,6 +6832,8 @@
 
RETURN_LONG(sz);
}
+
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, oci_collection_size() should not 
be called like this. Use $collection-size() to get size of the collection);
RETURN_FALSE;
 }
 /* }}} */
@@ -6839,6 +6855,8 @@
 
RETURN_LONG(sz);
}
+
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, oci_collection_max() should not be 
called like this. Use $collection-max() to get maximum number of elements in the 
collection);
RETURN_FALSE;
 }
 /* }}} */
@@ -6875,6 +6893,8 @@
}
RETURN_TRUE;
}

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-02 Thread Jani Taskinen
sniper  Fri Jan  2 09:09:52 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  another ZTS fix
  
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.229 php-src/ext/oci8/oci8.c:1.230
--- php-src/ext/oci8/oci8.c:1.229   Thu Jan  1 21:21:44 2004
+++ php-src/ext/oci8/oci8.c Fri Jan  2 09:09:49 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.229 2004/01/02 02:21:44 sniper Exp $ */
+/* $Id: oci8.c,v 1.230 2004/01/02 14:09:49 sniper Exp $ */
 
 /* TODO list:
  *
@@ -775,7 +775,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.229 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.230 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -829,6 +829,8 @@
 static void 
 _oci_desc_flush_hash_dtor(void *data)
 {
+   TSRMLS_FETCH();
+   
oci_descriptor *descr = *((oci_descriptor **)data);
if (descr-buffering == 2  (descr-type == OCI_DTYPE_LOB || descr-type == 
OCI_DTYPE_FILE)) {
 oci_lob_flush(descr,OCI_LOB_BUFFER_FREE TSRMLS_CC);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2004-01-01 Thread Jani Taskinen
sniper  Thu Jan  1 21:21:45 2004 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix ZTS build
  
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.228 php-src/ext/oci8/oci8.c:1.229
--- php-src/ext/oci8/oci8.c:1.228   Thu Dec 25 08:54:50 2003
+++ php-src/ext/oci8/oci8.c Thu Jan  1 21:21:44 2004
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.228 2003/12/25 13:54:50 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.229 2004/01/02 02:21:44 sniper Exp $ */
 
 /* TODO list:
  *
@@ -235,7 +235,7 @@
 static sb4 oci_failover_callback(dvoid *svchp,dvoid* envhp,dvoid *fo_ctx,ub4 fo_type, 
ub4 fo_event);
 #endif
 
-static int oci_lob_flush(oci_descriptor*, int);
+static int oci_lob_flush(oci_descriptor *, int flush_flag TSRMLS_DC);
 
 /* }}} */
 /* {{{ extension macros */
@@ -775,7 +775,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.228 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.229 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -831,7 +831,7 @@
 {
oci_descriptor *descr = *((oci_descriptor **)data);
if (descr-buffering == 2  (descr-type == OCI_DTYPE_LOB || descr-type == 
OCI_DTYPE_FILE)) {
-oci_lob_flush(descr,OCI_LOB_BUFFER_FREE);
+oci_lob_flush(descr,OCI_LOB_BUFFER_FREE TSRMLS_CC);
 descr-buffering = 1;
}
 }
@@ -1067,7 +1067,7 @@
 /* flushing Lobs  Files with buffering enabled */
 if ((descr-type == OCI_DTYPE_FILE || descr-type == OCI_DTYPE_LOB)  
descr-buffering == 2) {
oci_debug(descriptor #%d needs to be flushed. flushing..,descr-id);
-oci_lob_flush(descr,OCI_LOB_BUFFER_FREE);
+oci_lob_flush(descr,OCI_LOB_BUFFER_FREE TSRMLS_CC);
 }
 
CALL_OCI(OCIDescriptorFree(
@@ -3226,7 +3226,8 @@
 /* }}} */
 
 /* {{{ oci_lob_flush() */
-static int oci_lob_flush(oci_descriptor* descr, int flush_flag) {
+static int oci_lob_flush(oci_descriptor* descr, int flush_flag TSRMLS_DC)
+{
 OCILobLocator *mylob;
 oci_connection *connection;
 
@@ -4396,7 +4397,7 @@
RETURN_FALSE;
}
 
-if (oci_lob_flush(descr,flush_flag) == 1) {
+if (oci_lob_flush(descr,flush_flag TSRMLS_CC) == 1) {
 RETURN_TRUE;
 }
 


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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c php_oci8.h

2003-12-25 Thread Antony Dovgal
tony2001Thu Dec 25 08:54:51 2003 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c php_oci8.h 
  Log:
  workaround for possible ORA-22280 warning if buffers were not flushed
  
  Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.227 php-src/ext/oci8/oci8.c:1.228
--- php-src/ext/oci8/oci8.c:1.227   Wed Dec 24 10:01:54 2003
+++ php-src/ext/oci8/oci8.c Thu Dec 25 08:54:50 2003
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.227 2003/12/24 15:01:54 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.228 2003/12/25 13:54:50 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -200,6 +200,7 @@
 static void _oci_column_hash_dtor(void *data);
 static void _oci_define_hash_dtor(void *data);
 static void _oci_bind_hash_dtor(void *data);
+static void _oci_desc_flush_hash_dtor(void *data);
 
 static oci_connection *oci_get_conn(zval ** TSRMLS_DC);
 static oci_statement *oci_get_stmt(zval ** TSRMLS_DC);
@@ -237,6 +238,50 @@
 static int oci_lob_flush(oci_descriptor*, int);
 
 /* }}} */
+/* {{{ extension macros */
+
+#define OCI_GET_STMT(statement,value) \
+   statement = oci_get_stmt(value TSRMLS_CC); \
+   if (statement == NULL) { \
+   RETURN_FALSE; \
+   }
+
+#define OCI_GET_CONN(connection,value) \
+   connection = oci_get_conn(value TSRMLS_CC); \
+   if (connection == NULL) { \
+   RETURN_FALSE; \
+   }
+
+#define OCI_GET_DESC(descriptor,index) \
+   descriptor = oci_get_desc(index TSRMLS_CC); \
+   if (descriptor == NULL) { \
+   RETURN_FALSE; \
+   }
+
+#ifdef PHP_OCI8_HAVE_COLLECTIONS
+#define OCI_GET_COLL(collection,index) \
+   collection = oci_get_coll(index TSRMLS_CC); \
+   if (collection == NULL) { \
+   RETURN_FALSE; \
+   }
+#endif
+
+#define IS_LOB_INTERNAL(lob) \
+   if (lob-type != OCI_DTYPE_LOB) { \
+   switch (lob-type) { \
+   case OCI_DTYPE_FILE: \
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, internal 
LOB was expected, FILE locator is given); \
+   break; \
+   case OCI_DTYPE_ROWID: \
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, internal 
LOB was expected, ROWID locator is given); \
+   break; \
+   default: \
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, internal 
LOB was expected, locator of unknown type is given); \
+   break; \
+   } \
+   RETURN_FALSE; \
+   }
+/* }}} */
 /* {{{ extension function prototypes */
 
 PHP_FUNCTION(oci_bind_by_name);
@@ -313,48 +358,6 @@
 PHP_FUNCTION(oci_collection_trim);
 #endif
 
-#define OCI_GET_STMT(statement,value) \
-   statement = oci_get_stmt(value TSRMLS_CC); \
-   if (statement == NULL) { \
-   RETURN_FALSE; \
-   }
-
-#define OCI_GET_CONN(connection,value) \
-   connection = oci_get_conn(value TSRMLS_CC); \
-   if (connection == NULL) { \
-   RETURN_FALSE; \
-   }
-
-#define OCI_GET_DESC(descriptor,index) \
-   descriptor = oci_get_desc(index TSRMLS_CC); \
-   if (descriptor == NULL) { \
-   RETURN_FALSE; \
-   }
-
-#ifdef PHP_OCI8_HAVE_COLLECTIONS
-#define OCI_GET_COLL(collection,index) \
-   collection = oci_get_coll(index TSRMLS_CC); \
-   if (collection == NULL) { \
-   RETURN_FALSE; \
-   }
-#endif
-
-#define IS_LOB_INTERNAL(lob) \
-   if (lob-type != OCI_DTYPE_LOB) { \
-   switch (lob-type) { \
-   case OCI_DTYPE_FILE: \
-   php_error_docref(NULL TSRMLS_CC, E_NOTICE, internal 
LOB was expected, FILE locator is given); \
-   break; \
-   case OCI_DTYPE_ROWID: \
-   php_error_docref(NULL TSRMLS_CC, E_NOTICE, internal 
LOB was expected, ROWID locator is given); \
-   break; \
-   default: \
-   php_error_docref(NULL TSRMLS_CC, E_NOTICE, internal 
LOB was expected, locator of unknown type is given); \
-   break; \
-   } \
-   RETURN_FALSE; \
-   }
-
 /* }}} */
 /* {{{ extension definition structures */
 
@@ -772,7 +775,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.227 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.228 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -820,6 +823,20 @@
 }
 
 /* }}} */
+/* {{{ _oci_desc_flush_hash_dtor()
+ */
+
+static void 
+_oci_desc_flush_hash_dtor(void *data)
+{
+   

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2003-12-24 Thread Antony Dovgal
tony2001Wed Dec 24 10:01:55 2003 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  separate oci_lob_flush() to use it in oci_lob_append() etc. in the future
  
  
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.226 php-src/ext/oci8/oci8.c:1.227
--- php-src/ext/oci8/oci8.c:1.226   Tue Dec 23 11:02:53 2003
+++ php-src/ext/oci8/oci8.c Wed Dec 24 10:01:54 2003
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.226 2003/12/23 16:02:53 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.227 2003/12/24 15:01:54 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -234,6 +234,8 @@
 static sb4 oci_failover_callback(dvoid *svchp,dvoid* envhp,dvoid *fo_ctx,ub4 fo_type, 
ub4 fo_event);
 #endif
 
+static int oci_lob_flush(oci_descriptor*, int);
+
 /* }}} */
 /* {{{ extension function prototypes */
 
@@ -770,7 +772,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.226 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.227 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -3185,6 +3187,46 @@
 
 /* }}} */
 
+/* {{{ oci_lob_flush() */
+static int oci_lob_flush(oci_descriptor* descr, int flush_flag) {
+OCILobLocator *mylob;
+oci_connection *connection;
+
+mylob = (OCILobLocator *) descr-ocidescr;
+
+if (! mylob) {
+return 0;
+}
+
+/* do not really flush buffer, but reporting success
+ * to suppress OCI error when flushing not used buffer
+ * */
+if (descr-buffering != 2) {
+return 1;
+}
+
+connection = descr-conn;
+
+CALL_OCI_RETURN(connection-error, OCILobFlushBuffer(
+connection-pServiceContext,
+connection-pError,
+mylob,
+flush_flag));
+
+oci_debug(OCILobFlushBuffer: flush_flag=%d,flush_flag);
+
+if (connection-error) {
+oci_error(connection-pError, OCILobFlushBuffer, connection-error);
+oci_handle_error(connection, connection-error);
+return 0;
+}
+
+/* marking buffer as enabled and not used */
+descr-buffering = 1;
+return 1;
+}
+/* }}} */
+
 /* {{{ php_oci_fetch_row() */
 static void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int 
expected_args)
 {
@@ -4315,27 +4357,12 @@
/* buffering wasn't enabled, there is nothing to flush */
RETURN_FALSE;
}
-   else if (descr-buffering == 1) {
-   /* buffering is enabled, but not used yet
-  dunno why, but OCI returns error in this case, so I think 
we should suppress it */
-   RETURN_TRUE;
-   }
-   
-   CALL_OCI_RETURN(connection-error, OCILobFlushBuffer(
-   connection-pServiceContext, 
-   connection-pError,
-   mylob,
-   flush_flag));
-
-   oci_debug(OCILobFlushBuffer: flush_flag=%d,flush_flag);
-
-   if (connection-error) {
-   oci_error(connection-pError, OCILobFlushBuffer, 
connection-error);
-   oci_handle_error(connection, connection-error);
-   RETURN_FALSE;
-   }
-
-   RETURN_TRUE;
+
+if (oci_lob_flush(descr,flush_flag) == 1) {
+RETURN_TRUE;
+}
+
+RETURN_FALSE;
}

php_error_docref(NULL TSRMLS_CC, E_NOTICE, oci_lob_flush() should not be 
called like this. Use $somelob-flush() to flush LOB buffer);

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2003-12-23 Thread Antony Dovgal
tony2001Tue Dec 23 04:21:15 2003 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  do not delete connection ids, we need them
  
  
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.223 php-src/ext/oci8/oci8.c:1.224
--- php-src/ext/oci8/oci8.c:1.223   Tue Dec 16 10:58:10 2003
+++ php-src/ext/oci8/oci8.c Tue Dec 23 04:21:14 2003
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.223 2003/12/16 15:58:10 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.224 2003/12/23 09:21:14 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -715,7 +715,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.223 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.224 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -888,8 +888,6 @@
efree(statement-defines);
}
 
-   zend_list_delete(statement-conn-id);
-
oci_debug(END   _oci_stmt_list_dtor: id=%d,statement-id);
 
efree(statement);
@@ -967,7 +965,6 @@
oci_collection *coll = (oci_collection *)rsrc-ptr;
oci_debug(START _oci_coll_list_dtor: %d,coll-id);
 
-   zend_list_delete(coll-conn-id);
/* Note sure if we need to free the object.  Have an
   oracle TAR out on this one.
   OCIDescriptorFree(descr-ocidescr, Z_TYPE_P(descr)); */

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2003-12-23 Thread Antony Dovgal
tony2001Tue Dec 23 10:45:37 2003 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  huge patch
  change almost all func names to match naming conventions
  keep ocifetchinto  *buffering for awhile - they will be rewritten soon
  old names are kept as aliases
  
  Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.224 php-src/ext/oci8/oci8.c:1.225
--- php-src/ext/oci8/oci8.c:1.224   Tue Dec 23 04:21:14 2003
+++ php-src/ext/oci8/oci8.c Tue Dec 23 10:45:36 2003
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.224 2003/12/23 09:21:14 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.225 2003/12/23 15:45:36 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -237,73 +237,73 @@
 /* }}} */
 /* {{{ extension function prototypes */
 
-PHP_FUNCTION(ocibindbyname);
-PHP_FUNCTION(ocidefinebyname);
-PHP_FUNCTION(ocicolumnisnull);
-PHP_FUNCTION(ocicolumnname);
-PHP_FUNCTION(ocicolumnsize);
-PHP_FUNCTION(ocicolumnscale);
-PHP_FUNCTION(ocicolumnprecision);
-PHP_FUNCTION(ocicolumntype);
-PHP_FUNCTION(ocicolumntyperaw);
-PHP_FUNCTION(ociexecute);
-PHP_FUNCTION(ocifetch);
-PHP_FUNCTION(ocicancel);
+PHP_FUNCTION(oci_bind_by_name);
+PHP_FUNCTION(oci_define_by_name);
+PHP_FUNCTION(oci_field_is_null);
+PHP_FUNCTION(oci_field_name);
+PHP_FUNCTION(oci_field_size);
+PHP_FUNCTION(oci_field_scale);
+PHP_FUNCTION(oci_field_precision);
+PHP_FUNCTION(oci_field_type);
+PHP_FUNCTION(oci_field_type_raw);
+PHP_FUNCTION(oci_execute);
+PHP_FUNCTION(oci_fetch);
+PHP_FUNCTION(oci_cancel);
 PHP_FUNCTION(ocifetchinto);
-PHP_FUNCTION(ocifetchstatement);
-PHP_FUNCTION(ocifreestatement);
-PHP_FUNCTION(ociinternaldebug);
-PHP_FUNCTION(ocilogoff);
-PHP_FUNCTION(ocilogon);
-PHP_FUNCTION(ocinlogon);
-PHP_FUNCTION(ociplogon);
-PHP_FUNCTION(ocierror);
-PHP_FUNCTION(ocifreedesc);
-PHP_FUNCTION(ocisavelob);
-PHP_FUNCTION(ocisavelobfile);
-PHP_FUNCTION(ociloadlob);
-PHP_FUNCTION(ocitelllob);
-PHP_FUNCTION(ociwritelob);
-PHP_FUNCTION(ociappendlob);
-PHP_FUNCTION(ocicopylob);
-PHP_FUNCTION(ocitruncatelob);
-PHP_FUNCTION(ocieraselob);
-PHP_FUNCTION(ociflushlob);
+PHP_FUNCTION(oci_fetch_all);
+PHP_FUNCTION(oci_free_statement);
+PHP_FUNCTION(oci_internal_debug);
+PHP_FUNCTION(oci_close);
+PHP_FUNCTION(oci_connect);
+PHP_FUNCTION(oci_new_connect);
+PHP_FUNCTION(oci_pconnect);
+PHP_FUNCTION(oci_error);
+PHP_FUNCTION(oci_free_descriptor);
+PHP_FUNCTION(oci_commit);
+PHP_FUNCTION(oci_rollback);
+PHP_FUNCTION(oci_new_descriptor);
+PHP_FUNCTION(oci_num_fields);
+PHP_FUNCTION(oci_parse);
+PHP_FUNCTION(oci_new_cursor);
+PHP_FUNCTION(oci_result);
+PHP_FUNCTION(oci_server_version);
+PHP_FUNCTION(oci_statement_type);
+PHP_FUNCTION(oci_num_rows);
+PHP_FUNCTION(oci_set_prefetch);
+PHP_FUNCTION(oci_password_change);
+PHP_FUNCTION(oci_lob_save);
+PHP_FUNCTION(oci_lob_import);
+PHP_FUNCTION(oci_lob_export);
+PHP_FUNCTION(oci_lob_load);
+PHP_FUNCTION(oci_lob_tell);
+PHP_FUNCTION(oci_lob_write);
+PHP_FUNCTION(oci_lob_append);
+PHP_FUNCTION(oci_lob_copy);
+PHP_FUNCTION(oci_lob_truncate);
+PHP_FUNCTION(oci_lob_erase);
+PHP_FUNCTION(oci_lob_flush);
 PHP_FUNCTION(ocisetbufferinglob);
 PHP_FUNCTION(ocigetbufferinglob);
-PHP_FUNCTION(ociisequallob);
-PHP_FUNCTION(ocirewindlob);
-PHP_FUNCTION(ocireadlob);
-PHP_FUNCTION(ocieoflob);
-PHP_FUNCTION(ociseeklob);
-PHP_FUNCTION(ocilobgetlength);
-PHP_FUNCTION(ociwritelobtofile);
-PHP_FUNCTION(ocicommit);
-PHP_FUNCTION(ocirollback);
-PHP_FUNCTION(ocinewdescriptor);
-PHP_FUNCTION(ocinumcols);
-PHP_FUNCTION(ociparse);
-PHP_FUNCTION(ocinewcursor);
-PHP_FUNCTION(ociresult);
-PHP_FUNCTION(ociserverversion);
-PHP_FUNCTION(ocistatementtype);
-PHP_FUNCTION(ocirowcount);
-PHP_FUNCTION(ocisetprefetch);
-PHP_FUNCTION(ocipasswordchange);
+PHP_FUNCTION(oci_lob_is_equal);
+PHP_FUNCTION(oci_lob_rewind);
+PHP_FUNCTION(oci_lob_read);
+PHP_FUNCTION(oci_lob_eof);
+PHP_FUNCTION(oci_lob_seek);
+PHP_FUNCTION(oci_lob_size);
 #ifdef HAVE_OCI8_TEMP_LOB
-PHP_FUNCTION(ociwritetemporarylob);
-PHP_FUNCTION(ocicloselob);
+PHP_FUNCTION(oci_lob_write_temporary);
+PHP_FUNCTION(oci_lob_close);
 #endif
 #ifdef PHP_OCI8_HAVE_COLLECTIONS
-PHP_FUNCTION(ocinewcollection);
-PHP_FUNCTION(ocifreecollection);
-PHP_FUNCTION(ocicollappend);
-PHP_FUNCTION(ocicollgetelem);
-PHP_FUNCTION(ocicollassignelem);
-PHP_FUNCTION(ocicollassign);
-PHP_FUNCTION(ocicollsize);
-PHP_FUNCTION(ocicollmax);
-PHP_FUNCTION(ocicolltrim);
+PHP_FUNCTION(oci_new_collection);
+PHP_FUNCTION(oci_free_collection);
+PHP_FUNCTION(oci_collection_append);
+PHP_FUNCTION(oci_collection_element_get);
+PHP_FUNCTION(oci_collection_element_assign);
+PHP_FUNCTION(oci_collection_assign);
+PHP_FUNCTION(oci_collection_size);
+PHP_FUNCTION(oci_collection_max);
+PHP_FUNCTION(oci_collection_trim);
 #endif
 
 #define OCI_GET_STMT(statement,value) \
@@ -363,111 +363,157 @@
 #define OCI_FETCHSTATEMENT_BY   (OCI_FETCHSTATEMENT_BY_COLUMN | 
OCI_FETCHSTATEMENT_BY_ROW)
 
 static zend_function_entry php_oci_functions[] = 

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2003-12-23 Thread Antony Dovgal
tony2001Tue Dec 23 11:02:54 2003 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  add oci_fetch_assoc(), oci_fetch_object(), oci_fetch_array()  oci_fetch_row()
  change ocifetchinto() to use php_oci_fetch_row()
  
  Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.225 php-src/ext/oci8/oci8.c:1.226
--- php-src/ext/oci8/oci8.c:1.225   Tue Dec 23 10:45:36 2003
+++ php-src/ext/oci8/oci8.c Tue Dec 23 11:02:53 2003
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.225 2003/12/23 15:45:36 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.226 2003/12/23 16:02:53 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -250,6 +250,11 @@
 PHP_FUNCTION(oci_fetch);
 PHP_FUNCTION(oci_cancel);
 PHP_FUNCTION(ocifetchinto);
+PHP_FUNCTION(oci_fetch_object);
+PHP_FUNCTION(oci_fetch_row);
+PHP_FUNCTION(oci_fetch_assoc);
+PHP_FUNCTION(oci_fetch_array);
+PHP_FUNCTION(ocifetchstatement);
 PHP_FUNCTION(oci_fetch_all);
 PHP_FUNCTION(oci_free_statement);
 PHP_FUNCTION(oci_internal_debug);
@@ -375,6 +380,10 @@
PHP_FE(oci_execute, NULL)
PHP_FE(oci_cancel,  NULL)
PHP_FE(oci_fetch,   NULL)
+PHP_FE(oci_fetch_object,NULL)
+PHP_FE(oci_fetch_row,   NULL)
+PHP_FE(oci_fetch_assoc, NULL)
+PHP_FE(oci_fetch_array, NULL)
PHP_FE(ocifetchinto,second_arg_force_ref)
PHP_FE(oci_fetch_all,   second_arg_force_ref)
PHP_FE(oci_free_statement,  NULL)
@@ -761,7 +770,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.225 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.226 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -3176,6 +3185,121 @@
 
 /* }}} */
 
+/* {{{ php_oci_fetch_row() */
+static void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int 
expected_args)
+{
+zval **stmt, **arg2, **arg3;
+oci_statement *statement;
+oci_out_column *column;
+ub4 nrows = 1;
+int i, used;
+
+if (ZEND_NUM_ARGS()  expected_args) {
+WRONG_PARAM_COUNT;
+}
+
+if (expected_args  2) {
+/* only for ocifetchinto BC */
+
+switch (ZEND_NUM_ARGS()) {
+case 2:
+if (zend_get_parameters_ex(2, stmt, arg2)==FAILURE) {
+RETURN_FALSE;
+}
+if (!mode) {
+mode = OCI_NUM;
+}
+break;
+case 3:
+if (zend_get_parameters_ex(3, stmt, arg2, 
arg3)==FAILURE) {
+RETURN_FALSE;
+}
+convert_to_long_ex(arg3);
+mode = Z_LVAL_PP(arg3);
+break;
+default:
+WRONG_PARAM_COUNT;
+break;
+
+}
+}
+else {
+switch (ZEND_NUM_ARGS()) {
+case 1:
+if (zend_get_parameters_ex(1, stmt)==FAILURE) {
+RETURN_FALSE;
+}
+if (!mode) {
+mode = OCI_BOTH;
+}
+break;
+case 2:
+if (zend_get_parameters_ex(2, stmt, arg2)==FAILURE) {
+RETURN_FALSE;
+}
+convert_to_long_ex(arg2);
+mode = Z_LVAL_PP(arg2);
+break;
+default:
+WRONG_PARAM_COUNT;
+break;
+}
+}
+
+OCI_GET_STMT(statement,stmt);
+
+if (!oci_fetch(statement, nrows, OCIFetchInto TSRMLS_CC)) {
+RETURN_FALSE;
+}
+
+array_init(return_value);
+
+for (i = 0; i  statement-ncolumns; i++) {
+column = oci_get_col(statement, i + 1, 0);
+if (column == NULL) {
+continue;
+}
+if ((column-indicator == -1)  ((mode  OCI_RETURN_NULLS) == 0)) {
+continue;
+}
+
+if (!(column-indicator == -1)) {
+zval *element;
+MAKE_STD_ZVAL(element);
+

Re: [PHP-CVS] cvs: php-src /ext/oci8 oci8.c php_oci8.h

2003-12-17 Thread Jani Taskinen

When you close bugs, you should tell them that they're not
fixed in PHP 4..especially when the bugs are reported for PHP 4..

And Harald, you should know by now already that @ in commit
message does not work. Edit the NEWS file. (you don't really
need to put that long entry about this in it)

--Jani

On Tue, 16 Dec 2003, Harald Radi wrote:

phanto Tue Dec 16 05:29:12 2003 EDT

  Modified files:  
/php-src/ext/oci8  oci8.c php_oci8.h 
  Log:
  @- fixed #20006, #22674 and #24531 (harald)
  @- added ZTS connection pooling support to the oci extension
  @  connections will now be pooled per process and not
  @  per thread anymore. the number of persistent and active
  @  connections is now also shown in the phpinfo() output (harald)
  
  

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c php_oci8.h

2003-12-16 Thread Harald Radi
phanto  Tue Dec 16 05:29:12 2003 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c php_oci8.h 
  Log:
  @- fixed #20006, #22674 and #24531 (harald)
  @- added ZTS connection pooling support to the oci extension
  @  connections will now be pooled per process and not
  @  per thread anymore. the number of persistent and active
  @  connections is now also shown in the phpinfo() output (harald)
  
  Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.219 php-src/ext/oci8/oci8.c:1.220
--- php-src/ext/oci8/oci8.c:1.219   Mon Dec 15 08:53:01 2003
+++ php-src/ext/oci8/oci8.c Tue Dec 16 05:29:11 2003
@@ -18,15 +18,20 @@
|  |
| Collection support by Andy Sautins [EMAIL PROTECTED]   |
| Temporary LOB support by David Benson [EMAIL PROTECTED]  |
+   | ZTS per process OCIPLogon by Harald Radi [EMAIL PROTECTED]|
+--+
  */
 
-/* $Id: oci8.c,v 1.219 2003/12/15 13:53:01 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.220 2003/12/16 10:29:11 phanto Exp $ */
 
 /* TODO list:
  *
  * - php.ini flags 
  *   especialliy important for things like oci_ping
+ * allowpconns
+ * timeout
+ * maxlifetime
+ * maxpconns
  * - Change return-value for OCIFetch*() (1-row read, 0-Normal end, false-error) 
  * - Error mode (print or shut up?)
  * - binding of arrays
@@ -37,7 +42,6 @@
  * - make OCIInternalDebug accept a mask of flags
  * - have one ocifree() call.
  * - make it possible to have persistent statements?
- * - implement connection pooling in ZTS mode.
  * - failover
  * - change all the lob stuff to work without classes (optional)! 
  * - make sure that the callbacks terminate the strings with \0
@@ -60,6 +64,7 @@
 
 #include php.h
 #include ext/standard/info.h
+#include php_ini.h
 
 /* #define HAVE_OCI8_TEMP_LOB 1 */
 #define WITH_COLLECTIONS 1
@@ -68,6 +73,13 @@
 
 #include php_oci8.h
 
+/* True globals, only used by thread safe functions */
+static TsHashTable *persistent_servers;
+static TsHashTable *persistent_sessions;
+
+static long num_persistent = 0;
+static long num_links = 0;
+
 /* True globals, no need for thread safety */
 static int le_conn;
 static int le_stmt;
@@ -91,6 +103,21 @@
 
 #define SAFE_STRING(s) ((s)?(s):)
 
+#ifdef ZTS
+MUTEX_T mx_lock;
+
+#define mutex_alloc() tsrm_mutex_alloc()
+#define mutex_free(mutex) tsrm_mutex_free(mutex)
+#define mutex_lock(mutex) tsrm_mutex_lock(mutex)
+#define mutex_unlock(mutex) tsrm_mutex_unlock(mutex)
+#define thread_id()tsrm_thread_id()
+#else
+#define mutex_alloc()
+#define mutex_free(mutex)
+#define mutex_lock(mutex)
+#define mutex_unlock(mutex)
+#define thread_id() 1
+#endif
 
 /* dirty marcos to make sure we _never_ call oracle-functions recursivly 
  *
@@ -462,35 +489,6 @@
 };
 
 /* }}} */
-/* {{{ debug malloc/realloc/free */
-
-#define OCI_USE_EMALLOC 0  /* set this to 1 if you want to use the php 
memory manager! */
-
-#if OCI_USE_EMALLOC
-CONST dvoid *ocimalloc(dvoid *ctx, size_t size)
-{
-   dvoid *ret;
-   ret = (dvoid *)malloc(size);
-   oci_debug(ocimalloc(%d) = %08x, size,ret);
-   return ret;
-}
-
-CONST dvoid *ocirealloc(dvoid *ctx, dvoid *ptr, size_t size)
-{
-   dvoid *ret;
-   oci_debug(ocirealloc(%08x, %d), ptr, size);
-   ret = (dvoid *)realloc(ptr, size);
-   return ptr;
-}
-
-CONST void ocifree(dvoid *ctx, dvoid *ptr)
-{
-   oci_debug(ocifree(%08x), ptr);
-   free(ptr);
-}
-#endif
-
-/* }}} */
 /* {{{ startup, shutdown and info functions */
 
 static void php_oci_init_globals(php_oci_globals *oci_globals_p TSRMLS_DC)
@@ -498,12 +496,6 @@
OCI(shutdown)   = 0;
OCI(in_call)= 0;
 
-   OCI(user) = malloc(sizeof(HashTable));
-   zend_hash_init(OCI(user), 13, NULL, NULL, 1);
-
-   OCI(server) = malloc(sizeof(HashTable));
-   zend_hash_init(OCI(server), 13, NULL, NULL, 1); 
-
CALL_OCI(OCIEnvInit(
OCI(pEnv), 
OCI_DEFAULT, 
@@ -518,6 +510,27 @@
NULL));
 }
 
+static int _sessions_pcleanup(zend_llist *session_list TSRMLS_DC)
+{
+   zend_llist_destroy(session_list);
+
+   return 1;
+}
+
+static int _session_pcleanup(oci_session *session TSRMLS_DC)
+{
+   _oci_close_session(session);
+
+   return 1;
+}
+
+static int _server_pcleanup(oci_server *server TSRMLS_DC)
+{
+   _oci_close_server(server);
+
+   return 1;
+}
+
 PHP_MINIT_FUNCTION(oci)
 {
zend_class_entry oci_lob_class_entry;
@@ -543,11 +556,14 @@
 
 #endif
 
-#if OCI_USE_EMALLOC
-   OCIInitialize(PHP_OCI_INIT_MODE, NULL, ocimalloc, ocirealloc, ocifree);
-#else
+   mx_lock = mutex_alloc();
+
+   persistent_servers = malloc(sizeof(TsHashTable));
+   persistent_sessions = malloc(sizeof(TsHashTable));
+   

[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2003-12-16 Thread Harald Radi
phanto  Tue Dec 16 06:15:56 2003 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix non-zts build errors
  
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.220 php-src/ext/oci8/oci8.c:1.221
--- php-src/ext/oci8/oci8.c:1.220   Tue Dec 16 05:29:11 2003
+++ php-src/ext/oci8/oci8.c Tue Dec 16 06:15:55 2003
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.220 2003/12/16 10:29:11 phanto Exp $ */
+/* $Id: oci8.c,v 1.221 2003/12/16 11:15:55 phanto Exp $ */
 
 /* TODO list:
  *
@@ -106,13 +106,13 @@
 #ifdef ZTS
 MUTEX_T mx_lock;
 
-#define mutex_alloc() tsrm_mutex_alloc()
+#define mutex_alloc(mutex) mutex = tsrm_mutex_alloc()
 #define mutex_free(mutex) tsrm_mutex_free(mutex)
 #define mutex_lock(mutex) tsrm_mutex_lock(mutex)
 #define mutex_unlock(mutex) tsrm_mutex_unlock(mutex)
 #define thread_id()tsrm_thread_id()
 #else
-#define mutex_alloc()
+#define mutex_alloc(mutex)
 #define mutex_free(mutex)
 #define mutex_lock(mutex)
 #define mutex_unlock(mutex)
@@ -556,7 +556,7 @@
 
 #endif
 
-   mx_lock = mutex_alloc();
+   mutex_alloc(mx_lock);
 
persistent_servers = malloc(sizeof(TsHashTable));
persistent_sessions = malloc(sizeof(TsHashTable));
@@ -712,7 +712,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.220 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.221 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -2481,11 +2481,11 @@
smart_str_0(hashed_details);
 
if (! exclusive) {
-   if (zend_ts_hash_find(persistent_sessions, hashed_details.c, 
hashed_details.len+1, session_list) != SUCCESS) {
+   if (zend_ts_hash_find(persistent_sessions, hashed_details.c, 
hashed_details.len+1, (void **) session_list) != SUCCESS) {
zend_llist tmp;
/* first session, set up a session list */
zend_llist_init(tmp, sizeof(oci_session), (llist_dtor_func_t) 
_session_pcleanup, 1);
-   zend_ts_hash_update(persistent_sessions, hashed_details.c, 
hashed_details.len+1, tmp, sizeof(zend_llist), session_list);
+   zend_ts_hash_update(persistent_sessions, hashed_details.c, 
hashed_details.len+1, tmp, sizeof(zend_llist), (void **) session_list);
} else {
mutex_lock(mx_lock);
 
@@ -2683,8 +2683,11 @@
 /* {{{ _oci_close_session()
  */
 
-static int _session_compare(oci_session *sess1, oci_session *sess2)
+static int _session_compare(void *a, void *b)
 {
+   oci_session *sess1 = (oci_session*) a;
+   oci_session *sess2 = (oci_session*) b;
+   
return sess1-num = sess2-num;
 }
 

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c

2003-12-16 Thread Antony Dovgal
tony2001Tue Dec 16 10:48:22 2003 EDT

  Modified files:  
/php-src/ext/oci8   oci8.c 
  Log:
  fix warning, concerned to second _oci_close_server() call
  
  
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.221 php-src/ext/oci8/oci8.c:1.222
--- php-src/ext/oci8/oci8.c:1.221   Tue Dec 16 06:15:55 2003
+++ php-src/ext/oci8/oci8.c Tue Dec 16 10:48:20 2003
@@ -22,7 +22,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.221 2003/12/16 11:15:55 phanto Exp $ */
+/* $Id: oci8.c,v 1.222 2003/12/16 15:48:20 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -712,7 +712,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.221 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.222 $);
 
sprintf(buf, %ld, num_persistent);
php_info_print_table_row(2, Active Persistent Links, buf);
@@ -990,11 +990,13 @@
 static void 
 _oci_server_list_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
+#if 0
oci_server *server = (oci_server *)rsrc-ptr;
if (server-persistent)
return;
 
_oci_close_server(server);
+#endif
 }
 
 /* }}} */

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



  1   2   >