tony2001 Tue Aug 22 11:09:13 2006 UTC
Modified files: (Branch: PHP_5_2)
/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
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.269.2.16.2.19&r2=1.269.2.16.2.20&diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.269.2.16.2.19
php-src/ext/oci8/oci8.c:1.269.2.16.2.20
--- php-src/ext/oci8/oci8.c:1.269.2.16.2.19 Mon Aug 21 16:41:12 2006
+++ php-src/ext/oci8/oci8.c Tue Aug 22 11:09:12 2006
@@ -26,7 +26,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8.c,v 1.269.2.16.2.19 2006/08/21 16:41:12 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.269.2.16.2.20 2006/08/22 11:09:12 tony2001 Exp $ */
/* TODO
*
* file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty()
with OCI_ATTR_LOBEMPTY
@@ -652,7 +652,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.269.2.16.2.19 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.16.2.20 $");
sprintf(buf, "%ld", OCI_G(num_persistent));
php_info_print_table_row(2, "Active Persistent Connections", buf);
@@ -897,12 +897,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;
@@ -1142,7 +1142,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));
@@ -1151,7 +1151,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.8.2.7.2.2&r2=1.8.2.7.2.3&diff_format=u
Index: php-src/ext/oci8/oci8_interface.c
diff -u php-src/ext/oci8/oci8_interface.c:1.8.2.7.2.2
php-src/ext/oci8/oci8_interface.c:1.8.2.7.2.3
--- php-src/ext/oci8/oci8_interface.c:1.8.2.7.2.2 Sun Jul 30 20:51:24 2006
+++ php-src/ext/oci8/oci8_interface.c Tue Aug 22 11:09:12 2006
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_interface.c,v 1.8.2.7.2.2 2006/07/30 20:51:24 tony2001 Exp $ */
+/* $Id: oci8_interface.c,v 1.8.2.7.2.3 2006/08/22 11:09:12 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1636,15 +1636,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);
@@ -1748,7 +1747,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.7.2.6.2.5&r2=1.7.2.6.2.6&diff_format=u
Index: php-src/ext/oci8/oci8_lob.c
diff -u php-src/ext/oci8/oci8_lob.c:1.7.2.6.2.5
php-src/ext/oci8/oci8_lob.c:1.7.2.6.2.6
--- php-src/ext/oci8/oci8_lob.c:1.7.2.6.2.5 Mon Aug 21 16:41:13 2006
+++ php-src/ext/oci8/oci8_lob.c Tue Aug 22 11:09:12 2006
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_lob.c,v 1.7.2.6.2.5 2006/08/21 16:41:13 tony2001 Exp $ */
+/* $Id: oci8_lob.c,v 1.7.2.6.2.6 2006/08/22 11:09:12 tony2001 Exp $ */
@@ -479,7 +479,7 @@
/* {{{ php_oci_lob_get_buffering()
Return current buffering state for the LOB */
-int php_oci_lob_get_buffering (php_oci_descriptor *descriptor TSRMLS_DC)
+int php_oci_lob_get_buffering (php_oci_descriptor *descriptor)
{
if (descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) {
return 1;
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.7.2.14.2.7&r2=1.7.2.14.2.8&diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.7
php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.8
--- php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.7 Mon Aug 21 16:41:13 2006
+++ php-src/ext/oci8/oci8_statement.c Tue Aug 22 11:09:12 2006
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_statement.c,v 1.7.2.14.2.7 2006/08/21 16:41:13 tony2001 Exp $ */
+/* $Id: oci8_statement.c,v 1.7.2.14.2.8 2006/08/22 11:09:12 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
@@ -43,7 +43,7 @@
/* {{{ php_oci_statement_create()
Create statemend handle and allocate necessary resources */
-php_oci_statement *php_oci_statement_create (php_oci_connection *connection,
char *query, long query_len, zend_bool cached TSRMLS_DC)
+php_oci_statement *php_oci_statement_create (php_oci_connection *connection,
char *query, int query_len TSRMLS_DC)
{
php_oci_statement *statement;
@@ -258,7 +258,7 @@
/* {{{ php_oci_statement_get_column()
Get column from the result set */
-php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement,
long column_index, char *column_name, long column_name_len TSRMLS_DC)
+php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement,
long column_index, char *column_name, int column_name_len TSRMLS_DC)
{
php_oci_out_column *column = NULL;
int i;
@@ -485,7 +485,7 @@
buf = 0;
switch (outcol->data_type) {
case SQLT_RSET:
- outcol->statement =
php_oci_statement_create(statement->connection, NULL, 0, 0 TSRMLS_CC);
+ outcol->statement =
php_oci_statement_create(statement->connection, NULL, 0 TSRMLS_CC);
outcol->stmtid = outcol->statement->id;
outcol->statement->nested = 1;
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/php_oci8_int.h?r1=1.11.2.6.2.6&r2=1.11.2.6.2.7&diff_format=u
Index: php-src/ext/oci8/php_oci8_int.h
diff -u php-src/ext/oci8/php_oci8_int.h:1.11.2.6.2.6
php-src/ext/oci8/php_oci8_int.h:1.11.2.6.2.7
--- php-src/ext/oci8/php_oci8_int.h:1.11.2.6.2.6 Mon Aug 21 16:41:13 2006
+++ php-src/ext/oci8/php_oci8_int.h Tue Aug 22 11:09:12 2006
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_oci8_int.h,v 1.11.2.6.2.6 2006/08/21 16:41:13 tony2001 Exp $ */
+/* $Id: php_oci8_int.h,v 1.11.2.6.2.7 2006/08/22 11:09:12 tony2001 Exp $ */
#if HAVE_OCI8
# ifndef PHP_OCI8_INT_H
@@ -327,7 +327,7 @@
int php_oci_lob_write (php_oci_descriptor *, ub4, char *, int, ub4 *
TSRMLS_DC);
int php_oci_lob_flush (php_oci_descriptor *, int TSRMLS_DC);
int php_oci_lob_set_buffering (php_oci_descriptor *, int TSRMLS_DC);
-int php_oci_lob_get_buffering (php_oci_descriptor * TSRMLS_DC);
+int php_oci_lob_get_buffering (php_oci_descriptor *);
int php_oci_lob_copy (php_oci_descriptor *, php_oci_descriptor *, long
TSRMLS_DC);
#ifdef HAVE_OCI8_TEMP_LOB
int php_oci_lob_close (php_oci_descriptor * TSRMLS_DC);
@@ -372,10 +372,10 @@
/* statement related prototypes {{{ */
-php_oci_statement * php_oci_statement_create (php_oci_connection *, char *,
long, zend_bool TSRMLS_DC);
+php_oci_statement * php_oci_statement_create (php_oci_connection *, char *,
int TSRMLS_DC);
int php_oci_statement_set_prefetch (php_oci_statement *, ub4 TSRMLS_DC);
int php_oci_statement_fetch (php_oci_statement *, ub4 TSRMLS_DC);
-php_oci_out_column * php_oci_statement_get_column (php_oci_statement *, long,
char*, long TSRMLS_DC);
+php_oci_out_column * php_oci_statement_get_column (php_oci_statement *, long,
char*, int TSRMLS_DC);
int php_oci_statement_execute (php_oci_statement *, ub4 TSRMLS_DC);
int php_oci_statement_cancel (php_oci_statement * TSRMLS_DC);
void php_oci_statement_free (php_oci_statement * TSRMLS_DC);
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/statement_cache.phpt?r1=1.1.2.3&r2=1.1.2.3.2.1&diff_format=u
Index: php-src/ext/oci8/tests/statement_cache.phpt
diff -u php-src/ext/oci8/tests/statement_cache.phpt:1.1.2.3
php-src/ext/oci8/tests/statement_cache.phpt:1.1.2.3.2.1
--- php-src/ext/oci8/tests/statement_cache.phpt:1.1.2.3 Tue Dec 6 19:28:25 2005
+++ php-src/ext/oci8/tests/statement_cache.phpt Tue Aug 22 11:09:12 2006
@@ -9,11 +9,11 @@
$pc = oci_pconnect($user, $password, $dbase);
-$stmt = oci_parse($pc, "select 1+3 from dual", true);
+$stmt = oci_parse($pc, "select 1+3 from dual");
oci_execute($stmt);
var_dump(oci_fetch_array($stmt));
-$stmt = oci_parse($pc, "select 1+3 from dual", true);
+$stmt = oci_parse($pc, "select 1+3 from dual");
oci_execute($stmt);
var_dump(oci_fetch_array($stmt));
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php