[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c branches/PHP_5_3/ext/oci8/package.xml branches/PHP_5_4/ext/oci8/oci8.c branches/PHP_5_4/ext/oci8/package.xml trunk/ext/oci8/oci8.c trunk/e

2011-11-18 Thread Christopher Jones
sixd Fri, 18 Nov 2011 09:59:35 +

Revision: http://svn.php.net/viewvc?view=revision&revision=319457

Log:
Sync to 5.3 and check additional cases for #55748

Bug: https://bugs.php.net/55748 (Closed) multiple NULL Pointer Dereference with 
zend_strndup()
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_3/ext/oci8/package.xml
U   php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_4/ext/oci8/package.xml
U   php/php-src/trunk/ext/oci8/oci8.c
U   php/php-src/trunk/ext/oci8/package.xml

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-11-18 09:26:01 UTC 
(rev 319456)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-11-18 09:59:35 UTC 
(rev 319457)
@@ -2054,7 +2054,14 @@
connection->is_persistent = 0;
} else {
connection = (php_oci_connection *) calloc(1, 
sizeof(php_oci_connection));
+   if (connection == NULL) {
+   return NULL;
+   }
connection->hash_key = zend_strndup(hashed_details.c, 
hashed_details.len);
+   if (connection->hash_key == NULL) {
+   free(connection);
+   return NULL;
+   }
connection->is_persistent = 1;
}
} else {
@@ -2704,12 +2711,20 @@
ub4 poolmode = OCI_DEFAULT; /* Mode to be passed to 
OCISessionPoolCreate */
OCIAuthInfo *spoolAuth = NULL;

-   /*Allocate sessionpool out of persistent memory */
+   /* Allocate sessionpool out of persistent memory */
session_pool = (php_oci_spool *) calloc(1, sizeof(php_oci_spool));
+   if (session_pool == NULL) {
+   iserror = 1;
+   goto exit_create_spool;
+   }

/* Populate key if passed */
if (hash_key_len) {
session_pool->spool_hash_key = zend_strndup(hash_key, 
hash_key_len);
+   if (session_pool->spool_hash_key == NULL) {
+   iserror = 1;
+   goto exit_create_spool;
+   }
}

/* Create the session pool's env */

Modified: php/php-src/branches/PHP_5_3/ext/oci8/package.xml
===
--- php/php-src/branches/PHP_5_3/ext/oci8/package.xml   2011-11-18 09:26:01 UTC 
(rev 319456)
+++ php/php-src/branches/PHP_5_3/ext/oci8/package.xml   2011-11-18 09:59:35 UTC 
(rev 319457)
@@ -47,6 +47,7 @@
  http://www.php.net/license";>PHP
  
   Fixed bug #59985 (show normal warning text for OCI_NO_DATA)
+  Fixed OCI8 part of bug #55748 (CVE-2011-4153: multiple NULL Pointer 
Dereference with zend_strndup)
   Increased maximum Oracle error message buffer length for new Oracle 11.2.0.3 
size
   Improve internal initalization failure error messages
  

Modified: php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-11-18 09:26:01 UTC 
(rev 319456)
+++ php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-11-18 09:59:35 UTC 
(rev 319457)
@@ -2054,8 +2054,12 @@
connection->is_persistent = 0;
} else {
connection = (php_oci_connection *) calloc(1, 
sizeof(php_oci_connection));
+   if (connection == NULL) {
+   return NULL;
+   }
connection->hash_key = zend_strndup(hashed_details.c, 
hashed_details.len);
-   if(connection->hash_key == NULL) {
+   if (connection->hash_key == NULL) {
+   free(connection);
return NULL;
}
connection->is_persistent = 1;
@@ -2707,12 +2711,20 @@
ub4 poolmode = OCI_DEFAULT; /* Mode to be passed to 
OCISessionPoolCreate */
OCIAuthInfo *spoolAuth = NULL;

-   /*Allocate sessionpool out of persistent memory */
+   /* Allocate sessionpool out of persistent memory */
session_pool = (php_oci_spool *) calloc(1, sizeof(php_oci_spool));
+   if (session_pool == NULL) {
+   iserror = 1;
+   goto exit_create_spool;
+   }

/* Populate key if passed */
if (hash_key_len) {
session_pool->spool_hash_key = zend_strndup(hash_key, 
hash_key_len);
+   if (session_pool->spool_hash_key == NULL) {
+   iserror = 1;
+   goto exit_create_spool;
+   }
}

/* Create the session 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c branches/PHP_5_3/ext/oci8/package.xml branches/PHP_5_4/ext/oci8/oci8.c branches/PHP_5_4/ext/oci8/package.xml trunk/ext/oci8/oci8.c trunk/e

2011-11-07 Thread Christopher Jones
sixd Mon, 07 Nov 2011 20:10:41 +

Revision: http://svn.php.net/viewvc?view=revision&revision=31

Log:
Improve OCI8 NLS env creation error messages (#58925)

Bug: https://bugs.php.net/58925 (Assigned) No error information available when 
php_oci_create_env fails
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_3/ext/oci8/package.xml
U   php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_4/ext/oci8/package.xml
U   php/php-src/trunk/ext/oci8/oci8.c
U   php/php-src/trunk/ext/oci8/package.xml

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-11-07 19:23:17 UTC 
(rev 318887)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-11-07 20:10:41 UTC 
(rev 31)
@@ -2901,11 +2901,20 @@
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) {
+   sb4   ora_error_code = 0;
+   text  ora_msg_buf[OCI_ERROR_MAXMSG_SIZE];  /* Use traditional 
smaller size: non-PL/SQL errors should fit and it keeps the stack smaller */
+
 #ifdef HAVE_OCI_INSTANT_CLIENT
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 and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right 
directories");
 #endif
+   if (retenv
+   && OCIErrorGet(retenv, (ub4)1, NULL, &ora_error_code, 
ora_msg_buf, (ub4)OCI_ERROR_MAXMSG_SIZE, (ub4)OCI_HTYPE_ENV) == OCI_SUCCESS
+   && *ora_msg_buf) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", 
ora_msg_buf);
+   }
+
return NULL;
}
return retenv;

Modified: php/php-src/branches/PHP_5_3/ext/oci8/package.xml
===
--- php/php-src/branches/PHP_5_3/ext/oci8/package.xml   2011-11-07 19:23:17 UTC 
(rev 318887)
+++ php/php-src/branches/PHP_5_3/ext/oci8/package.xml   2011-11-07 20:10:41 UTC 
(rev 31)
@@ -47,6 +47,7 @@
  http://www.php.net/license";>PHP
  
   Increased maximum possible Oracle DB error message length
+  Improve internal initalization failure error messages
  
  
   

Modified: php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-11-07 19:23:17 UTC 
(rev 318887)
+++ php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-11-07 20:10:41 UTC 
(rev 31)
@@ -2901,11 +2901,20 @@
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) {
+   sb4   ora_error_code = 0;
+   text  ora_msg_buf[OCI_ERROR_MAXMSG_SIZE];  /* Use traditional 
smaller size: non-PL/SQL errors should fit and it keeps the stack smaller */
+
 #ifdef HAVE_OCI_INSTANT_CLIENT
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 and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right 
directories");
 #endif
+   if (retenv
+   && OCIErrorGet(retenv, (ub4)1, NULL, &ora_error_code, 
ora_msg_buf, (ub4)OCI_ERROR_MAXMSG_SIZE, (ub4)OCI_HTYPE_ENV) == OCI_SUCCESS
+   && *ora_msg_buf) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", 
ora_msg_buf);
+   }
+
return NULL;
}
return retenv;

Modified: php/php-src/branches/PHP_5_4/ext/oci8/package.xml
===
--- php/php-src/branches/PHP_5_4/ext/oci8/package.xml   2011-11-07 19:23:17 UTC 
(rev 318887)
+++ php/php-src/branches/PHP_5_4/ext/oci8/package.xml   2011-11-07 20:10:41 UTC 
(rev 31)
@@ -47,6 +47,7 @@
  http://www.php.net/license";>PHP
  
   Increased maximum possible Oracle DB error message length
+  Improve internal ini

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c branches/PHP_5_4/ext/oci8/oci8.c trunk/ext/oci8/oci8.c

2011-10-31 Thread Christopher Jones
sixd Mon, 31 Oct 2011 20:48:25 +

Revision: http://svn.php.net/viewvc?view=revision&revision=318619

Log:
OCI8: improve initialization error message (See bug 60154)

Bug: https://bugs.php.net/60154 (Bogus) OCIEnvNlsCreate() failed. please check 
that LD_LIBRARY_PATH includes ...
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
U   php/php-src/trunk/ext/oci8/oci8.c

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-10-31 19:34:59 UTC 
(rev 318618)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-10-31 20:48:25 UTC 
(rev 318619)
@@ -79,11 +79,14 @@
 #endif

 /* 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"
+#elif defined(_AIX)
+#define PHP_OCI8_LIB_PATH_MSG "LIBPATH"
+#elif defined(__hpux)
+#define PHP_OCI8_LIB_PATH_MSG "SHLIB_PATH"
 #else
 #define PHP_OCI8_LIB_PATH_MSG "LD_LIBRARY_PATH"
 #endif

Modified: php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-10-31 19:34:59 UTC 
(rev 318618)
+++ php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-10-31 20:48:25 UTC 
(rev 318619)
@@ -79,11 +79,14 @@
 #endif

 /* 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"
+#elif defined(_AIX)
+#define PHP_OCI8_LIB_PATH_MSG "LIBPATH"
+#elif defined(__hpux)
+#define PHP_OCI8_LIB_PATH_MSG "SHLIB_PATH"
 #else
 #define PHP_OCI8_LIB_PATH_MSG "LD_LIBRARY_PATH"
 #endif

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2011-10-31 19:34:59 UTC (rev 318618)
+++ php/php-src/trunk/ext/oci8/oci8.c   2011-10-31 20:48:25 UTC (rev 318619)
@@ -79,11 +79,14 @@
 #endif

 /* 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"
+#elif defined(_AIX)
+#define PHP_OCI8_LIB_PATH_MSG "LIBPATH"
+#elif defined(__hpux)
+#define PHP_OCI8_LIB_PATH_MSG "SHLIB_PATH"
 #else
 #define PHP_OCI8_LIB_PATH_MSG "LD_LIBRARY_PATH"
 #endif

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c branches/PHP_5_4/ext/oci8/oci8.c trunk/ext/oci8/oci8.c

2011-07-25 Thread Christopher Jones
sixd Mon, 25 Jul 2011 23:40:57 +

Revision: http://svn.php.net/viewvc?view=revision&revision=313688

Log:
Fix cast warning seen on some platforms

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
U   php/php-src/trunk/ext/oci8/oci8.c

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-07-25 21:39:53 UTC 
(rev 313687)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-07-25 23:40:57 UTC 
(rev 313688)
@@ -37,6 +37,13 @@
 #include "php_ini.h"
 #include "ext/standard/php_smart_str.h"

+#ifdef HAVE_STDINT_H
+#include 
+#endif
+#ifdef PHP_WIN32
+#include "win32/php_stdint.h"
+#endif
+
 #if HAVE_OCI8

 #if PHP_MAJOR_VERSION > 5
@@ -51,6 +58,14 @@
 #include "php_oci8_int.h"
 #include "zend_hash.h"

+#if defined(HAVE_STDINT_H) || defined(PHP_WIN32)
+#define OCI8_INT_TO_PTR(I)  ((void *)(intptr_t)(I))
+#define OCI8_PTR_TO_INT(P)  ((int)(intptr_t)(P))
+#else
+#define OCI8_INT_TO_PTR(I)  ((void *)(I))
+#define OCI8_PTR_TO_INT(P)  ((int)(P))
+#endif
+
 ZEND_DECLARE_MODULE_GLOBALS(oci)
 #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 
5)
 /* This "if" allows PECL builds from this file to be portable to older PHP 
releases */
@@ -1877,7 +1892,7 @@
int type, link;
void *ptr;

-   link = (int) le->ptr;
+   link = OCI8_PTR_TO_INT(le->ptr);
ptr = zend_list_find(link,&type);
if (ptr && (type == le_connection)) {
connection = (php_oci_connection *)ptr;
@@ -2116,7 +2131,7 @@
 #else
connection->rsrc_id = zend_list_insert(connection, 
le_connection);
 #endif
-   new_le.ptr = (void *)connection->rsrc_id;
+   new_le.ptr = OCI8_INT_TO_PTR(connection->rsrc_id);
new_le.type = le_index_ptr;
zend_hash_update(&EG(regular_list), connection->hash_key, 
strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), 
NULL);
OCI_G(num_links)++;

Modified: php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-07-25 21:39:53 UTC 
(rev 313687)
+++ php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-07-25 23:40:57 UTC 
(rev 313688)
@@ -37,6 +37,13 @@
 #include "php_ini.h"
 #include "ext/standard/php_smart_str.h"

+#ifdef HAVE_STDINT_H
+#include 
+#endif
+#ifdef PHP_WIN32
+#include "win32/php_stdint.h"
+#endif
+
 #if HAVE_OCI8

 #if PHP_MAJOR_VERSION > 5
@@ -51,6 +58,14 @@
 #include "php_oci8_int.h"
 #include "zend_hash.h"

+#if defined(HAVE_STDINT_H) || defined(PHP_WIN32)
+#define OCI8_INT_TO_PTR(I)  ((void *)(intptr_t)(I))
+#define OCI8_PTR_TO_INT(P)  ((int)(intptr_t)(P))
+#else
+#define OCI8_INT_TO_PTR(I)  ((void *)(I))
+#define OCI8_PTR_TO_INT(P)  ((int)(P))
+#endif
+
 ZEND_DECLARE_MODULE_GLOBALS(oci)
 #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 
5)
 /* This "if" allows PECL builds from this file to be portable to older PHP 
releases */
@@ -1877,7 +1892,7 @@
int type, link;
void *ptr;

-   link = (int) le->ptr;
+   link = OCI8_PTR_TO_INT(le->ptr);
ptr = zend_list_find(link,&type);
if (ptr && (type == le_connection)) {
connection = (php_oci_connection *)ptr;
@@ -2116,7 +2131,7 @@
 #else
connection->rsrc_id = zend_list_insert(connection, 
le_connection);
 #endif
-   new_le.ptr = (void *)connection->rsrc_id;
+   new_le.ptr = OCI8_INT_TO_PTR(connection->rsrc_id);
new_le.type = le_index_ptr;
zend_hash_update(&EG(regular_list), connection->hash_key, 
strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), 
NULL);
OCI_G(num_links)++;

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2011-07-25 21:39:53 UTC (rev 313687)
+++ php/php-src/trunk/ext/oci8/oci8.c   2011-07-25 23:40:57 UTC (rev 313688)
@@ -37,6 +37,13 @@
 #include "php_ini.h"
 #include "ext/standard/php_smart_str.h"

+#ifdef HAVE_STDINT_H
+#include 
+#endif
+#ifdef PHP_WIN32
+#include "win32/php_stdint.h"
+#endif
+
 #if HAVE_OCI8

 #if PHP_MAJOR_VERSION > 5
@@ -51,6 +58,14 @@
 #include "php_oci8_int.h"
 #include "zend_hash.h"

+#if defined(HAVE_STDINT_H) || defined(PHP_WIN32)
+#define OCI8_INT_TO_PTR(

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c branches/PHP_5_4/ext/oci8/oci8.c trunk/ext/oci8/oci8.c

2011-07-25 Thread Christopher Jones
sixd Mon, 25 Jul 2011 17:30:09 +

Revision: http://svn.php.net/viewvc?view=revision&revision=313681

Log:
Patch r313663 and r313665 to allow PECL builds to work with earlier releases

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
U   php/php-src/trunk/ext/oci8/oci8.c

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-07-25 17:25:47 UTC 
(rev 313680)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-07-25 17:30:09 UTC 
(rev 313681)
@@ -937,7 +937,11 @@
PHP_FALIAS(ocicollsize, oci_collection_size,
arginfo_oci_collection_size)
PHP_FALIAS(ocicollmax,  oci_collection_max, 
arginfo_oci_collection_max)
PHP_FALIAS(ocicolltrim, oci_collection_trim,
arginfo_oci_collection_trim)
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION 
>= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || 
(PHP_MAJOR_VERSION > 5)
PHP_FE_END
+#else
+   {NULL,NULL,NULL}
+#endif
 };

 static
@@ -968,7 +972,11 @@
PHP_FALIAS(save,oci_lob_save,   
arginfo_oci_lob_save_method)
PHP_FALIAS(savefile,oci_lob_import, 
arginfo_oci_lob_import_method)
PHP_FALIAS(free,oci_free_descriptor,
arginfo_oci_free_descriptor_method)
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION 
>= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || 
(PHP_MAJOR_VERSION > 5)
PHP_FE_END
+#else
+   {NULL,NULL,NULL}
+#endif
 };

 static
@@ -985,7 +993,11 @@
PHP_FALIAS(max,   oci_collection_max,   
arginfo_oci_collection_max_method)
PHP_FALIAS(trim,  oci_collection_trim,  
arginfo_oci_collection_trim_method)
PHP_FALIAS(free,  oci_free_collection,  
arginfo_oci_collection_free_method)
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION 
>= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || 
(PHP_MAJOR_VERSION > 5)
PHP_FE_END
+#else
+   {NULL,NULL,NULL}
+#endif
 };

 zend_module_entry oci8_module_entry = {

Modified: php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-07-25 17:25:47 UTC 
(rev 313680)
+++ php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-07-25 17:30:09 UTC 
(rev 313681)
@@ -937,7 +937,11 @@
PHP_FALIAS(ocicollsize, oci_collection_size,
arginfo_oci_collection_size)
PHP_FALIAS(ocicollmax,  oci_collection_max, 
arginfo_oci_collection_max)
PHP_FALIAS(ocicolltrim, oci_collection_trim,
arginfo_oci_collection_trim)
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION 
>= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || 
(PHP_MAJOR_VERSION > 5)
PHP_FE_END
+#else
+   {NULL,NULL,NULL}
+#endif
 };

 static
@@ -968,7 +972,11 @@
PHP_FALIAS(save,oci_lob_save,   
arginfo_oci_lob_save_method)
PHP_FALIAS(savefile,oci_lob_import, 
arginfo_oci_lob_import_method)
PHP_FALIAS(free,oci_free_descriptor,
arginfo_oci_free_descriptor_method)
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION 
>= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || 
(PHP_MAJOR_VERSION > 5)
PHP_FE_END
+#else
+   {NULL,NULL,NULL}
+#endif
 };

 static
@@ -985,7 +993,11 @@
PHP_FALIAS(max,   oci_collection_max,   
arginfo_oci_collection_max_method)
PHP_FALIAS(trim,  oci_collection_trim,  
arginfo_oci_collection_trim_method)
PHP_FALIAS(free,  oci_free_collection,  
arginfo_oci_collection_free_method)
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION 
>= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || 
(PHP_MAJOR_VERSION > 5)
PHP_FE_END
+#else
+   {NULL,NULL,NULL}
+#endif
 };

 zend_module_entry oci8_module_entry = {

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2011-07-25 17:25:47 UTC (rev 313680)
+++ php/php-src/trunk/ext/oci8/oci8.c   2011-07-25 17:30:09 UTC (rev 313681)
@@ -937,7 +937,11 @@
PHP_FALIAS(ocicollsize, oci_collection_size,
arginfo_oci_collection_size)

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c branches/PHP_5_4/ext/oci8/oci8.c trunk/ext/oci8/oci8.c

2011-06-10 Thread Christopher Jones
sixd Sat, 11 Jun 2011 00:24:26 +

Revision: http://svn.php.net/viewvc?view=revision&revision=312039

Log:
Fix TSRMLS for Windows build

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
U   php/php-src/trunk/ext/oci8/oci8.c

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-06-11 00:16:37 UTC 
(rev 312038)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-06-11 00:24:26 UTC 
(rev 312039)
@@ -1314,7 +1314,7 @@
php_info_print_table_row(2, "Active Connections", buf);

 #if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && 
(OCI_MINOR_VERSION >= 2)))
-   php_oci_client_get_version(&ver TSRMLS_DC);
+   php_oci_client_get_version(&ver TSRMLS_CC);
php_info_print_table_row(2, "Oracle Run-time Client Library Version", 
ver);
efree(ver);
 #endif

Modified: php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-06-11 00:16:37 UTC 
(rev 312038)
+++ php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-06-11 00:24:26 UTC 
(rev 312039)
@@ -1314,7 +1314,7 @@
php_info_print_table_row(2, "Active Connections", buf);

 #if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && 
(OCI_MINOR_VERSION >= 2)))
-   php_oci_client_get_version(&ver TSRMLS_DC);
+   php_oci_client_get_version(&ver TSRMLS_CC);
php_info_print_table_row(2, "Oracle Run-time Client Library Version", 
ver);
efree(ver);
 #endif

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2011-06-11 00:16:37 UTC (rev 312038)
+++ php/php-src/trunk/ext/oci8/oci8.c   2011-06-11 00:24:26 UTC (rev 312039)
@@ -1314,7 +1314,7 @@
php_info_print_table_row(2, "Active Connections", buf);

 #if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && 
(OCI_MINOR_VERSION >= 2)))
-   php_oci_client_get_version(&ver TSRMLS_DC);
+   php_oci_client_get_version(&ver TSRMLS_CC);
php_info_print_table_row(2, "Oracle Run-time Client Library Version", 
ver);
efree(ver);
 #endif

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c branches/PHP_5_3/ext/oci8/oci8_interface.c branches/PHP_5_3/ext/oci8/oci8_lob.c branches/PHP_5_3/ext/oci8/php_oci8.h branches/PHP_5_4/ext/

2011-06-07 Thread Christopher Jones
sixd Tue, 07 Jun 2011 23:53:02 +

Revision: http://svn.php.net/viewvc?view=revision&revision=311905

Log:
Sync OCI8 branches. Allow 'pecl install' to work on both PHP 5.3 & 5.4

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8_interface.c
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8_lob.c
U   php/php-src/branches/PHP_5_3/ext/oci8/php_oci8.h
U   php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_4/ext/oci8/oci8_interface.c
U   php/php-src/branches/PHP_5_4/ext/oci8/oci8_lob.c
U   php/php-src/branches/PHP_5_4/ext/oci8/php_oci8.h
U   php/php-src/trunk/ext/oci8/oci8.c
U   php/php-src/trunk/ext/oci8/oci8_interface.c
U   php/php-src/trunk/ext/oci8/oci8_lob.c
U   php/php-src/trunk/ext/oci8/php_oci8.h

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c	2011-06-07 23:29:22 UTC (rev 311904)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c	2011-06-07 23:53:02 UTC (rev 311905)
@@ -1042,7 +1042,7 @@
 #endif
 		if (OCI_G(env)
 			&& OCIErrorGet(OCI_G(env), (ub4)1, NULL, &ora_error_code, tmp_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ENV) == OCI_SUCCESS
-  			&& *tmp_buf) {
+			&& *tmp_buf) {
 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tmp_buf);
 		}

@@ -1754,13 +1754,13 @@
 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;
 			}
-			/*	Disable privileged connections in Safe Mode (N.b. safe mode has been removed in PHP
-			 *	6 anyway)
-			 */
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
+			/* Safe mode has been removed in PHP 5.4 */
 			if (PG(safe_mode)) {
 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Privileged connect is disabled in Safe Mode");
 return NULL;
 			}
+#endif
 		}
 	}

@@ -1922,7 +1922,11 @@
 memcmp(tmp->hash_key, hashed_details.c, hashed_details.len) == 0 && zend_list_addref(connection->rsrc_id) == SUCCESS) {
 /* do nothing */
 			} else {
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
+connection->rsrc_id = zend_list_insert(connection, le_pconnection TSRMLS_CC);
+#else
 connection->rsrc_id = zend_list_insert(connection, le_pconnection);
+#endif
 /* Persistent connections: For old close semantics we artificially
  * bump up the refcount to prevent the non-persistent destructor
  * from getting called until request shutdown. The refcount is
@@ -2066,7 +2070,11 @@
 		new_le.ptr = connection;
 		new_le.type = le_pconnection;
 		connection->used_this_request = 1;
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
+		connection->rsrc_id = zend_list_insert(connection, le_pconnection TSRMLS_CC);
+#else
 		connection->rsrc_id = zend_list_insert(connection, le_pconnection);
+#endif

 		/* Persistent connections: For old close semantics we artificially bump up the refcount to
 		 * prevent the non-persistent destructor from getting called until request shutdown. The
@@ -2079,13 +2087,21 @@
 		OCI_G(num_persistent)++;
 		OCI_G(num_links)++;
 	} else if (!exclusive) {
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
+		connection->rsrc_id = zend_list_insert(connection, le_connection TSRMLS_CC);
+#else
 		connection->rsrc_id = zend_list_insert(connection, le_connection);
+#endif
 		new_le.ptr = (void *)connection->rsrc_id;
 		new_le.type = le_index_ptr;
 		zend_hash_update(&EG(regular_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), NULL);
 		OCI_G(num_links)++;
 	} else {
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
+		connection->rsrc_id = zend_list_insert(connection, le_connection TSRMLS_CC);
+#else
 		connection->rsrc_id = zend_list_insert(connection, le_connection);
+#endif
 		OCI_G(num_links)++;
 	}

@@ -2778,7 +2794,11 @@
 		}
 		spool_le.ptr  = session_pool;
 		spool_le.type = le_psessionpool;
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
+		zend_list_insert(session_pool, le_psessionpool TSRMLS_CC);
+#else
 		zend_list_insert(session_pool, le_psessionpool);
+#endif
 		zend_hash_update(&EG(persistent_list), session_pool->spool_hash_key, strlen(session_pool->spool_hash_key)+1,(void *)&spool_le, sizeof(zend_rsrc_list_entry),NULL);
 	} else if (spool_out_le->type == le_psessionpool &&
 		strlen(((php_oci_spool *)(spool_out_le->ptr))->spool_hash_key) == spool_hashed_details.len &&

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8_interface.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c trunk/ext/oci8/oci8.c

2010-11-10 Thread Christopher Jones
sixd Wed, 10 Nov 2010 18:59:56 +

Revision: http://svn.php.net/viewvc?view=revision&revision=305257

Log:
Improve startup failure error messages

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/trunk/ext/oci8/oci8.c

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2010-11-10 18:49:55 UTC 
(rev 305256)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2010-11-10 18:59:56 UTC 
(rev 305257)
@@ -1040,6 +1040,12 @@
 #else
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
+   if (OCI_G(env)
+   && OCIErrorGet(OCI_G(env), (ub4)1, NULL, 
&ora_error_code, tmp_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ENV) == 
OCI_SUCCESS
+   && *tmp_buf) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", 
tmp_buf);
+   }
+
OCI_G(env) = NULL;
OCI_G(err) = NULL;
return;

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2010-11-10 18:49:55 UTC (rev 305256)
+++ php/php-src/trunk/ext/oci8/oci8.c   2010-11-10 18:59:56 UTC (rev 305257)
@@ -1040,6 +1040,12 @@
 #else
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
+   if (OCI_G(env)
+   && OCIErrorGet(OCI_G(env), (ub4)1, NULL, 
&ora_error_code, tmp_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ENV) == 
OCI_SUCCESS
+   && *tmp_buf) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", 
tmp_buf);
+   }
+
OCI_G(env) = NULL;
OCI_G(err) = NULL;
return;

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c trunk/ext/oci8/oci8.c

2010-06-25 Thread Christopher Jones
sixd Fri, 25 Jun 2010 21:09:13 +

Revision: http://svn.php.net/viewvc?view=revision&revision=300752

Log:
Fix bug #52186 (phpinfo shows 10.1 or 11.1 when installed with ORACLE_HOME 10.2 
or 11.2)

Bug: http://bugs.php.net/52186 (Assigned) phpinfo() shows 10.1 or 11.1 when 
installed with ORACLE_HOME 10.2 or 11.2
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/trunk/ext/oci8/oci8.c

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2010-06-25 18:23:54 UTC 
(rev 300751)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2010-06-25 21:09:13 UTC 
(rev 300752)
@@ -1300,19 +1300,26 @@
snprintf(buf, sizeof(buf), "%ld", OCI_G(num_links));
php_info_print_table_row(2, "Active Connections", buf);

+#ifdefined(OCI_MAJOR_VERSION) && defined(OCI_MINOR_VERSION)
+   snprintf(buf, sizeof(buf), "%d.%d", OCI_MAJOR_VERSION, 
OCI_MINOR_VERSION);
+#elif defined(PHP_OCI8_ORACLE_VERSION)
+   snprintf(buf, sizeof(buf), "%s", PHP_OCI8_ORACLE_VERSION);
+#else
+   snprintf(buf, sizeof(buf), "Unknown");
+#endif
+#if defined(HAVE_OCI_INSTANT_CLIENT)
+   php_info_print_table_row(2, "Oracle Instant Client Version", buf);
+#else
+   php_info_print_table_row(2, "Oracle Version", buf);
+#endif
+
 #if !defined(PHP_WIN32) && !defined(HAVE_OCI_INSTANT_CLIENT)
-#ifdef PHP_OCI8_ORACLE_VERSION
-   php_info_print_table_row(2, "Oracle Version", PHP_OCI8_ORACLE_VERSION);
-#endif
-#ifdef PHP_OCI8_DEF_DIR
+#if defined(PHP_OCI8_DEF_DIR)
php_info_print_table_row(2, "Compile-time ORACLE_HOME", 
PHP_OCI8_DEF_DIR);
 #endif
-#ifdef PHP_OCI8_DEF_SHARED_LIBADD
+#if defined(PHP_OCI8_DEF_SHARED_LIBADD)
php_info_print_table_row(2, "Libraries Used", 
PHP_OCI8_DEF_SHARED_LIBADD);
 #endif
-#elif defined(HAVE_OCI_INSTANT_CLIENT) && defined(OCI_MAJOR_VERSION) && 
defined(OCI_MINOR_VERSION)
-   snprintf(buf, sizeof(buf), "%d.%d", OCI_MAJOR_VERSION, 
OCI_MINOR_VERSION);
-   php_info_print_table_row(2, "Oracle Instant Client Version", buf);
 #endif

php_info_print_table_row(2, "Temporary Lob support", "enabled");

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2010-06-25 18:23:54 UTC (rev 300751)
+++ php/php-src/trunk/ext/oci8/oci8.c   2010-06-25 21:09:13 UTC (rev 300752)
@@ -1300,19 +1300,26 @@
snprintf(buf, sizeof(buf), "%ld", OCI_G(num_links));
php_info_print_table_row(2, "Active Connections", buf);

+#ifdefined(OCI_MAJOR_VERSION) && defined(OCI_MINOR_VERSION)
+   snprintf(buf, sizeof(buf), "%d.%d", OCI_MAJOR_VERSION, 
OCI_MINOR_VERSION);
+#elif defined(PHP_OCI8_ORACLE_VERSION)
+   snprintf(buf, sizeof(buf), "%s", PHP_OCI8_ORACLE_VERSION);
+#else
+   snprintf(buf, sizeof(buf), "Unknown");
+#endif
+#if defined(HAVE_OCI_INSTANT_CLIENT)
+   php_info_print_table_row(2, "Oracle Instant Client Version", buf);
+#else
+   php_info_print_table_row(2, "Oracle Version", buf);
+#endif
+
 #if !defined(PHP_WIN32) && !defined(HAVE_OCI_INSTANT_CLIENT)
-#ifdef PHP_OCI8_ORACLE_VERSION
-   php_info_print_table_row(2, "Oracle Version", PHP_OCI8_ORACLE_VERSION);
-#endif
-#ifdef PHP_OCI8_DEF_DIR
+#if defined(PHP_OCI8_DEF_DIR)
php_info_print_table_row(2, "Compile-time ORACLE_HOME", 
PHP_OCI8_DEF_DIR);
 #endif
-#ifdef PHP_OCI8_DEF_SHARED_LIBADD
+#if defined(PHP_OCI8_DEF_SHARED_LIBADD)
php_info_print_table_row(2, "Libraries Used", 
PHP_OCI8_DEF_SHARED_LIBADD);
 #endif
-#elif defined(HAVE_OCI_INSTANT_CLIENT) && defined(OCI_MAJOR_VERSION) && 
defined(OCI_MINOR_VERSION)
-   snprintf(buf, sizeof(buf), "%d.%d", OCI_MAJOR_VERSION, 
OCI_MINOR_VERSION);
-   php_info_print_table_row(2, "Oracle Instant Client Version", buf);
 #endif

php_info_print_table_row(2, "Temporary Lob support", "enabled");

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/oci8/ oci8.c

2010-05-03 Thread Pierre Joye
pajoye   Mon, 03 May 2010 19:29:05 +

Revision: http://svn.php.net/viewvc?view=revision&revision=298927

Log:
- fix build (declaration must be first)

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2010-05-03 19:28:19 UTC 
(rev 298926)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2010-05-03 19:29:05 UTC 
(rev 298927)
@@ -1638,10 +1638,10 @@
  */
 int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, 
ub2 *error_offset TSRMLS_DC)
 {
+   sword errstatus;
+
*sqltext = NULL;
*error_offset = 0;
-   sword errstatus;
-
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, 
OCI_HTYPE_STMT, (dvoid *) sqltext, (ub4 *)0, OCI_ATTR_STATEMENT, 
statement->err));

if (errstatus != OCI_SUCCESS) {

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c branches/PHP_5_3/ext/oci8/package.xml branches/PHP_5_3/ext/oci8/php_oci8.h branches/PHP_5_3/ext/oci8/tests/bug51291.phpt branches/PHP_5_3/

2010-03-24 Thread Christopher Jones
sixd Wed, 24 Mar 2010 22:08:55 +

Revision: http://svn.php.net/viewvc?view=revision&revision=296754

Log:
Fixed bug #51291 (oci_error doesn't report last error when called two times)

Bug: http://bugs.php.net/51291 (Assigned) oci_error dont report last error when 
called two times
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_3/ext/oci8/package.xml
U   php/php-src/branches/PHP_5_3/ext/oci8/php_oci8.h
A   php/php-src/branches/PHP_5_3/ext/oci8/tests/bug51291.phpt
D   php/php-src/branches/PHP_5_3/ext/oci8/tests/bug6109.phpt
A + php/php-src/branches/PHP_5_3/ext/oci8/tests/pecl_bug6109.phpt
(from php/php-src/branches/PHP_5_3/ext/oci8/tests/bug6109.phpt:r296733)
U   php/php-src/trunk/ext/oci8/oci8.c
U   php/php-src/trunk/ext/oci8/package.xml
U   php/php-src/trunk/ext/oci8/php_oci8.h
A   php/php-src/trunk/ext/oci8/tests/bug51291.phpt
D   php/php-src/trunk/ext/oci8/tests/bug6109.phpt
A + php/php-src/trunk/ext/oci8/tests/pecl_bug6109.phpt
(from php/php-src/trunk/ext/oci8/tests/bug6109.phpt:r296733)

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c	2010-03-24 22:06:21 UTC (rev 296753)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c	2010-03-24 22:08:55 UTC (rev 296754)
@@ -1549,6 +1549,7 @@
 /* {{{ php_oci_error()
  *
  * Fetch & print out error message if we get an error
+ * Returns an Oracle error number
  */
 sb4 php_oci_error(OCIError *err_p, sword status TSRMLS_DC)
 {
@@ -1639,19 +1640,20 @@
 {
 	*sqltext = NULL;
 	*error_offset = 0;
+	sword errstatus;

-	PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) sqltext, (ub4 *)0, OCI_ATTR_STATEMENT, statement->err));
+	PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) sqltext, (ub4 *)0, OCI_ATTR_STATEMENT, statement->err));

-	if (statement->errcode != OCI_SUCCESS) {
-		statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC);
+	if (errstatus != OCI_SUCCESS) {
+		statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
 		PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
 		return 1;
 	}

-	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));
+	PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)error_offset, (ub4 *)0, OCI_ATTR_PARSE_ERROR_OFFSET, statement->err));

-	if (statement->errcode != OCI_SUCCESS) {
-		statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC);
+	if (errstatus != OCI_SUCCESS) {
+		statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
 		PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
 		return 1;
 	}

Modified: php/php-src/branches/PHP_5_3/ext/oci8/package.xml
===
--- php/php-src/branches/PHP_5_3/ext/oci8/package.xml	2010-03-24 22:06:21 UTC (rev 296753)
+++ php/php-src/branches/PHP_5_3/ext/oci8/package.xml	2010-03-24 22:08:55 UTC (rev 296754)
@@ -6,7 +6,7 @@
  oci8
  pecl.php.net
  Extension for Oracle Database
- This extension allows you to access Oracle databases using the Oracle Call Interface (OCI8). It can be built with PHP 4.3.9 to 5.x.  It can be linked with Oracle 9.2, 10.2, 11.1, or 11.2 client libraries.
+ This extension allows you to access Oracle databases. It can be built with PHP 4.3.9 to 5.x.  It can be linked with Oracle 9.2, 10.2, 11.1, or 11.2 client libraries.
  
  
   Christopher Jones
@@ -37,17 +37,16 @@
  15:00:00

  
-  1.4.1
-  1.4.1
+  1.4.2
+  1.4.2
  
  
-  stable
-  stable
+  development
+  development
  
  http://www.php.net/license";>PHP
  
-Fixed bug #49560 (Using LOBs causes slow PHP shutdown)
-Fixed bug #47281 ($php_errormsg is limited in size of characters)
+Fixed bug #51291 (oci_error doesn't report last error when called two times)
  
  
   
@@ -369,6 +368,22 @@

 
  
+  1.4.1
+  1.4.1
+ 
+ 
+  stable
+  stable
+ 
+ http://www.php.net/license";>PHP
+ 
+Fixed bug #49560 (Using LOBs causes slow PHP shutdown)
+Fixed bug #47281 ($php_errormsg is limited in size of characters)
+ 
+
+
+
+ 
   1.4.0
   1.4.0
  

Modified: php/php-src/branches/PHP_5_3/ext/oci8/php_oci8.h
===
--- php/php-src/branches/PHP_5_3/ext/oci8/php_oci8.h	2010-03-24 22:06:21 UTC (rev 296753)
+++ php/php-src/branches/PHP_5_3/ext/oci8/php_oci8.h	2010-03-24 22:08:55 UTC (rev 296754)
@@ -46,7 +46,7 @@
  */
 #undef PHP_OCI8_VERSION
 #endif
-#define PHP_OCI8_VERSION "1.4.1"
+#define PHP_OCI8_VERSION "1.4.2-development"

 extern zend_module_entry oci8_module_entry;
 #

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c branches/PHP_5_3/ext/oci8/tests/pecl_bug16842.phpt trunk/ext/oci8/oci8.c trunk/ext/oci8/tests/pecl_bug16842.phpt

2009-10-01 Thread Jani Taskinen

NEWS?

--Jani

On 10/01/2009 08:51 AM, Christopher Jones wrote:

sixd Thu, 01 Oct 2009 05:51:11 +

Revision: http://svn.php.net/viewvc?view=revision&revision=289039

Log:
PECL Bug #16842 (oci_error return false when NO_DATA_FOUND is raised)

Bug: http://pecl.php.net/bugs/16842 (unknown)

Changed paths:
 U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
 A   php/php-src/branches/PHP_5_3/ext/oci8/tests/pecl_bug16842.phpt
 U   php/php-src/trunk/ext/oci8/oci8.c
 A   php/php-src/trunk/ext/oci8/tests/pecl_bug16842.phpt

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2009-10-01 05:08:47 UTC 
(rev 289038)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2009-10-01 05:51:11 UTC 
(rev 289039)
@@ -1529,6 +1529,12 @@
break;
case OCI_NO_DATA:
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"OCI_NO_DATA");
+   errcode = php_oci_fetch_errmsg(err_p,&errbuf TSRMLS_CC);
+   if (errbuf) {
+   efree(errbuf);
+   } else {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"OCI_NO_DATA: failed to fetch error message");
+   }
break;
case OCI_ERROR:
errcode = php_oci_fetch_errmsg(err_p,&errbuf TSRMLS_CC);

Added: php/php-src/branches/PHP_5_3/ext/oci8/tests/pecl_bug16842.phpt
===
--- php/php-src/branches/PHP_5_3/ext/oci8/tests/pecl_bug16842.phpt  
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/oci8/tests/pecl_bug16842.phpt  
2009-10-01 05:51:11 UTC (rev 289039)
@@ -0,0 +1,69 @@
+--TEST--
+PECL Bug #16842 (NO_DATA_FOUND exception is a warning)
+--SKIPIF--
+
+--INI--
+error_reporting = E_WARNING
+--FILE--
+
+===DONE===
+
+--EXPECTF--
+Test 1
+Raises NO_DATA_FOUND
+
+Warning: oci_execute(): OCI_NO_DATA in %s on line 11
+bool(false)
+array(4) {
+  [%u|b%"code"]=>
+  int(1403)
+  [%u|b%"message"]=>
+  %unicode|string%(45) "ORA-01403: %s
+ORA-06512: at line 1"
+  [%u|b%"offset"]=>
+  int(0)
+  [%u|b%"sqltext"]=>
+  %unicode|string%(31) "begin raise NO_DATA_FOUND; end;"
+}
+Test 2
+Raises ZERO_DIVIDE
+
+Warning: oci_execute(): ORA-01476: %s
+ORA-06512: at line 1 in %s on line 19
+bool(false)
+array(4) {
+  [%u|b%"code"]=>
+  int(1476)
+  [%u|b%"message"]=>
+  %unicode|string%(56) "ORA-01476: %s
+ORA-06512: at line 1"
+  [%u|b%"offset"]=>
+  int(0)
+  [%u|b%"sqltext"]=>
+  %unicode|string%(29) "begin raise ZERO_DIVIDE; end;"
+}
+===DONE===


Property changes on: 
php/php-src/branches/PHP_5_3/ext/oci8/tests/pecl_bug16842.phpt
___
Added: svn:keywords
+ Id Rev Revision
Added: svn:eol-style
+ native

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2009-10-01 05:08:47 UTC (rev 289038)
+++ php/php-src/trunk/ext/oci8/oci8.c   2009-10-01 05:51:11 UTC (rev 289039)
@@ -1371,6 +1371,12 @@
break;
case OCI_NO_DATA:
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"OCI_NO_DATA");
+   errcode = php_oci_fetch_errmsg(err_p,&errbuf TSRMLS_CC);
+   if (errbuf) {
+   efree(errbuf);
+   } else {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"OCI_NO_DATA: failed to fetch error message");
+   }
break;
case OCI_ERROR:
errcode = php_oci_fetch_errmsg(err_p,&errbuf TSRMLS_CC);

Added: php/php-src/trunk/ext/oci8/tests/pecl_bug16842.phpt
===
--- php/php-src/trunk/ext/oci8/tests/pecl_bug16842.phpt 
(rev 0)
+++ php/php-src/trunk/ext/oci8/tests/pecl_bug16842.phpt 2009-10-01 05:51:11 UTC 
(rev 289039)
@@ -0,0 +1,69 @@
+--TEST--
+PECL Bug #16842 (NO_DATA_FOUND exception is a warning)
+--SKIPIF--
+
+--INI--
+error_reporting = E_WARNING
+--FILE--
+
+===DONE===
+
+--EXPECTF--
+Test 1
+Raises NO_DATA_FOUND
+
+Warning: oci_execute(): OCI_NO_DATA in %s on line 11
+bool(false)
+array(4) {
+  [%u|b%"code"]=>
+  int(1403)
+  [%u|b%"message"]=>
+  %unicode|string%(45) "ORA-01403: %s
+ORA-06512: at line 1"
+  [%u|b%"offset"]=>
+  int(0)
+  [%u|b%"sqltext"]=>
+  %unicode|string%(31) "begin raise NO_DATA_FOUND; end;"
+}
+Test 2
+Raises ZERO_DIVIDE
+
+Warning: oci_execute(): ORA-01476: %s
+ORA-06512: at line 1 in %s on line 19
+bool(false)
+array(4) {
+  [%u|b%"code"]=>
+  int(1476)
+  [%u|b%"message"]=>
+  %unicode|string%(56) "OR

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c branches/PHP_5_3/ext/oci8/tests/pecl_bug16842.phpt trunk/ext/oci8/oci8.c trunk/ext/oci8/tests/pecl_bug16842.phpt

2009-09-30 Thread Christopher Jones
sixd Thu, 01 Oct 2009 05:51:11 +

Revision: http://svn.php.net/viewvc?view=revision&revision=289039

Log:
PECL Bug #16842 (oci_error return false when NO_DATA_FOUND is raised)

Bug: http://pecl.php.net/bugs/16842 (unknown) 
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
A   php/php-src/branches/PHP_5_3/ext/oci8/tests/pecl_bug16842.phpt
U   php/php-src/trunk/ext/oci8/oci8.c
A   php/php-src/trunk/ext/oci8/tests/pecl_bug16842.phpt

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2009-10-01 05:08:47 UTC 
(rev 289038)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2009-10-01 05:51:11 UTC 
(rev 289039)
@@ -1529,6 +1529,12 @@
break;
case OCI_NO_DATA:
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"OCI_NO_DATA");
+   errcode = php_oci_fetch_errmsg(err_p, &errbuf 
TSRMLS_CC);
+   if (errbuf) {
+   efree(errbuf);
+   } else {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"OCI_NO_DATA: failed to fetch error message");
+   }
break;
case OCI_ERROR:
errcode = php_oci_fetch_errmsg(err_p, &errbuf 
TSRMLS_CC);

Added: php/php-src/branches/PHP_5_3/ext/oci8/tests/pecl_bug16842.phpt
===
--- php/php-src/branches/PHP_5_3/ext/oci8/tests/pecl_bug16842.phpt  
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/oci8/tests/pecl_bug16842.phpt  
2009-10-01 05:51:11 UTC (rev 289039)
@@ -0,0 +1,69 @@
+--TEST--
+PECL Bug #16842 (NO_DATA_FOUND exception is a warning)
+--SKIPIF--
+
+--INI--
+error_reporting = E_WARNING
+--FILE--
+
+===DONE===
+
+--EXPECTF--
+Test 1
+Raises NO_DATA_FOUND
+
+Warning: oci_execute(): OCI_NO_DATA in %s on line 11
+bool(false)
+array(4) {
+  [%u|b%"code"]=>
+  int(1403)
+  [%u|b%"message"]=>
+  %unicode|string%(45) "ORA-01403: %s
+ORA-06512: at line 1"
+  [%u|b%"offset"]=>
+  int(0)
+  [%u|b%"sqltext"]=>
+  %unicode|string%(31) "begin raise NO_DATA_FOUND; end;"
+}
+Test 2
+Raises ZERO_DIVIDE
+
+Warning: oci_execute(): ORA-01476: %s
+ORA-06512: at line 1 in %s on line 19
+bool(false)
+array(4) {
+  [%u|b%"code"]=>
+  int(1476)
+  [%u|b%"message"]=>
+  %unicode|string%(56) "ORA-01476: %s
+ORA-06512: at line 1"
+  [%u|b%"offset"]=>
+  int(0)
+  [%u|b%"sqltext"]=>
+  %unicode|string%(29) "begin raise ZERO_DIVIDE; end;"
+}
+===DONE===


Property changes on: 
php/php-src/branches/PHP_5_3/ext/oci8/tests/pecl_bug16842.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2009-10-01 05:08:47 UTC (rev 289038)
+++ php/php-src/trunk/ext/oci8/oci8.c   2009-10-01 05:51:11 UTC (rev 289039)
@@ -1371,6 +1371,12 @@
break;
case OCI_NO_DATA:
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"OCI_NO_DATA");
+   errcode = php_oci_fetch_errmsg(err_p, &errbuf 
TSRMLS_CC);
+   if (errbuf) {
+   efree(errbuf);
+   } else {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"OCI_NO_DATA: failed to fetch error message");
+   }
break;
case OCI_ERROR:
errcode = php_oci_fetch_errmsg(err_p, &errbuf 
TSRMLS_CC);

Added: php/php-src/trunk/ext/oci8/tests/pecl_bug16842.phpt
===
--- php/php-src/trunk/ext/oci8/tests/pecl_bug16842.phpt 
(rev 0)
+++ php/php-src/trunk/ext/oci8/tests/pecl_bug16842.phpt 2009-10-01 05:51:11 UTC 
(rev 289039)
@@ -0,0 +1,69 @@
+--TEST--
+PECL Bug #16842 (NO_DATA_FOUND exception is a warning)
+--SKIPIF--
+
+--INI--
+error_reporting = E_WARNING
+--FILE--
+
+===DONE===
+
+--EXPECTF--
+Test 1
+Raises NO_DATA_FOUND
+
+Warning: oci_execute(): OCI_NO_DATA in %s on line 11
+bool(false)
+array(4) {
+  [%u|b%"code"]=>
+  int(1403)
+  [%u|b%"message"]=>
+  %unicode|string%(45) "ORA-01403: %s
+ORA-06512: at line 1"
+  [%u|b%"offset"]=>
+  int(0)
+  [%u|b%"sqltext"]=>
+  %unicode|string%(31) "begin raise NO_DATA_FOUND; end;"
+}
+Test 2
+Raises ZERO_DIVIDE
+
+Warning: oci_execute(): ORA-01476: %s
+ORA-06512: at line 1 in %s on line 19
+bool(false)
+array(4) {
+  [%u|b%"code"]=>
+  int(1476)
+  [%u|b%"message"]=>
+  %unicode|string%(56) "ORA-01476: %s
+ORA-06512: at line 1"
+  [%u|b%"offset"]=>
+