cvs: php-src /ext/oci8 oci8.c oci8_collection.c oci8_interface.c oci8_lob.c oci8_statement.c php_oci8_int.h /ext/oci8/tests array_bind_005.phpt
array_bind_008.phpt array_bind_010.phpt bind_long.phpt bind_long_raw.phpt bind_raw.phpt bug27303.phpt bug27303_2.phpt bug27303_4.phpt bug35973.phpt
bug36096.phpt coll_011.phpt coll_011_func.phpt coll_012.phpt coll_012_func.phpt coll_013.phpt coll_013_func.phpt coll_014.phpt coll_014_func.phpt
commit.phpt commit_old.phpt cursor_bind.phpt cursors.phpt cursors_old.phpt define.phpt define1.phpt define_old.phpt error.phpt error1.phpt
error_old.phpt fetch.phpt fetch_all.phpt fetch_array.phpt fetch_assoc.phpt fetch_into.phpt fetch_into1.phpt fetch_into2.phpt fetch_object.phpt
fetch_row.phpt field_funcs.phpt field_funcs1.phpt field_funcs_old.phpt lob_001.phpt lob_002.phpt lob_003.phpt lob_004.phpt lob_006.phpt lob_007.phpt
lob_008.phpt lob_010.phpt lob_011.phpt lob_012.phpt lob_013.phpt lob_014.phpt lob_016.phpt lob_017.phpt lob_01! 8.phpt lob_019.phpt lob_020.phpt
lob_021.phpt lob_022.phpt lob_023.phpt lob_024.phpt lob_025.phpt lob_026.phpt lob_temp.phpt lob_temp1.phpt pecl_bug8816.phpt serverversion.phpt
statement_cache.phpt
| From: | Antony Dovgal | Date: | Fri, 10 Nov 2006 16:56:20 +0000 |
| Subject: | cvs: php-src /ext/oci8 oci8.c oci8_collection.c oci8_interface.c oci8_lob.c oci8_statement.c php_oci8_int.h /ext/oci8/tests array_bind_005.phpt array_bind_008.phpt array_bind_010.phpt bind_long.phpt bind_long_raw.phpt bind_raw.phpt bug27303.phpt bug27303_2.phpt bug27303_4.phpt bug35973.phpt bug36096.phpt coll_011.phpt coll_011_func.phpt coll_012.phpt coll_012_func.phpt coll_013.phpt coll_013_func.phpt coll_014.phpt coll_014_func.phpt commit.phpt commit_old.phpt cursor_bind.phpt cursors.phpt cursors_old.phpt define.phpt define1.phpt define_old.phpt error.phpt error1.phpt error_old.phpt fetch.phpt fetch_all.phpt fetch_array.phpt fetch_assoc.phpt fetch_into.phpt fetch_into1.phpt fetch_into2.phpt fetch_object.phpt fetch_row.phpt field_funcs.phpt field_funcs1.phpt field_funcs_old.phpt lob_001.phpt lob_002.phpt lob_003.phpt lob_004.phpt lob_006.phpt lob_007.phpt lob_008.phpt lob_010.phpt lob_011.phpt lob_012.phpt lob_013.phpt lob_014.phpt lob_016.phpt lob_017.phpt lob_01! 8.phpt lob_019.phpt lob_020.phpt lob_021.phpt lob_022.phpt lob_023.phpt lob_024.phpt lob_025.phpt lob_026.phpt lob_temp.phpt lob_temp1.phpt pecl_bug8816.phpt serverversion.phpt statement_cache.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-41459@lists.php.net to get a copy of this message | ||
tony2001 Fri Nov 10 16:56:20 2006 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
/php-src/ext/oci8/tests array_bind_005.phpt array_bind_008.phpt
array_bind_010.phpt bind_long.phpt
bind_long_raw.phpt bind_raw.phpt
bug27303_2.phpt bug27303_4.phpt
bug27303.phpt bug35973.phpt bug36096.phpt
coll_011_func.phpt coll_011.phpt
coll_012_func.phpt coll_012.phpt
coll_013_func.phpt coll_013.phpt
coll_014_func.phpt coll_014.phpt
commit_old.phpt commit.phpt
cursor_bind.phpt cursors_old.phpt
cursors.phpt define1.phpt define_old.phpt
define.phpt error1.phpt error_old.phpt
error.phpt fetch_all.phpt fetch_array.phpt
fetch_assoc.phpt fetch_into1.phpt
fetch_into2.phpt fetch_into.phpt
fetch_object.phpt fetch.phpt fetch_row.phpt
field_funcs1.phpt field_funcs_old.phpt
field_funcs.phpt lob_001.phpt lob_002.phpt
lob_003.phpt lob_004.phpt lob_006.phpt
lob_007.phpt lob_008.phpt lob_010.phpt
lob_011.phpt lob_012.phpt lob_013.phpt
lob_014.phpt lob_016.phpt lob_017.phpt
lob_018.phpt lob_019.phpt lob_020.phpt
lob_021.phpt lob_022.phpt lob_023.phpt
lob_024.phpt lob_025.phpt lob_026.phpt
lob_temp1.phpt lob_temp.phpt
pecl_bug8816.phpt serverversion.phpt
statement_cache.phpt
Log:
add _not yet 100% complete_ Unicode support
collections, statements and BLOBs seem to be working ok
though there are still some things to be done in order to make oci_bind_array_by_name() work with
U-strings
Notes:
- in Unicode mode OCI8 always speaks to Oracle server using UTF-16, so all the conversions are
done by the client lib.
This is why character set parameter of oci_connect() and NLS_LANG are ignored in U-mode.
- BLOBs and CLOBs behave quite differently in U-mode.
Reading data from a CLOB would result in Unicode string, while BLOBs would return binary string.
Also, all LOB utilities work with _bytes_ when BLOB is used and _characters_ when it's CLOB.
It's not that obvious, but it does make a lot of sense to me.
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.323&r2=1.324&diff_format=u Index: php-src/ext/oci8/oci8.c diff -u php-src/ext/oci8/oci8.c:1.323 php-src/ext/oci8/oci8.c:1.324 --- php-src/ext/oci8/oci8.c:1.323 Fri Nov 10 16:33:28 2006 +++ php-src/ext/oci8/oci8.c Fri Nov 10 16:56:19 2006 @@ -26,7 +26,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8.c,v 1.323 2006/11/10 16:33:28 tony2001 Exp $ */ +/* $Id: oci8.c,v 1.324 2006/11/10 16:56:19 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.323 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.324 $"); sprintf(buf, "%ld", OCI_G(num_persistent)); php_info_print_table_row(2, "Active Persistent Connections", buf); @@ -762,9 +762,9 @@ zval_ptr_dtor(&define->zval); - if (define->name) { - efree(define->name); - define->name = NULL; + if (define->name.v) { + efree(define->name.v); + define->name.v = NULL; } } /* }}} */ @@ -813,8 +813,8 @@ efree(column->data); } - if (column->name) { - efree(column->name); + if (column->name.v) { + efree(column->name.v); } } /* }}} */ @@ -863,7 +863,7 @@ case OCI_SUCCESS_WITH_INFO: errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC); if (errbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: %s", errbuf); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: %R", (UG(unicode) ? IS_UNICODE : IS_STRING), errbuf); efree(errbuf); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: failed to fetch error message"); @@ -878,7 +878,7 @@ case OCI_ERROR: errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC); if (errbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%R", (UG(unicode) ? IS_UNICODE : IS_STRING), errbuf); efree(errbuf); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to fetch error message"); @@ -909,18 +909,26 @@ text tmp_buf[PHP_OCI_ERRBUF_LEN]; tmp_buf[0] = '\0'; - + + 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 = strlen(tmp_buf); - - if (tmp_buf_len && tmp_buf[tmp_buf_len - 1] == '\n') { - tmp_buf[tmp_buf_len - 1] = '\0'; + 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'; + } + } 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 (tmp_buf_len && error_buf) { - *error_buf = NULL; - *error_buf = estrndup(tmp_buf, tmp_buf_len); + *error_buf = estrndup(tmp_buf, TEXT_BYTES(tmp_buf_len)); } } return error_code; @@ -929,12 +937,18 @@ #ifdef HAVE_OCI8_ATTR_STATEMENT /* {{{ php_oci_fetch_sqltext_offset() Compute offset in the SQL statement */ -int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset TSRMLS_DC) +int php_oci_fetch_sqltext_offset(php_oci_statement *statement, zstr *sqltext, ub2 *error_offset TSRMLS_DC) { - *sqltext = NULL; + ub4 sqltext_len = 0; + + *sqltext = NULL_ZSTR; *error_offset = 0; - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (text *) sqltext, (ub4 *)0, OCI_ATTR_STATEMENT, statement->err)); + if (UG(unicode)) { + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) &(sqltext->u), (ub4 *)&sqltext_len, OCI_ATTR_STATEMENT, statement->err)); + } else { + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) &(sqltext->s), (ub4 *)&sqltext_len, OCI_ATTR_STATEMENT, statement->err)); + } if (statement->errcode != OCI_SUCCESS) { php_oci_error(statement->err, statement->errcode TSRMLS_CC); @@ -956,22 +970,20 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclusive) { php_oci_connection *connection; - char *username, *password; - char *dbname = NULL, *charset = NULL; + zstr username, password; + zstr dbname, charset = NULL_ZSTR; int username_len = 0, password_len = 0; int dbname_len = 0, charset_len = 0; + zend_uchar username_type, password_type; + zend_uchar dbname_type, charset_type; long session_mode = OCI_DEFAULT; /* if a fourth parameter is handed over, it is the charset identifier (but is only used in Oracle 9i+) */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ssl", &username, &username_len, &password, &password_len, &dbname, &dbname_len, &charset, &charset_len, &session_mode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "TT|TTl", &username, &username_len, &username_type, &password, &password_len, &password_type, &dbname, &dbname_len, &dbname_type, &charset, &charset_len, &charset_type, &session_mode) == FAILURE) { return; } - - if (!charset_len) { - charset = NULL; - } - - connection = php_oci_do_connect_ex(username, username_len, password, password_len, NULL, 0, dbname, dbname_len, charset, session_mode, persistent, exclusive TSRMLS_CC); + + connection = php_oci_do_connect_ex(username, username_len, password, password_len, NULL_ZSTR, 0, dbname, dbname_len, charset, session_mode, persistent, exclusive, username_type TSRMLS_CC); if (!connection) { RETURN_FALSE; @@ -982,7 +994,7 @@ /* {{{ php_oci_do_connect_ex() * The real connect function. Allocates all the resources needed, establishes the connection and returns the result handle (or NULL) */ -php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC) +php_oci_connection *php_oci_do_connect_ex(zstr username, int username_len, zstr password, int password_len, zstr new_password, int new_password_len, zstr dbname, int dbname_len, zstr charset, long session_mode, int persistent, int exclusive, zend_uchar type TSRMLS_DC) { zend_rsrc_list_entry *le; zend_rsrc_list_entry new_le; @@ -1011,17 +1023,17 @@ } 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, username.s, USTR_BYTES(type, 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); + password_hash = zend_u_inline_hash_func(type, 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); + if (dbname_len) { + smart_str_appendl_ex(&hashed_details, dbname.s, USTR_BYTES(type, dbname_len), 0); } smart_str_appendl_ex(&hashed_details, "__", sizeof("__") - 1, 0); @@ -1031,26 +1043,31 @@ } #if HAVE_OCI_ENV_NLS_CREATE - if (charset && *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 { - smart_str_append_unsigned_ex(&hashed_details, charsetid, 0); + if (!UG(unicode)) { + if (charset.s && *charset.s) { + PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, (OCI_G(env), charset.s)); + if (!charsetid) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid character set name: %s", charset.s); + } else { + smart_str_append_unsigned_ex(&hashed_details, charsetid, 0); + } } - } + - /* use NLS_LANG if no or invalid charset specified */ - if (!charsetid) { - size_t rsize = 0; - sword result; + /* use NLS_LANG if no or invalid charset specified */ + + if (!charsetid) { + size_t rsize = 0; + sword result; - PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize)) - if (result != OCI_SUCCESS) { - charsetid_nls_lang = 0; + PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize)) + if (result != OCI_SUCCESS) { + charsetid_nls_lang = 0; + } + smart_str_append_unsigned_ex(&hashed_details, charsetid_nls_lang, 0); } - smart_str_append_unsigned_ex(&hashed_details, charsetid_nls_lang, 0); } + #else if (charset && *charset) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Your version of Oracle Client doesn't support setting the charset; bad or no charset conversions may result"); @@ -1065,7 +1082,7 @@ /* make it lowercase */ php_strtolower(hashed_details.c, hashed_details.len); - if (!exclusive && !new_password) { + if (!exclusive && !new_password.v) { zend_bool found = 0; if (persistent && zend_hash_find(&EG(persistent_list), hashed_details.c, hashed_details.len+1, (void **) &le) == SUCCESS) { @@ -1112,7 +1129,7 @@ connection->used_this_request = 1; 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 && + if (tmp != NULL && rsrc_type == le_pconnection && tmp->hash_key_len == hashed_details.len && memcmp(tmp->hash_key, hashed_details.c, hashed_details.len) == 0 && zend_list_addref(connection->rsrc_id) == SUCCESS) { /* do nothing */ } else { @@ -1165,15 +1182,18 @@ if (alloc_non_persistent) { connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection)); connection->hash_key = estrndup(hashed_details.c, hashed_details.len); + connection->hash_key_len = hashed_details.len; connection->is_persistent = 0; } else { connection = (php_oci_connection *) calloc(1, sizeof(php_oci_connection)); connection->hash_key = zend_strndup(hashed_details.c, hashed_details.len); + connection->hash_key_len = hashed_details.len; connection->is_persistent = 1; } } else { connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection)); connection->hash_key = estrndup(hashed_details.c, hashed_details.len); + connection->hash_key_len = hashed_details.len; connection->is_persistent = 0; } @@ -1190,11 +1210,15 @@ /* allocate environment handle */ #if HAVE_OCI_ENV_NLS_CREATE #define PHP_OCI_INIT_FUNC_NAME "OCIEnvNlsCreate" - - if (charsetid) { - connection->charset = charsetid; + + if (UG(unicode)) { + connection->charset = OCI_UTF16ID; } else { - connection->charset = charsetid_nls_lang; + if (charsetid) { + connection->charset = charsetid; + } else { + connection->charset = charsetid_nls_lang; + } } /* create an environment using the character set id, Oracle 9i+ ONLY */ @@ -1225,7 +1249,7 @@ php_oci_connection_close(connection TSRMLS_CC); return NULL; } - + /* allocate our server handle {{{ */ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->server), OCI_HTYPE_SERVER, 0, NULL)); @@ -1236,7 +1260,7 @@ } /* }}} */ /* attach to the server {{{ */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerAttach, (connection->server, OCI_G(err), (text*)dbname, dbname_len, (ub4) OCI_DEFAULT)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerAttach, (connection->server, OCI_G(err), (text*)dbname.s, USTR_BYTES(type, dbname_len), (ub4) OCI_DEFAULT)); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); @@ -1273,8 +1297,8 @@ } /* }}} */ /* set the username {{{ */ - if (username) { - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) username, (ub4) username_len, (ub4) OCI_ATTR_USERNAME, OCI_G(err))); + if (username.v) { + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) username.s, (ub4) USTR_BYTES(type, username_len), (ub4) OCI_ATTR_USERNAME, OCI_G(err))); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); @@ -1284,8 +1308,8 @@ }/* }}} */ /* set the password {{{ */ - if (password) { - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) password, (ub4) password_len, (ub4) OCI_ATTR_PASSWORD, OCI_G(err))); + if (password.v) { + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) password.s, (ub4) USTR_BYTES(type, password_len), (ub4) OCI_ATTR_PASSWORD, OCI_G(err))); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); @@ -1312,9 +1336,9 @@ return NULL; } /* }}} */ - if (new_password) { + if (new_password_len) { /* try to change password if new one was provided {{{ */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPasswordChange, (connection->svc, OCI_G(err), (text *)username, username_len, (text *)password, password_len, (text *)new_password, new_password_len, OCI_AUTH)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPasswordChange, (connection->svc, OCI_G(err), (text *)username.s, USTR_BYTES(type, username_len), (text *)password.s, USTR_BYTES(type, password_len), (text *)new_password.s, USTR_BYTES(type, new_password_len), OCI_AUTH)); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); @@ -1344,7 +1368,7 @@ case OCI_SYSDBA: case OCI_SYSOPER: default: - if (username_len == 1 && username[0] == '/' && password_len == 0) { + if (username_len == 1 && username.s[0] == '/' && password_len == 0) { PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_EXT, (ub4) session_mode)); } else { PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_RDBMS, (ub4) session_mode)); @@ -1387,13 +1411,13 @@ new_le.type = le_pconnection; connection->used_this_request = 1; connection->rsrc_id = zend_list_insert(connection, le_pconnection); - zend_hash_update(&EG(persistent_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), NULL); + 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)++; } else if (!exclusive) { connection->rsrc_id = zend_list_insert(connection, le_connection); 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); + zend_hash_update(&EG(regular_list), connection->hash_key, connection->hash_key_len+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), NULL); OCI_G(num_links)++; } else { connection->rsrc_id = zend_list_insert(connection, le_connection); @@ -1543,9 +1567,9 @@ /* {{{ php_oci_password_change() 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 TSRMLS_DC) +int php_oci_password_change(php_oci_connection *connection, zstr user, int user_len, zstr pass_old, int pass_old_len, zstr pass_new, int pass_new_len, zend_uchar type TSRMLS_DC) { - PHP_OCI_CALL_RETURN(connection->errcode, OCIPasswordChange, (connection->svc, connection->err, (text *)user, user_len, (text *)pass_old, pass_old_len, (text *)pass_new, pass_new_len, OCI_DEFAULT)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIPasswordChange, (connection->svc, connection->err, (text *)user.s, USTR_BYTES(type, user_len), (text *)pass_old.s, USTR_BYTES(type, pass_old_len), (text *)pass_new.s, USTR_BYTES(type, pass_new_len), OCI_DEFAULT)); if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); @@ -1557,9 +1581,9 @@ /* {{{ php_oci_server_get_version() Get Oracle server version */ -int php_oci_server_get_version(php_oci_connection *connection, char **version TSRMLS_DC) +int php_oci_server_get_version(php_oci_connection *connection, zstr *version TSRMLS_DC) { - char version_buff[256]; + char version_buff[512]; PHP_OCI_CALL_RETURN(connection->errcode, OCIServerVersion, (connection->svc, connection->err, (text*)version_buff, sizeof(version_buff), OCI_HTYPE_SVCCTX)); @@ -1568,8 +1592,12 @@ PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - - *version = estrdup(version_buff); + + if (UG(unicode)) { + version->u = eustrdup((UChar *)version_buff); + } else { + version->s = estrdup(version_buff); + } return 0; } /* }}} */ @@ -1580,7 +1608,7 @@ php_oci_descriptor *descriptor; ub4 lob_length; int column_size; - char *lob_buffer; + zstr lob_buffer, zstr_data = (zstr)column->data; if (column->indicator == -1) { /* column is NULL */ ZVAL_NULL(value); @@ -1609,19 +1637,35 @@ } 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)) { ZVAL_FALSE(value); return 1; - } else { - if (lob_length > 0) { - ZVAL_STRINGL(value, lob_buffer, lob_length, 0); - } else { - ZVAL_EMPTY_STRING(value); - } - return 0; } + + if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC) > 0) { + return 1; + } + + switch (lob_type) { + case OCI_IS_CLOB: + if (lob_length > 0) { + ZVAL_TEXTL(value, lob_buffer, TEXT_CHARS(lob_length), 0); + } else { + ZVAL_EMPTY_TEXT(value); + } + break; + case OCI_IS_BLOB: + if (lob_length > 0) { + ZVAL_STRINGL(value, lob_buffer.s, lob_length, 0); + } else { + ZVAL_EMPTY_STRING(value); + } + break; + } + return 0; } else { /* return the locator */ object_init_ex(value, oci_lob_class_entry_ptr); @@ -1644,7 +1688,7 @@ return 0; } - ZVAL_STRINGL(value, column->data, column_size, 1); + ZVAL_TEXTL(value, zstr_data, TEXT_CHARS(column_size), 1); } return 0; } @@ -1711,7 +1755,7 @@ for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); if (column == NULL) { continue; @@ -1733,7 +1777,7 @@ if (fetch_mode & PHP_OCI_NUM) { ZVAL_ADDREF(element); } - add_assoc_zval(return_value, column->name, element); + add_u_assoc_zval(return_value, (UG(unicode) ? IS_UNICODE : IS_STRING), column->name, element); } } else { @@ -1741,7 +1785,7 @@ add_index_null(return_value, i); } if (fetch_mode & PHP_OCI_ASSOC) { - add_assoc_null(return_value, column->name); + add_u_assoc_null(return_value, (UG(unicode) ? IS_UNICODE : IS_STRING), column->name); } } } http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_collection.c?r1=1.9&r2=1.10&diff_format=u Index: php-src/ext/oci8/oci8_collection.c diff -u php-src/ext/oci8/oci8_collection.c:1.9 php-src/ext/oci8/oci8_collection.c:1.10 --- php-src/ext/oci8/oci8_collection.c:1.9 Mon Aug 21 16:40:46 2006 +++ php-src/ext/oci8/oci8_collection.c Fri Nov 10 16:56:19 2006 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_collection.c,v 1.9 2006/08/21 16:40:46 tony2001 Exp $ */ +/* $Id: oci8_collection.c,v 1.10 2006/11/10 16:56:19 tony2001 Exp $ */ @@ -44,7 +44,7 @@ /* {{{ php_oci_collection_create() Create and return connection handle */ -php_oci_collection * php_oci_collection_create(php_oci_connection* connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC) +php_oci_collection * php_oci_collection_create(php_oci_connection* connection, zstr tdo, int tdo_len, zstr schema, int schema_len TSRMLS_DC) { dvoid *dschp1; dvoid *parmp1; @@ -62,10 +62,10 @@ connection->env, connection->err, connection->svc, - (text *) schema, - (ub4) schema_len, - (text *) tdo, - (ub4) tdo_len, + (text *) schema.s, + (ub4) TEXT_BYTES(schema_len), + (text *) tdo.s, + (ub4) TEXT_BYTES(tdo_len), (CONST text *) 0, (ub4) 0, OCI_DURATION_SESSION, @@ -289,14 +289,14 @@ /* {{{ php_oci_collection_append_date() Append DATE element to the end of the collection (use "DD-MON-YY" format) */ -int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len TSRMLS_DC) +int php_oci_collection_append_date(php_oci_collection *collection, zstr date, int date_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; OCIDate oci_date; 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, date_len, NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, date.s, TEXT_BYTES(date_len), NULL, 0, NULL, 0, &oci_date)); if (connection->errcode != OCI_SUCCESS) { /* failed to convert string to date */ @@ -324,14 +324,18 @@ /* {{{ php_oci_collection_append_number() Append NUMBER to the end of the collection */ -int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len TSRMLS_DC) +int php_oci_collection_append_number(php_oci_collection *collection, zstr number, int number_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; double element_double; OCINumber oci_number; php_oci_connection *connection = collection->connection; - element_double = zend_strtod(number, NULL); + if (UG(unicode)) { + element_double = zend_u_strtod(number.u, NULL); + } else { + element_double = zend_strtod(number.s, NULL); + } PHP_OCI_CALL_RETURN(connection->errcode, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); @@ -360,13 +364,13 @@ /* {{{ php_oci_collection_append_string() Append STRING to the end of the collection */ -int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len TSRMLS_DC) +int php_oci_collection_append_string(php_oci_collection *collection, zstr element, int element_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; OCIString *ocistr = (OCIString *)0; php_oci_connection *connection = collection->connection; - PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, element, element_len, &ocistr)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, element.s, TEXT_BYTES(element_len), &ocistr)); if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); @@ -393,7 +397,7 @@ /* {{{ php_oci_collection_append() Append wrapper. Appends any supported element to the end of the collection */ -int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len TSRMLS_DC) +int php_oci_collection_append(php_oci_collection *collection, zstr element, int element_len TSRMLS_DC) { if (element_len == 0) { return php_oci_collection_append_null(collection TSRMLS_CC); @@ -484,9 +488,14 @@ return 1; } - ZVAL_STRINGL(*result_element, buff, buff_len, 1); - Z_STRVAL_P(*result_element)[buff_len] = '\0'; - + if (UG(unicode)) { + ZVAL_UNICODEL(*result_element, (UChar *)buff, TEXT_CHARS(buff_len), 1); + /* Z_UNIVAL_P(*result_element)[buff_len] = 0; XXX */ + } else { + ZVAL_STRINGL(*result_element, buff, buff_len, 1); + Z_STRVAL_P(*result_element)[buff_len] = '\0'; + } + return 0; break; @@ -498,7 +507,11 @@ PHP_OCI_CALL_RETURN(str, OCIStringPtr, (connection->env, oci_string)); if (str) { - ZVAL_STRING(*result_element, str, 1); + if (UG(unicode)) { + ZVAL_UNICODE(*result_element, (UChar *)str, 1); + } else { + ZVAL_STRING(*result_element, str, 1); + } } return 0; } @@ -560,14 +573,14 @@ /* {{{ php_oci_collection_element_set_date() Change element's value to the given DATE */ -int php_oci_collection_element_set_date(php_oci_collection *collection, long index, char *date, int date_len TSRMLS_DC) +int php_oci_collection_element_set_date(php_oci_collection *collection, long index, zstr date, int date_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; OCIDate oci_date; 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, date_len, NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, date.s, TEXT_BYTES(date_len), NULL, 0, NULL, 0, &oci_date)); if (connection->errcode != OCI_SUCCESS) { /* failed to convert string to date */ @@ -596,14 +609,18 @@ /* {{{ php_oci_collection_element_set_number() Change element's value to the given NUMBER */ -int php_oci_collection_element_set_number(php_oci_collection *collection, long index, char *number, int number_len TSRMLS_DC) +int php_oci_collection_element_set_number(php_oci_collection *collection, long index, zstr number, int number_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; double element_double; OCINumber oci_number; php_oci_connection *connection = collection->connection; - element_double = zend_strtod(number, NULL); + if (UG(unicode)) { + element_double = zend_u_strtod(number.u, NULL); + } else { + element_double = zend_strtod(number.s, NULL); + } PHP_OCI_CALL_RETURN(connection->errcode, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); @@ -633,13 +650,13 @@ /* {{{ php_oci_collection_element_set_string() Change element's value to the given string */ -int php_oci_collection_element_set_string(php_oci_collection *collection, long index, char *element, int element_len TSRMLS_DC) +int php_oci_collection_element_set_string(php_oci_collection *collection, long index, zstr element, int element_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; OCIString *ocistr = (OCIString *)0; php_oci_connection *connection = collection->connection; - PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, element, element_len, &ocistr)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, element.s, TEXT_BYTES(element_len), &ocistr)); if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); @@ -667,7 +684,7 @@ /* {{{ php_oci_collection_element_set() Collection element setter */ -int php_oci_collection_element_set(php_oci_collection *collection, long index, char *value, int value_len TSRMLS_DC) +int php_oci_collection_element_set(php_oci_collection *collection, long index, zstr value, int value_len TSRMLS_DC) { if (value_len == 0) { return php_oci_collection_element_set_null(collection, index TSRMLS_CC); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_interface.c?r1=1.18&r2=1.19&diff_format=u Index: php-src/ext/oci8/oci8_interface.c diff -u php-src/ext/oci8/oci8_interface.c:1.18 php-src/ext/oci8/oci8_interface.c:1.19 --- php-src/ext/oci8/oci8_interface.c:1.18 Tue Aug 22 11:08:28 2006 +++ php-src/ext/oci8/oci8_interface.c Fri Nov 10 16:56:19 2006 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_interface.c,v 1.18 2006/08/22 11:08:28 tony2001 Exp $ */ +/* $Id: oci8_interface.c,v 1.19 2006/11/10 16:56:19 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -46,13 +46,14 @@ PHP_FUNCTION(oci_define_by_name) { zval *stmt, *var; - char *name; + zstr name; int name_len; + zend_uchar name_type; long type = SQLT_CHR; php_oci_statement *statement; php_oci_define *define, *tmp_define; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|l", &stmt, &name, &name_len, &var, &type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rtz/|l", &stmt, &name, &name_len, &name_type, &var, &type) == FAILURE) { return; } @@ -70,7 +71,7 @@ define = ecalloc(1,sizeof(php_oci_define)); - if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) { + if (zend_hash_add(statement->defines, name.s, USTR_BYTES(name_type, name_len+1), define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) { efree(define); define = tmp_define; } else { @@ -78,8 +79,14 @@ RETURN_FALSE; } - define->name = (text*) estrndup(name, name_len); + if (name_type == IS_UNICODE) { + define->name.u = eustrndup(name.u, name_len); + } else { + define->name.s = estrndup(name.s, name_len); + } + define->name_len = name_len; + define->name_type = name_type; define->type = type; define->zval = var; zval_add_ref(&var); @@ -96,12 +103,13 @@ ub2 bind_type = SQLT_CHR; /* unterminated string */ int name_len; long maxlen = -1, type = 0; - char *name; + zstr name; + zend_uchar name_type; zval *z_statement; zval *bind_var = NULL; php_oci_statement *statement; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|ll", &z_statement, &name, &name_len, &bind_var, &maxlen, &type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rtz/|ll", &z_statement, &name, &name_len, &name_type, &bind_var, &maxlen, &type) == FAILURE) { return; } @@ -111,7 +119,7 @@ PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - if (php_oci_bind_by_name(statement, name, name_len, bind_var, maxlen, bind_type TSRMLS_CC)) { + if (php_oci_bind_by_name(statement, name, name_len, bind_var, maxlen, bind_type, name_type TSRMLS_CC)) { RETURN_FALSE; } RETURN_TRUE; @@ -126,12 +134,13 @@ long max_item_len = -1; long max_array_len = 0; long type = SQLT_AFC; - char *name; + zstr name; + zend_uchar name_type; zval *z_statement; zval *bind_var = NULL; php_oci_statement *statement; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/l|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rtz/l|ll", &z_statement, &name, &name_len, &name_type, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) { return; } @@ -146,7 +155,7 @@ RETURN_FALSE; } - if (php_oci_bind_array_by_name(statement, name, name_len, bind_var, max_array_len, max_item_len, type TSRMLS_CC)) { + if (php_oci_bind_array_by_name(statement, name, name_len, bind_var, max_array_len, max_item_len, type, name_type TSRMLS_CC)) { RETURN_FALSE; } RETURN_TRUE; @@ -184,18 +193,18 @@ { zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - char *data; + zstr data; int data_len; + zend_uchar data_type; long offset = 0; ub4 bytes_written; if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t|l", &data, &data_len, &data_type, &offset) == FAILURE) { return; } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &offset) == FAILURE) { + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ot|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &data_type, &offset) == FAILURE) { return; } } @@ -211,8 +220,8 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset parameter must be greater than or equal to 0"); RETURN_FALSE; } - - if (php_oci_lob_write(descriptor, offset, data, data_len, &bytes_written TSRMLS_CC)) { + + if (php_oci_lob_write(descriptor, offset, data, USTR_BYTES(data_type, data_len), &bytes_written TSRMLS_CC)) { RETURN_FALSE; } RETURN_TRUE; @@ -259,8 +268,9 @@ { zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - char *buffer = NULL; + zstr buffer = NULL_ZSTR; ub4 buffer_len; + php_oci_lob_type lob_type; if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { @@ -278,11 +288,24 @@ if (php_oci_lob_read(descriptor, -1, 0, &buffer, &buffer_len TSRMLS_CC)) { RETURN_FALSE; } - if (buffer_len > 0) { - RETURN_STRINGL(buffer, buffer_len, 0); + + if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC) > 0) { + RETURN_FALSE; } - else { - RETURN_EMPTY_STRING(); + + switch (lob_type) { + case OCI_IS_CLOB: + if (buffer_len > 0) { + RETURN_TEXTL(buffer, TEXT_CHARS(buffer_len), 0); + } + RETURN_EMPTY_TEXT(); + break; + case OCI_IS_BLOB: + if (buffer_len > 0) { + RETURN_STRINGL(buffer.s, buffer_len, 0); + } + RETURN_EMPTY_STRING(); + break; } } /* }}} */ @@ -294,8 +317,9 @@ zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; long length; - char *buffer; + zstr buffer; ub4 buffer_len; + php_oci_lob_type lob_type; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) { @@ -322,12 +346,25 @@ if (php_oci_lob_read(descriptor, length, descriptor->lob_current_position, &buffer, &buffer_len TSRMLS_CC)) { RETURN_FALSE; - } - if (buffer_len > 0) { - RETURN_STRINGL(buffer, buffer_len, 0); } - else { - RETURN_EMPTY_STRING(); + + if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC) > 0) { + RETURN_FALSE; + } + + switch (lob_type) { + case OCI_IS_CLOB: + if (buffer_len > 0) { + RETURN_TEXTL(buffer, TEXT_CHARS(buffer_len), 0); + } + RETURN_EMPTY_TEXT(); + break; + case OCI_IS_BLOB: + if (buffer_len > 0) { + RETURN_STRINGL(buffer.s, buffer_len, 0); + } + RETURN_EMPTY_STRING(); + break; } } /* }}} */ @@ -439,7 +476,6 @@ PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { RETURN_FALSE; } @@ -449,7 +485,7 @@ descriptor->lob_current_position += offset; break; case PHP_OCI_SEEK_END: - if (descriptor->lob_size + offset >= 0) { + if ((descriptor->lob_size + offset) >= 0) { descriptor->lob_current_position = descriptor->lob_size + offset; } else { @@ -458,10 +494,9 @@ break; case PHP_OCI_SEEK_SET: default: - descriptor->lob_current_position = (offset > 0) ? offset : 0; + descriptor->lob_current_position = (offset > 0) ? offset : 0; break; } - RETURN_TRUE; } /* }}} */ @@ -503,10 +538,11 @@ int data_len; long write_len = 0; ub4 bytes_written; - char *data; + zstr data; + zend_uchar data_type; if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &write_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t|l", &data, &data_len, &data_type, &write_len) == FAILURE) { return; } @@ -515,7 +551,7 @@ } } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &write_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ot|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &data_type, &write_len) == FAILURE) { return; } @@ -534,8 +570,8 @@ if (data_len <= 0) { RETURN_LONG(0); } - - if (php_oci_lob_write(descriptor, descriptor->lob_current_position, data, data_len, &bytes_written TSRMLS_CC)) { + + if (php_oci_lob_write(descriptor, descriptor->lob_current_position, data, USTR_BYTES(data_type, data_len), &bytes_written TSRMLS_CC)) { RETURN_FALSE; } RETURN_LONG(bytes_written); @@ -850,11 +886,13 @@ { zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - char *filename, *buffer; + char *filename; + zstr buffer; int filename_len; long start = -1, length = -1, block_length; php_stream *stream; ub4 lob_length; + php_oci_lob_type lob_type; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &filename, &filename_len, &start, &length) == FAILURE) { @@ -920,19 +958,23 @@ block_length = length; } + if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC)) { + RETURN_FALSE; + } + while(length > 0) { ub4 tmp_bytes_read = 0; if (php_oci_lob_read(descriptor, block_length, start, &buffer, &tmp_bytes_read TSRMLS_CC)) { php_stream_close(stream); RETURN_FALSE; } - if (tmp_bytes_read && !php_stream_write(stream, buffer, tmp_bytes_read)) { + if (tmp_bytes_read && !php_stream_u_write(stream, (lob_type == OCI_IS_CLOB ? IS_UNICODE : IS_STRING), buffer, tmp_bytes_read)) { php_stream_close(stream); - efree(buffer); + efree(buffer.v); RETURN_FALSE; } - if (buffer) { - efree(buffer); + if (buffer.v) { + efree(buffer.v); } length -= tmp_bytes_read; @@ -956,17 +998,18 @@ { zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - char *data; + zstr data; int data_len; + zend_uchar data_type; long type = OCI_TEMP_CLOB; if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t|l", &data, &data_len, &data_type, &type) == FAILURE) { return; } } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ot|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &data_type, &type) == FAILURE) { return; } } @@ -978,7 +1021,7 @@ PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - if (php_oci_lob_write_tmp(descriptor, type, data, data_len TSRMLS_CC)) { + if (php_oci_lob_write_tmp(descriptor, type, data, USTR_BYTES(data_type, data_len) TSRMLS_CC)) { RETURN_FALSE; } RETURN_TRUE; @@ -1099,7 +1142,7 @@ php_oci_out_column *column; if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0) ) ) { - RETURN_STRINGL(column->name, column->name_len, 1); + RETURN_TEXTL(column->name, column->name_len, 1); } RETURN_FALSE; } @@ -1163,49 +1206,49 @@ switch (column->data_type) { #ifdef SQLT_TIMESTAMP case SQLT_TIMESTAMP: - RETVAL_STRING("TIMESTAMP",1); + RETVAL_ASCII_STRING("TIMESTAMP", ZSTR_DUPLICATE); break; #endif #ifdef SQLT_TIMESTAMP_TZ case SQLT_TIMESTAMP_TZ: - RETVAL_STRING("TIMESTAMP_TZ",1); + RETVAL_ASCII_STRING("TIMESTAMP_TZ", ZSTR_DUPLICATE); break; #endif case SQLT_DAT: - RETVAL_STRING("DATE",1); + RETVAL_ASCII_STRING("DATE", ZSTR_DUPLICATE); break; case SQLT_NUM: - RETVAL_STRING("NUMBER",1); + RETVAL_ASCII_STRING("NUMBER", ZSTR_DUPLICATE); break; case SQLT_LNG: - RETVAL_STRING("LONG",1); + RETVAL_ASCII_STRING("LONG", ZSTR_DUPLICATE); break; case SQLT_BIN: - RETVAL_STRING("RAW",1); + RETVAL_ASCII_STRING("RAW", ZSTR_DUPLICATE); break; case SQLT_LBI: - RETVAL_STRING("LONG RAW",1); + RETVAL_ASCII_STRING("LONG RAW", ZSTR_DUPLICATE); break; case SQLT_CHR: - RETVAL_STRING("VARCHAR2",1); + RETVAL_ASCII_STRING("VARCHAR2", ZSTR_DUPLICATE); break; case SQLT_RSET: - RETVAL_STRING("REFCURSOR",1); + RETVAL_ASCII_STRING("REFCURSOR", ZSTR_DUPLICATE); break; case SQLT_AFC: - RETVAL_STRING("CHAR",1); + RETVAL_ASCII_STRING("CHAR", ZSTR_DUPLICATE); break; case SQLT_BLOB: - RETVAL_STRING("BLOB",1); + RETVAL_ASCII_STRING("BLOB", ZSTR_DUPLICATE); break; case SQLT_CLOB: - RETVAL_STRING("CLOB",1); + RETVAL_ASCII_STRING("CLOB", ZSTR_DUPLICATE); break; case SQLT_BFILE: - RETVAL_STRING("BFILE",1); + RETVAL_ASCII_STRING("BFILE", ZSTR_DUPLICATE); break; case SQLT_RDD: - RETVAL_STRING("ROWID",1); + RETVAL_ASCII_STRING("ROWID", ZSTR_DUPLICATE); break; default: RETVAL_LONG(column->data_type); @@ -1356,7 +1399,7 @@ columns = safe_emalloc(statement->ncolumns, sizeof(php_oci_out_column *), 0); for (i = 0; i < statement->ncolumns; i++) { - columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); } while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) { @@ -1372,7 +1415,7 @@ if (flags & PHP_OCI_NUM) { zend_hash_next_index_insert(Z_ARRVAL_P(row), &element, sizeof(zval*), NULL); } else { /* default to ASSOC */ - zend_hash_update(Z_ARRVAL_P(row), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL); + zend_u_hash_update(Z_ARRVAL_P(row), (UG(unicode) ? IS_UNICODE : IS_STRING), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL); } } @@ -1392,7 +1435,7 @@ if (flags & PHP_OCI_NUM) { for (i = 0; i < statement->ncolumns; i++) { - columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); MAKE_STD_ZVAL(tmp); array_init(tmp); @@ -1400,11 +1443,11 @@ } } else { /* default to ASSOC */ for (i = 0; i < statement->ncolumns; i++) { - columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); MAKE_STD_ZVAL(tmp); array_init(tmp); - zend_hash_update(Z_ARRVAL_P(array), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ])); + zend_u_hash_update(Z_ARRVAL_P(array), (UG(unicode) ? IS_UNICODE : IS_STRING), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ])); } } @@ -1549,7 +1592,7 @@ dvoid *errh = NULL; #ifdef HAVE_OCI8_ATTR_STATEMENT ub2 error_offset = 0; - text *sqltext = NULL; + zstr sqltext = NULL_ZSTR; #endif if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == FAILURE) { @@ -1595,10 +1638,18 @@ if (errcode) { array_init(return_value); add_assoc_long(return_value, "code", errcode); - add_assoc_string(return_value, "message", (char*) errbuf, 0); + if (UG(unicode)) { + add_assoc_unicode(return_value, "message", (UChar *)errbuf, 0); + } else { + add_assoc_string(return_value, "message", errbuf, 0); + } #ifdef HAVE_OCI8_ATTR_STATEMENT add_assoc_long(return_value, "offset", error_offset); - add_assoc_string(return_value, "sqltext", sqltext ? (char *) sqltext : "", 1); + if (sqltext.v) { + add_assoc_text(return_value, "sqltext", sqltext, 1); + } else { + add_assoc_ascii_string(return_value, "sqltext", "", 1); + } #endif } else { RETURN_FALSE; @@ -1630,16 +1681,17 @@ zval *z_connection; php_oci_connection *connection; php_oci_statement *statement; - char *query; + zstr query; + zend_uchar query_type; int query_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &query, &query_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rt", &z_connection, &query, &query_len, &query_type) == FAILURE) { return; } PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - statement = php_oci_statement_create(connection, query, query_len TSRMLS_CC); + statement = php_oci_statement_create(connection, query, query_len, query_type TSRMLS_CC); if (statement) { RETURN_RESOURCE(statement->id); @@ -1674,11 +1726,12 @@ PHP_FUNCTION(oci_password_change) { zval *z_connection; - text *user, *pass_old, *pass_new, *dbname; + zstr user, pass_old, pass_new, dbname; + zend_uchar user_type, pass_old_type, pass_new_type, dbname_type; int user_len, pass_old_len, pass_new_len, dbname_len; php_oci_connection *connection; - 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) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rTTT", &z_connection, &user, &user_len, &user_type, &pass_old, &pass_old_len, &pass_old_type, &pass_new, &pass_new_len, &pass_new_type) == SUCCESS) { PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); if (!user_len) { @@ -1694,11 +1747,11 @@ RETURN_FALSE; } - if (php_oci_password_change(connection, user, user_len, pass_old, pass_old_len, pass_new, pass_new_len TSRMLS_CC)) { + if (php_oci_password_change(connection, user, user_len, pass_old, pass_old_len, pass_new, pass_new_len, user_type TSRMLS_CC)) { RETURN_FALSE; } RETURN_TRUE; - } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ssss", &dbname, &dbname_len, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) { + } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "TTTT", &dbname, &dbname_len, &dbname_type, &user, &user_len, &user_type, &pass_old, &pass_old_len, &pass_old_type, &pass_new, &pass_new_len, &pass_new_type) == SUCCESS) { if (!user_len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "username cannot be empty"); @@ -1713,7 +1766,7 @@ 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); + connection = php_oci_do_connect_ex(user, user_len, pass_old, pass_old_len, pass_new, pass_new_len, dbname, dbname_len, NULL_ZSTR, OCI_DEFAULT, 0, 0, user_type TSRMLS_CC); if (!connection) { RETURN_FALSE; } @@ -1737,7 +1790,7 @@ PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - statement = php_oci_statement_create(connection, NULL, 0 TSRMLS_CC); + statement = php_oci_statement_create(connection, NULL_ZSTR, 0, 0 TSRMLS_CC); if (statement) { RETURN_RESOURCE(statement->id); @@ -1768,7 +1821,7 @@ { zval *z_connection; php_oci_connection *connection; - char *version = NULL; + zstr version = NULL_ZSTR; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) { return; @@ -1780,7 +1833,7 @@ RETURN_FALSE; } - RETURN_STRING(version, 0); + RETURN_TEXT(version, 0); } /* }}} */ @@ -1889,16 +1942,16 @@ { zval **tmp, *z_collection = getThis(); php_oci_collection *collection; - char *value; + zstr value; int value_len; + zend_uchar value_type; if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &value, &value_len, &value_type) == FAILURE) { return; } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &z_collection, oci_coll_class_entry_ptr, &value, &value_len) == FAILURE) { + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ot", &z_collection, oci_coll_class_entry_ptr, &value, &value_len, &value_type) == FAILURE) { return; } } @@ -2000,15 +2053,15 @@ php_oci_collection *collection; int value_len; long element_index; - char *value; + zstr value; + zend_uchar value_type; if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &element_index, &value, &value_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lt", &element_index, &value, &value_len, &value_type) == FAILURE) { return; } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ols", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len) == FAILURE) { + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Olt", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len, &value_type) == FAILURE) { return; } } @@ -2123,10 +2176,11 @@ zval *z_connection; php_oci_connection *connection; php_oci_collection *collection; - char *tdo, *schema = NULL; + zstr tdo, schema = NULL_ZSTR; int tdo_len, schema_len = 0; + zend_uchar tdo_type, schema_type; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s", &z_connection, &tdo, &tdo_len, &schema, &schema_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rT|T", &z_connection, &tdo, &tdo_len, &tdo_type, &schema, &schema_len, &schema_type) == FAILURE) { return; } @@ -2135,8 +2189,7 @@ if ( (collection = php_oci_collection_create(connection, tdo, tdo_len, schema, schema_len TSRMLS_CC)) ) { object_init_ex(return_value, oci_coll_class_entry_ptr); add_property_resource(return_value, "collection", collection->id); - } - else { + } else { RETURN_FALSE; } } http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_lob.c?r1=1.19&r2=1.20&diff_format=u Index: php-src/ext/oci8/oci8_lob.c diff -u php-src/ext/oci8/oci8_lob.c:1.19 php-src/ext/oci8/oci8_lob.c:1.20 --- php-src/ext/oci8/oci8_lob.c:1.19 Sun Oct 8 13:34:22 2006 +++ php-src/ext/oci8/oci8_lob.c Fri Nov 10 16:56:19 2006 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_lob.c,v 1.19 2006/10/08 13:34:22 bjori Exp $ */ +/* $Id: oci8_lob.c,v 1.20 2006/11/10 16:56:19 tony2001 Exp $ */ @@ -156,14 +156,20 @@ { ub4 lenp = (ub4) len; php_oci_lob_ctx *ctx = (php_oci_lob_ctx *)ctxp; + TSRMLS_FETCH(); switch (piece) { case OCI_LAST_PIECE: - *(ctx->lob_data) = erealloc(*(ctx->lob_data), (size_t) (*(ctx->lob_len) + lenp + 1)); + *(ctx->lob_data) = erealloc(*(ctx->lob_data), (size_t) (*(ctx->lob_len) + lenp + TEXT_BYTES(1))); memcpy(*(ctx->lob_data) + *(ctx->lob_len), bufxp, (size_t) lenp); *(ctx->lob_len) += lenp; - *(*(ctx->lob_data) + *(ctx->lob_len)) = 0x00; + + if (UG(unicode)) { + *(*(ctx->lob_data) + *(ctx->lob_len) + 1) = 0; + } + *(*(ctx->lob_data) + *(ctx->lob_len)) = 0; + return OCI_CONTINUE; case OCI_FIRST_PIECE: @@ -173,14 +179,12 @@ *(ctx->lob_len) += lenp; return OCI_CONTINUE; - default: { - TSRMLS_FETCH(); + default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected LOB piece id received (value:%d)", piece); efree(*(ctx->lob_data)); *(ctx->lob_data) = NULL; *(ctx->lob_len) = 0; return OCI_ERROR; - } } } /* }}} */ @@ -211,27 +215,27 @@ /* {{{ php_oci_lob_read() Read specified portion of the LOB into the buffer */ -int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long initial_offset, char **data, ub4 *data_len TSRMLS_DC) +int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long initial_offset, zstr *data, ub4 *data_len TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; ub4 length = 0; int buffer_size = PHP_OCI_LOB_BUFFER_SIZE; php_oci_lob_ctx ctx; ub1 *bufp; + php_oci_lob_type lob_type; #if defined(HAVE_OCI_LOB_READ2) oraub8 bytes_read, offset = 0; oraub8 requested_len = read_length; /* this is by default */ oraub8 chars_read = 0; - int is_clob = 0; #else int bytes_read, offset = 0; int requested_len = read_length; /* this is by default */ #endif *data_len = 0; - *data = NULL; + *data = NULL_ZSTR; ctx.lob_len = data_len; - ctx.lob_data = data; + ctx.lob_data = &(data->s); if (php_oci_lob_get_length(descriptor, &length TSRMLS_CC)) { return 1; @@ -257,7 +261,7 @@ if (requested_len <= 0) { return 0; } - + offset = initial_offset; if (descriptor->type == OCI_DTYPE_FILE) { @@ -269,24 +273,13 @@ return 1; } } -#ifdef HAVE_OCI_LOB_READ2 - else { - ub2 charset_id = 0; - - PHP_OCI_CALL_RETURN(connection->errcode, OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - if (charset_id > 0) { /* charset_id is always > 0 for [N]CLOBs */ - is_clob = 1; - } + if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC) > 0) { + return 1; } - if (is_clob) { +#ifdef HAVE_OCI_LOB_READ2 + if (lob_type == OCI_IS_CLOB) { chars_read = requested_len; bytes_read = 0; } else { @@ -318,7 +311,7 @@ efree(bufp); - if (is_clob) { + if (lob_type == OCI_IS_CLOB) { offset = descriptor->lob_current_position + chars_read; } else { offset = descriptor->lob_current_position + bytes_read; @@ -348,22 +341,26 @@ ); efree(bufp); - offset = descriptor->lob_current_position + bytes_read; + if (!is_clob) { + offset = descriptor->lob_current_position + TEXT_BYTES(bytes_read); + } else { + offset = descriptor->lob_current_position + bytes_read; + } #endif if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - if (*data) { - efree(*data); - *data = NULL; + if (data->s) { + efree(data->s); + *data = NULL_ZSTR; } *data_len = 0; return 1; } - descriptor->lob_current_position = (int)offset; + descriptor->lob_current_position = (offset <= descriptor->lob_size) ? offset : descriptor->lob_size; if (descriptor->type == OCI_DTYPE_FILE) { PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); @@ -371,9 +368,9 @@ if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - if (*data) { - efree(*data); - *data = NULL; + if (data->s) { + efree(data->s); + *data = NULL_ZSTR; } *data_len = 0; return 1; @@ -385,18 +382,28 @@ /* {{{ php_oci_lob_write() Write data to the LOB */ -int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written TSRMLS_DC) +int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, zstr data, int data_len, ub4 *bytes_written TSRMLS_DC) { OCILobLocator *lob = (OCILobLocator *) descriptor->descriptor; php_oci_connection *connection = (php_oci_connection *) descriptor->connection; ub4 lob_length; + ub4 data_len_out = data_len; + php_oci_lob_type lob_type; *bytes_written = 0; if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { return 1; } - - if (!data || data_len <= 0) { + + if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC)) { + return 1; + } + + if (lob_type == OCI_IS_CLOB) { + data_len_out = TEXT_CHARS(data_len); + } + + if (!data.v || data_len <= 0) { return 0; } @@ -407,15 +414,15 @@ if (offset > descriptor->lob_current_position) { offset = descriptor->lob_current_position; } - + PHP_OCI_CALL_RETURN(connection->errcode, OCILobWrite, ( connection->svc, connection->err, lob, - (ub4 *)&data_len, + (ub4 *)&data_len_out, (ub4) offset + 1, - (dvoid *) data, + (dvoid *) (text *)data.s, (ub4) data_len, OCI_ONE_PIECE, (dvoid *)0, @@ -431,8 +438,8 @@ *bytes_written = 0; return 1; } - *bytes_written = data_len; - descriptor->lob_current_position += data_len; + *bytes_written = data_len_out; + descriptor->lob_current_position += data_len_out; if (descriptor->lob_current_position > descriptor->lob_size) { descriptor->lob_size = descriptor->lob_current_position; @@ -779,7 +786,7 @@ if (length == -1) { length = lob_length; } - + PHP_OCI_CALL_RETURN(connection->errcode, OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, offset+1)); if (connection->errcode != OCI_SUCCESS) { @@ -812,7 +819,7 @@ /* {{{ php_oci_lob_write_tmp() Create temporary LOB and write data to it */ -int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, ub1 type, char *data, int data_len TSRMLS_DC) +int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, ub1 type, zstr data, int data_len TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; OCILobLocator *lob = descriptor->descriptor; @@ -829,7 +836,7 @@ break; } - if (!data || data_len <= 0) { + if (!data.v || data_len <= 0) { /* nothing to write, silently fail */ return 1; } @@ -864,4 +871,44 @@ return php_oci_lob_write(descriptor, 0, data, data_len, &bytes_written TSRMLS_CC); } /* }}} */ +int php_oci_lob_get_type(php_oci_descriptor *descriptor, php_oci_lob_type *lob_type TSRMLS_DC) /* {{{ */ +{ + php_oci_connection *connection = descriptor->connection; + + *lob_type = 0; + + if (descriptor->lob_type) { + *lob_type = descriptor->lob_type; + return 0; + } + + if (descriptor->type == OCI_DTYPE_FILE) { + *lob_type = OCI_IS_BLOB; + descriptor->lob_type = OCI_IS_BLOB; + return 0; + } else { + ub2 charset_id = 0; + + PHP_OCI_CALL_RETURN(connection->errcode, OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id)); + + if (connection->errcode != OCI_SUCCESS) { + php_oci_error(connection->err, connection->errcode TSRMLS_CC); + PHP_OCI_HANDLE_ERROR(connection, connection->errcode); + return 1; + } + + if (charset_id > 0) { /* charset_id is always > 0 for [N]CLOBs */ + *lob_type = OCI_IS_CLOB; + descriptor->lob_type = OCI_IS_CLOB; + return 0; + } + } + + *lob_type = OCI_IS_BLOB; + descriptor->lob_type = OCI_IS_BLOB; + + return 0; +} +/* }}} */ + #endif /* HAVE_OCI8 */ http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.33&r2=1.34&diff_format=u Index: php-src/ext/oci8/oci8_statement.c diff -u php-src/ext/oci8/oci8_statement.c:1.33 php-src/ext/oci8/oci8_statement.c:1.34 --- php-src/ext/oci8/oci8_statement.c:1.33 Fri Nov 10 16:33:28 2006 +++ php-src/ext/oci8/oci8_statement.c Fri Nov 10 16:56:19 2006 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_statement.c,v 1.33 2006/11/10 16:33:28 tony2001 Exp $ */ +/* $Id: oci8_statement.c,v 1.34 2006/11/10 16:56:19 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, int query_len TSRMLS_DC) +php_oci_statement *php_oci_statement_create (php_oci_connection *connection, zstr query, int query_len, zend_uchar type TSRMLS_DC) { php_oci_statement *statement; @@ -67,8 +67,8 @@ connection->svc, &(statement->stmt), connection->err, - (text *)query, - query_len, + (text *)query.s, + USTR_BYTES(type, query_len), NULL, 0, OCI_NTV_SYNTAX, @@ -95,8 +95,10 @@ } } - if (query && query_len) { - statement->last_query = estrndup(query, query_len); + if (query.s && query_len) { + statement->last_query = emalloc(USTR_BYTES(type, query_len + 1)); + memcpy(statement->last_query, query.s, USTR_BYTES(type, query_len)); + statement->last_query[USTR_BYTES(type, query_len)] = '\0'; statement->last_query_len = query_len; } else { @@ -161,8 +163,8 @@ ub4 typep, iterp, idxp; ub1 in_outp, piecep; zend_bool piecewisecols = 0; - php_oci_out_column *column; + zstr zstr_data; PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); @@ -190,7 +192,7 @@ /* reset length for all piecewise columns */ for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); if (column->piecewise) { column->retlen4 = 0; piecewisecols = 1; @@ -215,12 +217,14 @@ /* scan through our columns for a piecewise column with a matching handle */ for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - if (column->piecewise && handlepp == column->oci_define) { + column = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); + if (column->piecewise && handlepp == column->oci_define) { if (!column->data) { - column->data = (text *) ecalloc(1, PHP_OCI_PIECE_SIZE + 1); + zstr_data.v = ecalloc(1, PHP_OCI_PIECE_SIZE + 1); + column->data = zstr_data.v; } else { - column->data = erealloc(column->data, column->retlen4 + PHP_OCI_PIECE_SIZE + 1); + zstr_data.v = erealloc(column->data, column->retlen4 + PHP_OCI_PIECE_SIZE + 1); + column->data = zstr_data.v; } column->cb_retlen = PHP_OCI_PIECE_SIZE; @@ -230,7 +234,7 @@ (void *) column->oci_define, OCI_HTYPE_DEFINE, statement->err, - ((char*)column->data) + column->retlen4, + ((void*)zstr_data.s) + column->retlen4, &(column->cb_retlen), piecep, &column->indicator, @@ -245,7 +249,7 @@ if (piecewisecols) { for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); if (column && column->piecewise && handlepp == column->oci_define) { column->retlen4 += column->cb_retlen; } @@ -258,7 +262,7 @@ /* do the stuff needed for OCIDefineByName */ for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); if (column == NULL) { continue; } @@ -285,7 +289,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, int column_name_len TSRMLS_DC) +php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, long column_index, zstr column_name, int column_name_len TSRMLS_DC) { php_oci_out_column *column = NULL; int i; @@ -294,13 +298,17 @@ return NULL; } - if (column_name) { + if (column_name.v != NULL) { for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); if (column == NULL) { continue; - } else if (((int) column->name_len == column_name_len) && (!strncmp(column->name, column_name, column_name_len))) { - return column; + } else if ((int) column->name_len == column_name_len) { + if (!UG(unicode) && !strncmp(column->name.s, column_name.s, column_name_len)) { + return column; + } else if (UG(unicode) && !u_strncmp(column->name.u, column_name.u, column_name_len)) { + return column; + } } } } else if (column_index != -1) { @@ -469,7 +477,7 @@ } outcol->storage_size4 = outcol->data_size; - outcol->retlen = outcol->data_size; + outcol->retlen = TEXT_CHARS(outcol->data_size); /* get scale of the column */ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->scale, (dvoid *)0, OCI_ATTR_SCALE, statement->err)); @@ -502,17 +510,22 @@ } PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - outcol->name = estrndup((char*) colname, outcol->name_len); + if (UG(unicode)) { + outcol->name_len = TEXT_CHARS(outcol->name_len); + outcol->name.u = eustrndup((UChar*) colname, outcol->name_len); + } else { + outcol->name.s = estrndup((char*) colname, outcol->name_len); + } /* find a user-setted define */ if (statement->defines) { - zend_hash_find(statement->defines,outcol->name,outcol->name_len,(void **) &outcol->define); + zend_hash_find(statement->defines, outcol->name.s, TEXT_BYTES(outcol->name_len+1), (void **) &outcol->define); } buf = 0; switch (outcol->data_type) { case SQLT_RSET: - outcol->statement = php_oci_statement_create(statement->connection, NULL, 0 TSRMLS_CC); + outcol->statement = php_oci_statement_create(statement->connection, NULL_ZSTR, 0, 0 TSRMLS_CC); outcol->stmtid = outcol->statement->id; outcol->statement->nested = 1; @@ -544,7 +557,7 @@ descr = php_oci_lob_create(statement->connection, dtype TSRMLS_CC); if (!descr) { - efree(outcol->name); + efree(outcol->name.v); return 1; } outcol->descid = descr->id; @@ -732,6 +745,14 @@ } else if (Z_TYPE_P(bind->zval) == IS_STRING && Z_STRLEN_P(bind->zval) > 0) { Z_STRVAL_P(bind->zval) = erealloc(Z_STRVAL_P(bind->zval), Z_STRLEN_P(bind->zval)+1); Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0'; + } else if (Z_TYPE_P(bind->zval) == IS_UNICODE && Z_UNILEN_P(bind->zval) > 0) { + if (bind->out) { + /* OCI returns _bytes_ as data length for OUT binds */ + Z_UNILEN_P(bind->zval) = TEXT_CHARS(Z_UNILEN_P(bind->zval)); + } + Z_UNIVAL_P(bind->zval).u = eurealloc(Z_UNIVAL_P(bind->zval).u, Z_UNILEN_P(bind->zval)+1); + Z_UNIVAL_P(bind->zval).s[ TEXT_BYTES(Z_UNILEN_P(bind->zval)) - 1 ] = '\0'; + Z_UNIVAL_P(bind->zval).s[ TEXT_BYTES(Z_UNILEN_P(bind->zval)) ] = '\0'; } else if (Z_TYPE_P(bind->zval) == IS_ARRAY) { int i; zval **entry; @@ -779,16 +800,20 @@ php_oci_error(connection->err, connection->errcode TSRMLS_CC); ZVAL_NULL(*entry); } else { - ZVAL_STRINGL(*entry, buff, buff_len, 1); + zstr tmp; + tmp.s = buff; + ZVAL_TEXTL(*entry, tmp, buff_len, 1); } zend_hash_move_forward(hash); } else { + zstr tmp; PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); + tmp.s = buff; if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); add_next_index_null(bind->zval); } else { - add_next_index_stringl(bind->zval, buff, buff_len, 1); + add_next_index_textl(bind->zval, tmp, buff_len, 1); } } } @@ -800,15 +825,20 @@ case SQLT_AVC: case SQLT_STR: case SQLT_LVC: - for (i = 0; i < bind->array.current_length; i++) { - /* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */ - int curr_element_length = bind->array.element_lengths[i]; - if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { - zval_dtor(*entry); - ZVAL_STRINGL(*entry, ((text *)bind->array.elements)+i*bind->array.max_length, curr_element_length, 1); - zend_hash_move_forward(hash); - } else { - add_next_index_stringl(bind->zval, ((text *)bind->array.elements)+i*bind->array.max_length, curr_element_length, 1); + { + zstr tmp; + for (i = 0; i < bind->array.current_length; i++) { + /* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */ + int curr_element_length = bind->array.element_lengths[i]; + if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { + zval_dtor(*entry); + tmp.s = ((text *)bind->array.elements)+i*bind->array.max_length; + ZVAL_TEXTL(*entry, tmp, curr_element_length, 1); + zend_hash_move_forward(hash); + } else { + tmp.s = ((text *)bind->array.elements)+i*bind->array.max_length; + add_next_index_textl(bind->zval, tmp, curr_element_length, 1); + } } } break; @@ -821,7 +851,7 @@ /* {{{ php_oci_bind_by_name() Bind zval to the given placeholder */ -int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval* var, long maxlength, long type TSRMLS_DC) +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) { php_oci_collection *bind_collection = NULL; php_oci_descriptor *bind_descriptor = NULL; @@ -894,10 +924,20 @@ case SQLT_CHR: /* this is the default case when type was not specified */ if (Z_TYPE_P(var) != IS_NULL) { - convert_to_string(var); + convert_to_text(var); } if (maxlength == -1) { - value_sz = (Z_TYPE_P(var) == IS_STRING) ? Z_STRLEN_P(var) : 0; + switch (Z_TYPE_P(var)) { + case IS_STRING: + value_sz = Z_STRLEN_P(var); + break; + case IS_UNICODE: + value_sz = Z_UNILEN_P(var); + break; + default: + value_sz = 0; + break; + } } else { value_sz = maxlength; } @@ -930,13 +970,13 @@ } memset((void*)&bind,0,sizeof(php_oci_bind)); - if (zend_hash_find(statement->binds, name, name_len + 1, (void **)&old_bind) == SUCCESS) { + if (zend_hash_find(statement->binds, name.s, USTR_BYTES(uni_type, name_len + 1), (void **)&old_bind) == SUCCESS) { bindp = old_bind; if (bindp->zval) { zval_ptr_dtor(&bindp->zval); } } else { - zend_hash_update(statement->binds, name, name_len + 1, &bind, sizeof(php_oci_bind), (void **)&bindp); + zend_hash_update(statement->binds, name.s, USTR_BYTES(uni_type, name_len + 1), &bind, sizeof(php_oci_bind), (void **)&bindp); } bindp->descriptor = oci_desc; @@ -951,10 +991,10 @@ statement->stmt, /* statement handle */ (OCIBind **)&bindp->bind, /* bind hdl (will alloc) */ statement->err, /* error handle */ - (text*) name, /* placeholder name */ - name_len, /* placeholder length */ + (text*) name.s, /* placeholder name */ + USTR_BYTES(uni_type, name_len), /* placeholder length */ (dvoid *)bind_data, /* in/out data */ - value_sz, /* PHP_OCI_MAX_DATA_SIZE, */ /* max size of input/output data */ + TEXT_BYTES(value_sz), /* PHP_OCI_MAX_DATA_SIZE, */ /* max size of input/output data */ (ub2)type, /* in/out data type */ (dvoid *)&bindp->indicator, /* indicator (ignored) */ (ub2 *)0, /* size array (ignored) */ @@ -1045,10 +1085,15 @@ *indpp = (dvoid *)&phpbind->indicator; } else if ((phpbind->descriptor == 0) && (phpbind->statement == 0)) { /* "normal string bind */ - convert_to_string(val); + convert_to_text(val); - *bufpp = Z_STRVAL_P(val); - *alenp = Z_STRLEN_P(val); + if (UG(unicode)) { + *bufpp = Z_UNIVAL_P(val).v; + *alenp = UBYTES(Z_UNILEN_P(val)); + } else { + *bufpp = Z_STRVAL_P(val); + *alenp = Z_STRLEN_P(val); + } *indpp = (dvoid *)&phpbind->indicator; } else if (phpbind->statement != 0) { /* RSET */ @@ -1089,25 +1134,41 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value"); return retval; } + + phpbind->out = 1; /* mark as OUT bind */ if ((Z_TYPE_P(val) == IS_OBJECT) || (Z_TYPE_P(val) == IS_RESOURCE)) { retval = OCI_CONTINUE; - } else { - convert_to_string(val); - zval_dtor(val); - - Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */ - Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(phpbind->zval) + 1); - - /* XXX we assume that zend-zval len has 4 bytes */ - *alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval); - *bufpp = Z_STRVAL_P(phpbind->zval); - *piecep = OCI_ONE_PIECE; - *rcodepp = &phpbind->retcode; - *indpp = &phpbind->indicator; - retval = OCI_CONTINUE; + } else { + if (UG(unicode)) { + convert_to_unicode(val); + zval_dtor(val); + + Z_UNILEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */ + Z_UNIVAL_P(val).v = ecalloc(1, UBYTES(Z_UNILEN_P(phpbind->zval) + 1)); + + *alenpp = (ub4*) &Z_UNILEN_P(phpbind->zval); + *bufpp = Z_UNIVAL_P(phpbind->zval).v; + *piecep = OCI_ONE_PIECE; + *rcodepp = &phpbind->retcode; + *indpp = &phpbind->indicator; + retval = OCI_CONTINUE; + } else { + convert_to_string(val); + zval_dtor(val); + + Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */ + Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(phpbind->zval) + 1); + + /* XXX we assume that zend-zval len has 4 bytes */ + *alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval); + *bufpp = Z_STRVAL_P(phpbind->zval); + *piecep = OCI_ONE_PIECE; + *rcodepp = &phpbind->retcode; + *indpp = &phpbind->indicator; + retval = OCI_CONTINUE; + } } - return retval; } /* }}} */ @@ -1134,15 +1195,15 @@ return NULL; } - if (Z_TYPE_PP(column_index) == IS_STRING) { - column = php_oci_statement_get_column(statement, -1, Z_STRVAL_PP(column_index), Z_STRLEN_PP(column_index) TSRMLS_CC); + if (Z_TYPE_PP(column_index) == IS_STRING || Z_TYPE_PP(column_index) == IS_UNICODE) { + column = php_oci_statement_get_column(statement, -1, Z_UNIVAL_PP(column_index), Z_UNILEN_PP(column_index) TSRMLS_CC); if (!column) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_PP(column_index)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column name \"%v\"", Z_UNIVAL_PP(column_index)); return NULL; } } else { convert_to_long_ex(column_index); - column = php_oci_statement_get_column(statement, Z_LVAL_PP(column_index), NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, Z_LVAL_PP(column_index), NULL_ZSTR, 0 TSRMLS_CC); if (!column) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%ld\"", Z_LVAL_PP(column_index)); return NULL; @@ -1195,7 +1256,7 @@ /* {{{ php_oci_bind_array_by_name() Bind arrays to PL/SQL types */ -int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval* var, long max_table_length, long maxlength, long type TSRMLS_DC) +int php_oci_bind_array_by_name(php_oci_statement *statement, zstr name, int name_len, zval* var, long max_table_length, long maxlength, long type, zend_uchar uni_type TSRMLS_DC) { php_oci_bind *bind, *bindp; @@ -1248,7 +1309,7 @@ zend_hash_init(statement->binds, 13, NULL, php_oci_bind_hash_dtor, 0); } - zend_hash_update(statement->binds, name, name_len + 1, bind, sizeof(php_oci_bind), (void **)&bindp); + zend_hash_update(statement->binds, name.s, USTR_BYTES(uni_type, name_len + 1), bind, sizeof(php_oci_bind), (void **)&bindp); bindp->descriptor = NULL; bindp->statement = NULL; @@ -1264,10 +1325,10 @@ statement->stmt, (OCIBind **)&bindp->bind, statement->err, - (text *)name, - name_len, + (text *)name.s, + USTR_BYTES(uni_type, name_len), (dvoid *) bindp->array.elements, - (sb4) bind->array.max_length, + (sb4) USTR_BYTES(uni_type, bind->array.max_length), type, (dvoid *)0, /* bindp->array.indicators, */ (ub2 *)bind->array.element_lengths, @@ -1303,9 +1364,9 @@ if (maxlength == -1) { zend_hash_internal_pointer_reset(hash); while (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) { - convert_to_string_ex(entry); - if (Z_STRLEN_PP(entry) > maxlength) { - maxlength = Z_STRLEN_PP(entry) + 1; + convert_to_text_ex(entry); + if (Z_UNILEN_PP(entry) > maxlength) { + maxlength = Z_UNILEN_PP(entry) + 1; } zend_hash_move_forward(hash); } @@ -1322,8 +1383,8 @@ for (i = 0; i < bind->array.current_length; i++) { if (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) { - convert_to_string_ex(entry); - bind->array.element_lengths[i] = Z_STRLEN_PP(entry); + convert_to_text_ex(entry); + bind->array.element_lengths[i] = Z_UNILEN_PP(entry); zend_hash_move_forward(hash); } else { break; @@ -1335,10 +1396,10 @@ if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { int element_length; - convert_to_string_ex(entry); - element_length = (maxlength > Z_STRLEN_PP(entry)) ? Z_STRLEN_PP(entry) : maxlength; + convert_to_text_ex(entry); + element_length = (maxlength > Z_UNILEN_PP(entry)) ? Z_UNILEN_PP(entry) : maxlength; - memcpy((text *)bind->array.elements + i*maxlength, Z_STRVAL_PP(entry), element_length); + memcpy((text *)bind->array.elements + i*maxlength, Z_UNIVAL_PP(entry).s, element_length); ((text *)bind->array.elements)[i*maxlength + element_length] = '\0'; zend_hash_move_forward(hash); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/php_oci8_int.h?r1=1.23&r2=1.24&diff_format=u Index: php-src/ext/oci8/php_oci8_int.h diff -u php-src/ext/oci8/php_oci8_int.h:1.23 php-src/ext/oci8/php_oci8_int.h:1.24 --- php-src/ext/oci8/php_oci8_int.h:1.23 Fri Nov 10 16:33:28 2006 +++ php-src/ext/oci8/php_oci8_int.h Fri Nov 10 16:56:19 2006 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_oci8_int.h,v 1.23 2006/11/10 16:33:28 tony2001 Exp $ */ +/* $Id: php_oci8_int.h,v 1.24 2006/11/10 16:56:19 tony2001 Exp $ */ #if HAVE_OCI8 # ifndef PHP_OCI8_INT_H @@ -97,6 +97,11 @@ /* }}} */ +typedef enum { + OCI_IS_CLOB=1, + OCI_IS_BLOB +} php_oci_lob_type; + typedef struct { /* php_oci_connection {{{ */ OCIEnv *env; /* private env handle */ ub2 charset; /* charset ID */ @@ -116,19 +121,21 @@ time_t idle_expiry; /* time when the connection will be considered as expired */ time_t next_ping; /* time of the next ping */ char *hash_key; /* hashed details of the connection */ + int hash_key_len; } php_oci_connection; /* }}} */ typedef struct { /* php_oci_descriptor {{{ */ int id; php_oci_connection *connection; /* parent connection handle */ dvoid *descriptor; /* OCI descriptor handle */ - ub4 type; /* descriptor type */ + ub4 type; /* descriptor type (FILE/LOB) */ int lob_current_position; /* LOB internal pointer */ int lob_size; /* cached LOB size. -1 = Lob wasn't initialized yet */ int buffering; /* cached buffering flag. 0 - off, 1 - on, 2 - on and buffer was used */ ub4 chunk_size; /* chunk size of the LOB. 0 - unknown */ ub1 charset_form; /* charset form, required for NCLOBs */ ub2 charset_id; /* charset ID */ + php_oci_lob_type lob_type; /* CLOB/BLOB */ } php_oci_descriptor; /* }}} */ typedef struct { /* php_oci_lob_ctx {{{ */ @@ -149,7 +156,8 @@ typedef struct { /* php_oci_define {{{ */ zval *zval; /* zval used in define */ - text *name; /* placeholder's name */ + zstr name; /* placeholder's name */ + zend_uchar name_type; /* unicode or not */ ub4 name_len; /* placeholder's name length */ ub4 type; /* define type */ } php_oci_define; /* }}} */ @@ -190,12 +198,13 @@ } array; sb2 indicator; /* -1 means NULL */ ub2 retcode; /* */ + zend_bool out; /* OUT bind or not */ } php_oci_bind; /* }}} */ typedef struct { /* php_oci_out_column {{{ */ php_oci_statement *statement; /* statement handle. used when fetching REFCURSORS */ OCIDefine *oci_define; /* define handle */ - char *name; /* column name */ + zstr name; /* column name */ ub4 name_len; /* column name length */ ub2 data_type; /* column data type */ ub2 data_size; /* data size */ @@ -302,17 +311,17 @@ sb4 php_oci_error (OCIError *, sword TSRMLS_DC); sb4 php_oci_fetch_errmsg(OCIError *, text ** TSRMLS_DC); #ifdef HAVE_OCI8_ATTR_STATEMENT -int php_oci_fetch_sqltext_offset(php_oci_statement *, text **, ub2 * TSRMLS_DC); +int php_oci_fetch_sqltext_offset(php_oci_statement *, zstr *, ub2 * TSRMLS_DC); #endif void php_oci_do_connect (INTERNAL_FUNCTION_PARAMETERS, int , int); -php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC); +php_oci_connection *php_oci_do_connect_ex(zstr username, int username_len, zstr password, int password_len, zstr new_password, int new_password_len, zstr dbname, int dbname_len, zstr charset, long session_mode, int persistent, int exclusive, zend_uchar type TSRMLS_DC); int php_oci_connection_rollback(php_oci_connection * TSRMLS_DC); int php_oci_connection_commit(php_oci_connection * TSRMLS_DC); -int php_oci_password_change(php_oci_connection *, char *, int, char *, int, char *, int TSRMLS_DC); -int php_oci_server_get_version(php_oci_connection *, char ** TSRMLS_DC); +int php_oci_password_change(php_oci_connection *, zstr, int, zstr, int, zstr, int, zend_uchar TSRMLS_DC); +int php_oci_server_get_version(php_oci_connection *, zstr* TSRMLS_DC); void php_oci_fetch_row(INTERNAL_FUNCTION_PARAMETERS, int, int); int php_oci_column_to_zval(php_oci_out_column *, zval *, int TSRMLS_DC); @@ -323,15 +332,16 @@ php_oci_descriptor * php_oci_lob_create (php_oci_connection *, long TSRMLS_DC); int php_oci_lob_get_length (php_oci_descriptor *, ub4 * TSRMLS_DC); -int php_oci_lob_read (php_oci_descriptor *, long, long, char **, ub4 * TSRMLS_DC); -int php_oci_lob_write (php_oci_descriptor *, ub4, char *, int, ub4 * TSRMLS_DC); +int php_oci_lob_get_type(php_oci_descriptor *descriptor, php_oci_lob_type *lob_type TSRMLS_DC); +int php_oci_lob_read (php_oci_descriptor *, long, long, zstr *, ub4 * TSRMLS_DC); +int php_oci_lob_write (php_oci_descriptor *, ub4, zstr, 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 *); 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); -int php_oci_lob_write_tmp (php_oci_descriptor *, ub1, char *, int TSRMLS_DC); +int php_oci_lob_write_tmp (php_oci_descriptor *, ub1, zstr, int TSRMLS_DC); #endif void php_oci_lob_free(php_oci_descriptor * TSRMLS_DC); int php_oci_lob_import(php_oci_descriptor *descriptor, char * TSRMLS_DC); @@ -344,51 +354,50 @@ #else sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, ub4 len, ub1 piece); #endif - /* }}} */ /* collection related prototypes {{{ */ -php_oci_collection * php_oci_collection_create(php_oci_connection *, char *, int, char *, int TSRMLS_DC); +php_oci_collection * php_oci_collection_create(php_oci_connection *, zstr, int, zstr, int TSRMLS_DC); int php_oci_collection_size(php_oci_collection *, sb4 * TSRMLS_DC); int php_oci_collection_max(php_oci_collection *, long * TSRMLS_DC); int php_oci_collection_trim(php_oci_collection *, long TSRMLS_DC); -int php_oci_collection_append(php_oci_collection *, char *, int TSRMLS_DC); +int php_oci_collection_append(php_oci_collection *, zstr, int TSRMLS_DC); int php_oci_collection_element_get(php_oci_collection *, long, zval** TSRMLS_DC); -int php_oci_collection_element_set(php_oci_collection *, long, char*, int TSRMLS_DC); +int php_oci_collection_element_set(php_oci_collection *, long, zstr, int TSRMLS_DC); int php_oci_collection_element_set_null(php_oci_collection *, long TSRMLS_DC); -int php_oci_collection_element_set_date(php_oci_collection *, long, char *, int TSRMLS_DC); -int php_oci_collection_element_set_number(php_oci_collection *, long, char *, int TSRMLS_DC); -int php_oci_collection_element_set_string(php_oci_collection *, long, char *, int TSRMLS_DC); +int php_oci_collection_element_set_date(php_oci_collection *, long, zstr, int TSRMLS_DC); +int php_oci_collection_element_set_number(php_oci_collection *, long, zstr, int TSRMLS_DC); +int php_oci_collection_element_set_string(php_oci_collection *, long, zstr, int TSRMLS_DC); int php_oci_collection_assign(php_oci_collection *, php_oci_collection * TSRMLS_DC); void php_oci_collection_close(php_oci_collection * TSRMLS_DC); int php_oci_collection_append_null(php_oci_collection * TSRMLS_DC); -int php_oci_collection_append_date(php_oci_collection *, char *, int TSRMLS_DC); -int php_oci_collection_append_number(php_oci_collection *, char *, int TSRMLS_DC); -int php_oci_collection_append_string(php_oci_collection *, char *, int TSRMLS_DC); +int php_oci_collection_append_date(php_oci_collection *, zstr, int TSRMLS_DC); +int php_oci_collection_append_number(php_oci_collection *, zstr, int TSRMLS_DC); +int php_oci_collection_append_string(php_oci_collection *, zstr, int TSRMLS_DC); /* }}} */ /* statement related prototypes {{{ */ -php_oci_statement * php_oci_statement_create (php_oci_connection *, char *, int TSRMLS_DC); +php_oci_statement * php_oci_statement_create (php_oci_connection *, zstr, int, zend_uchar 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*, int TSRMLS_DC); +php_oci_out_column * php_oci_statement_get_column (php_oci_statement *, long, zstr, 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); int php_oci_bind_pre_exec(void *data TSRMLS_DC); int php_oci_bind_post_exec(void *data TSRMLS_DC); -int php_oci_bind_by_name(php_oci_statement *, char *, int, zval*, long, long TSRMLS_DC); +int php_oci_bind_by_name(php_oci_statement *, zstr, int, zval*, long, long, zend_uchar TSRMLS_DC); sb4 php_oci_bind_in_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 *, ub1 *, dvoid **); sb4 php_oci_bind_out_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 **, ub1 *, dvoid **, ub2 **); php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data); int php_oci_statement_get_type(php_oci_statement *, ub2 * TSRMLS_DC); int php_oci_statement_get_numrows(php_oci_statement *, ub4 * TSRMLS_DC); -int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval* var, long max_table_length, long maxlength, long type TSRMLS_DC); +int php_oci_bind_array_by_name(php_oci_statement *statement, zstr name, int name_len, zval* var, long max_table_length, long maxlength, long type, zend_uchar uni_type TSRMLS_DC); php_oci_bind *php_oci_bind_array_helper_number(zval* var, long max_table_length TSRMLS_DC); php_oci_bind *php_oci_bind_array_helper_double(zval* var, long max_table_length TSRMLS_DC); php_oci_bind *php_oci_bind_array_helper_string(zval* var, long max_table_length, long maxlength TSRMLS_DC); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/array_bind_005.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/array_bind_005.phpt diff -u php-src/ext/oci8/tests/array_bind_005.phpt:1.3 php-src/ext/oci8/tests/array_bind_005.phpt:1.4 --- php-src/ext/oci8/tests/array_bind_005.phpt:1.3 Mon Jul 31 10:28:46 2006 +++ php-src/ext/oci8/tests/array_bind_005.phpt Fri Nov 10 16:56:19 2006 @@ -73,3 +73,18 @@ string(0) "" } Done +--UEXPECTF-- +Warning: oci_execute(): ORA-01405: fetched column value is NULL in %s on line %d +array(5) { + [0]=> + unicode(0) "" + [1]=> + unicode(0) "" + [2]=> + unicode(0) "" + [3]=> + unicode(0) "" + [4]=> + unicode(0) "" +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/array_bind_008.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/oci8/tests/array_bind_008.phpt diff -u php-src/ext/oci8/tests/array_bind_008.phpt:1.2 php-src/ext/oci8/tests/array_bind_008.phpt:1.3 --- php-src/ext/oci8/tests/array_bind_008.phpt:1.2 Thu Dec 8 22:31:55 2005 +++ php-src/ext/oci8/tests/array_bind_008.phpt Fri Nov 10 16:56:19 2006 @@ -76,3 +76,21 @@ string(1) "5" } Done +--UEXPECTF-- +Warning: oci_execute(): ORA-06550: line 1, column 28: +PLS-00418: array bind type must match PL/SQL table row type +ORA-06550: line 1, column 7: +PL/SQL: Statement ignored in %s on line %d +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "2" + [2]=> + unicode(1) "3" + [3]=> + unicode(1) "4" + [4]=> + unicode(1) "5" +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/array_bind_010.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/oci8/tests/array_bind_010.phpt diff -u php-src/ext/oci8/tests/array_bind_010.phpt:1.2 php-src/ext/oci8/tests/array_bind_010.phpt:1.3 --- php-src/ext/oci8/tests/array_bind_010.phpt:1.2 Thu Dec 8 22:31:55 2005 +++ php-src/ext/oci8/tests/array_bind_010.phpt Fri Nov 10 16:56:19 2006 @@ -1,5 +1,5 @@ --TEST-- -oci_bind_array_by_name() and invalid values 8 +oci_bind_array_by_name() and invalid values 10 --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --FILE-- @@ -34,3 +34,18 @@ string(1) "5" } Done +--UEXPECTF-- +Warning: oci_bind_array_by_name(): ORA-01036: illegal variable name/number in %s on line %d +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "2" + [2]=> + unicode(1) "3" + [3]=> + unicode(1) "4" + [4]=> + unicode(1) "5" +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bind_long.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/bind_long.phpt diff -u php-src/ext/oci8/tests/bind_long.phpt:1.4 php-src/ext/oci8/tests/bind_long.phpt:1.5 --- php-src/ext/oci8/tests/bind_long.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/bind_long.phpt Fri Nov 10 16:56:19 2006 @@ -23,7 +23,7 @@ oci_execute($stmt); $row = oci_fetch_row($stmt); -var_dump(md5($row[0])); +var_dump(md5((binary)$row[0])); var_dump(strlen($row[0])); $stmt = oci_parse($c, "drop table phptestlng"); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bind_long_raw.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/bind_long_raw.phpt diff -u php-src/ext/oci8/tests/bind_long_raw.phpt:1.3 php-src/ext/oci8/tests/bind_long_raw.phpt:1.4 --- php-src/ext/oci8/tests/bind_long_raw.phpt:1.3 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/bind_long_raw.phpt Fri Nov 10 16:56:19 2006 @@ -23,7 +23,7 @@ oci_execute($stmt); $row = oci_fetch_row($stmt); -var_dump(md5($row[0])); +var_dump(md5((binary)$row[0])); var_dump(strlen($row[0])); $stmt = oci_parse($c, "drop table phptestlngraw"); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bind_raw.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/bind_raw.phpt diff -u php-src/ext/oci8/tests/bind_raw.phpt:1.3 php-src/ext/oci8/tests/bind_raw.phpt:1.4 --- php-src/ext/oci8/tests/bind_raw.phpt:1.3 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/bind_raw.phpt Fri Nov 10 16:56:19 2006 @@ -24,7 +24,7 @@ oci_execute($stmt); $row = oci_fetch_row($stmt); -var_dump(md5($row[0])); +var_dump(md5((binary)$row[0])); var_dump(strlen($row[0])); $stmt = oci_parse($c, "drop table phptestrawtable"); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bug27303_2.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/bug27303_2.phpt diff -u php-src/ext/oci8/tests/bug27303_2.phpt:1.3 php-src/ext/oci8/tests/bug27303_2.phpt:1.4 --- php-src/ext/oci8/tests/bug27303_2.phpt:1.3 Tue Dec 6 19:26:56 2005 +++ php-src/ext/oci8/tests/bug27303_2.phpt Fri Nov 10 16:56:19 2006 @@ -250,3 +250,204 @@ string(3) "198" string(3) "199" Done +--UEXPECTF-- +unicode(1) "1" +unicode(1) "2" +unicode(1) "3" +unicode(1) "4" +unicode(1) "5" +unicode(1) "6" +unicode(1) "7" +unicode(1) "8" +unicode(1) "9" +unicode(2) "10" +unicode(2) "11" +unicode(2) "12" +unicode(2) "13" +unicode(2) "14" +unicode(2) "15" +unicode(2) "16" +unicode(2) "17" +unicode(2) "18" +unicode(2) "19" +unicode(2) "20" +unicode(2) "21" +unicode(2) "22" +unicode(2) "23" +unicode(2) "24" +unicode(2) "25" +unicode(2) "26" +unicode(2) "27" +unicode(2) "28" +unicode(2) "29" +unicode(2) "30" +unicode(2) "31" +unicode(2) "32" +unicode(2) "33" +unicode(2) "34" +unicode(2) "35" +unicode(2) "36" +unicode(2) "37" +unicode(2) "38" +unicode(2) "39" +unicode(2) "40" +unicode(2) "41" +unicode(2) "42" +unicode(2) "43" +unicode(2) "44" +unicode(2) "45" +unicode(2) "46" +unicode(2) "47" +unicode(2) "48" +unicode(2) "49" +unicode(2) "50" +unicode(2) "51" +unicode(2) "52" +unicode(2) "53" +unicode(2) "54" +unicode(2) "55" +unicode(2) "56" +unicode(2) "57" +unicode(2) "58" +unicode(2) "59" +unicode(2) "60" +unicode(2) "61" +unicode(2) "62" +unicode(2) "63" +unicode(2) "64" +unicode(2) "65" +unicode(2) "66" +unicode(2) "67" +unicode(2) "68" +unicode(2) "69" +unicode(2) "70" +unicode(2) "71" +unicode(2) "72" +unicode(2) "73" +unicode(2) "74" +unicode(2) "75" +unicode(2) "76" +unicode(2) "77" +unicode(2) "78" +unicode(2) "79" +unicode(2) "80" +unicode(2) "81" +unicode(2) "82" +unicode(2) "83" +unicode(2) "84" +unicode(2) "85" +unicode(2) "86" +unicode(2) "87" +unicode(2) "88" +unicode(2) "89" +unicode(2) "90" +unicode(2) "91" +unicode(2) "92" +unicode(2) "93" +unicode(2) "94" +unicode(2) "95" +unicode(2) "96" +unicode(2) "97" +unicode(2) "98" +unicode(2) "99" +unicode(3) "100" +unicode(3) "101" +unicode(3) "102" +unicode(3) "103" +unicode(3) "104" +unicode(3) "105" +unicode(3) "106" +unicode(3) "107" +unicode(3) "108" +unicode(3) "109" +unicode(3) "110" +unicode(3) "111" +unicode(3) "112" +unicode(3) "113" +unicode(3) "114" +unicode(3) "115" +unicode(3) "116" +unicode(3) "117" +unicode(3) "118" +unicode(3) "119" +unicode(3) "120" +unicode(3) "121" +unicode(3) "122" +unicode(3) "123" +unicode(3) "124" +unicode(3) "125" +unicode(3) "126" +unicode(3) "127" +unicode(3) "128" +unicode(3) "129" +unicode(3) "130" +unicode(3) "131" +unicode(3) "132" +unicode(3) "133" +unicode(3) "134" +unicode(3) "135" +unicode(3) "136" +unicode(3) "137" +unicode(3) "138" +unicode(3) "139" +unicode(3) "140" +unicode(3) "141" +unicode(3) "142" +unicode(3) "143" +unicode(3) "144" +unicode(3) "145" +unicode(3) "146" +unicode(3) "147" +unicode(3) "148" +unicode(3) "149" +unicode(3) "150" +unicode(3) "151" +unicode(3) "152" +unicode(3) "153" +unicode(3) "154" +unicode(3) "155" +unicode(3) "156" +unicode(3) "157" +unicode(3) "158" +unicode(3) "159" +unicode(3) "160" +unicode(3) "161" +unicode(3) "162" +unicode(3) "163" +unicode(3) "164" +unicode(3) "165" +unicode(3) "166" +unicode(3) "167" +unicode(3) "168" +unicode(3) "169" +unicode(3) "170" +unicode(3) "171" +unicode(3) "172" +unicode(3) "173" +unicode(3) "174" +unicode(3) "175" +unicode(3) "176" +unicode(3) "177" +unicode(3) "178" +unicode(3) "179" +unicode(3) "180" +unicode(3) "181" +unicode(3) "182" +unicode(3) "183" +unicode(3) "184" +unicode(3) "185" +unicode(3) "186" +unicode(3) "187" +unicode(3) "188" +unicode(3) "189" +unicode(3) "190" +unicode(3) "191" +unicode(3) "192" +unicode(3) "193" +unicode(3) "194" +unicode(3) "195" +unicode(3) "196" +unicode(3) "197" +unicode(3) "198" +unicode(3) "199" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bug27303_4.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/bug27303_4.phpt diff -u php-src/ext/oci8/tests/bug27303_4.phpt:1.3 php-src/ext/oci8/tests/bug27303_4.phpt:1.4 --- php-src/ext/oci8/tests/bug27303_4.phpt:1.3 Tue Dec 6 19:26:56 2005 +++ php-src/ext/oci8/tests/bug27303_4.phpt Fri Nov 10 16:56:19 2006 @@ -250,3 +250,204 @@ string(3) "198" string(3) "199" Done +--UEXPECTF-- +unicode(1) "1" +unicode(1) "2" +unicode(1) "3" +unicode(1) "4" +unicode(1) "5" +unicode(1) "6" +unicode(1) "7" +unicode(1) "8" +unicode(1) "9" +unicode(2) "10" +unicode(2) "11" +unicode(2) "12" +unicode(2) "13" +unicode(2) "14" +unicode(2) "15" +unicode(2) "16" +unicode(2) "17" +unicode(2) "18" +unicode(2) "19" +unicode(2) "20" +unicode(2) "21" +unicode(2) "22" +unicode(2) "23" +unicode(2) "24" +unicode(2) "25" +unicode(2) "26" +unicode(2) "27" +unicode(2) "28" +unicode(2) "29" +unicode(2) "30" +unicode(2) "31" +unicode(2) "32" +unicode(2) "33" +unicode(2) "34" +unicode(2) "35" +unicode(2) "36" +unicode(2) "37" +unicode(2) "38" +unicode(2) "39" +unicode(2) "40" +unicode(2) "41" +unicode(2) "42" +unicode(2) "43" +unicode(2) "44" +unicode(2) "45" +unicode(2) "46" +unicode(2) "47" +unicode(2) "48" +unicode(2) "49" +unicode(2) "50" +unicode(2) "51" +unicode(2) "52" +unicode(2) "53" +unicode(2) "54" +unicode(2) "55" +unicode(2) "56" +unicode(2) "57" +unicode(2) "58" +unicode(2) "59" +unicode(2) "60" +unicode(2) "61" +unicode(2) "62" +unicode(2) "63" +unicode(2) "64" +unicode(2) "65" +unicode(2) "66" +unicode(2) "67" +unicode(2) "68" +unicode(2) "69" +unicode(2) "70" +unicode(2) "71" +unicode(2) "72" +unicode(2) "73" +unicode(2) "74" +unicode(2) "75" +unicode(2) "76" +unicode(2) "77" +unicode(2) "78" +unicode(2) "79" +unicode(2) "80" +unicode(2) "81" +unicode(2) "82" +unicode(2) "83" +unicode(2) "84" +unicode(2) "85" +unicode(2) "86" +unicode(2) "87" +unicode(2) "88" +unicode(2) "89" +unicode(2) "90" +unicode(2) "91" +unicode(2) "92" +unicode(2) "93" +unicode(2) "94" +unicode(2) "95" +unicode(2) "96" +unicode(2) "97" +unicode(2) "98" +unicode(2) "99" +unicode(3) "100" +unicode(3) "101" +unicode(3) "102" +unicode(3) "103" +unicode(3) "104" +unicode(3) "105" +unicode(3) "106" +unicode(3) "107" +unicode(3) "108" +unicode(3) "109" +unicode(3) "110" +unicode(3) "111" +unicode(3) "112" +unicode(3) "113" +unicode(3) "114" +unicode(3) "115" +unicode(3) "116" +unicode(3) "117" +unicode(3) "118" +unicode(3) "119" +unicode(3) "120" +unicode(3) "121" +unicode(3) "122" +unicode(3) "123" +unicode(3) "124" +unicode(3) "125" +unicode(3) "126" +unicode(3) "127" +unicode(3) "128" +unicode(3) "129" +unicode(3) "130" +unicode(3) "131" +unicode(3) "132" +unicode(3) "133" +unicode(3) "134" +unicode(3) "135" +unicode(3) "136" +unicode(3) "137" +unicode(3) "138" +unicode(3) "139" +unicode(3) "140" +unicode(3) "141" +unicode(3) "142" +unicode(3) "143" +unicode(3) "144" +unicode(3) "145" +unicode(3) "146" +unicode(3) "147" +unicode(3) "148" +unicode(3) "149" +unicode(3) "150" +unicode(3) "151" +unicode(3) "152" +unicode(3) "153" +unicode(3) "154" +unicode(3) "155" +unicode(3) "156" +unicode(3) "157" +unicode(3) "158" +unicode(3) "159" +unicode(3) "160" +unicode(3) "161" +unicode(3) "162" +unicode(3) "163" +unicode(3) "164" +unicode(3) "165" +unicode(3) "166" +unicode(3) "167" +unicode(3) "168" +unicode(3) "169" +unicode(3) "170" +unicode(3) "171" +unicode(3) "172" +unicode(3) "173" +unicode(3) "174" +unicode(3) "175" +unicode(3) "176" +unicode(3) "177" +unicode(3) "178" +unicode(3) "179" +unicode(3) "180" +unicode(3) "181" +unicode(3) "182" +unicode(3) "183" +unicode(3) "184" +unicode(3) "185" +unicode(3) "186" +unicode(3) "187" +unicode(3) "188" +unicode(3) "189" +unicode(3) "190" +unicode(3) "191" +unicode(3) "192" +unicode(3) "193" +unicode(3) "194" +unicode(3) "195" +unicode(3) "196" +unicode(3) "197" +unicode(3) "198" +unicode(3) "199" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bug27303.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/bug27303.phpt diff -u php-src/ext/oci8/tests/bug27303.phpt:1.3 php-src/ext/oci8/tests/bug27303.phpt:1.4 --- php-src/ext/oci8/tests/bug27303.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/bug27303.phpt Fri Nov 10 16:56:19 2006 @@ -250,3 +250,204 @@ string(3) "198" string(3) "199" Done +--UEXPECTF-- +unicode(1) "1" +unicode(1) "2" +unicode(1) "3" +unicode(1) "4" +unicode(1) "5" +unicode(1) "6" +unicode(1) "7" +unicode(1) "8" +unicode(1) "9" +unicode(2) "10" +unicode(2) "11" +unicode(2) "12" +unicode(2) "13" +unicode(2) "14" +unicode(2) "15" +unicode(2) "16" +unicode(2) "17" +unicode(2) "18" +unicode(2) "19" +unicode(2) "20" +unicode(2) "21" +unicode(2) "22" +unicode(2) "23" +unicode(2) "24" +unicode(2) "25" +unicode(2) "26" +unicode(2) "27" +unicode(2) "28" +unicode(2) "29" +unicode(2) "30" +unicode(2) "31" +unicode(2) "32" +unicode(2) "33" +unicode(2) "34" +unicode(2) "35" +unicode(2) "36" +unicode(2) "37" +unicode(2) "38" +unicode(2) "39" +unicode(2) "40" +unicode(2) "41" +unicode(2) "42" +unicode(2) "43" +unicode(2) "44" +unicode(2) "45" +unicode(2) "46" +unicode(2) "47" +unicode(2) "48" +unicode(2) "49" +unicode(2) "50" +unicode(2) "51" +unicode(2) "52" +unicode(2) "53" +unicode(2) "54" +unicode(2) "55" +unicode(2) "56" +unicode(2) "57" +unicode(2) "58" +unicode(2) "59" +unicode(2) "60" +unicode(2) "61" +unicode(2) "62" +unicode(2) "63" +unicode(2) "64" +unicode(2) "65" +unicode(2) "66" +unicode(2) "67" +unicode(2) "68" +unicode(2) "69" +unicode(2) "70" +unicode(2) "71" +unicode(2) "72" +unicode(2) "73" +unicode(2) "74" +unicode(2) "75" +unicode(2) "76" +unicode(2) "77" +unicode(2) "78" +unicode(2) "79" +unicode(2) "80" +unicode(2) "81" +unicode(2) "82" +unicode(2) "83" +unicode(2) "84" +unicode(2) "85" +unicode(2) "86" +unicode(2) "87" +unicode(2) "88" +unicode(2) "89" +unicode(2) "90" +unicode(2) "91" +unicode(2) "92" +unicode(2) "93" +unicode(2) "94" +unicode(2) "95" +unicode(2) "96" +unicode(2) "97" +unicode(2) "98" +unicode(2) "99" +unicode(3) "100" +unicode(3) "101" +unicode(3) "102" +unicode(3) "103" +unicode(3) "104" +unicode(3) "105" +unicode(3) "106" +unicode(3) "107" +unicode(3) "108" +unicode(3) "109" +unicode(3) "110" +unicode(3) "111" +unicode(3) "112" +unicode(3) "113" +unicode(3) "114" +unicode(3) "115" +unicode(3) "116" +unicode(3) "117" +unicode(3) "118" +unicode(3) "119" +unicode(3) "120" +unicode(3) "121" +unicode(3) "122" +unicode(3) "123" +unicode(3) "124" +unicode(3) "125" +unicode(3) "126" +unicode(3) "127" +unicode(3) "128" +unicode(3) "129" +unicode(3) "130" +unicode(3) "131" +unicode(3) "132" +unicode(3) "133" +unicode(3) "134" +unicode(3) "135" +unicode(3) "136" +unicode(3) "137" +unicode(3) "138" +unicode(3) "139" +unicode(3) "140" +unicode(3) "141" +unicode(3) "142" +unicode(3) "143" +unicode(3) "144" +unicode(3) "145" +unicode(3) "146" +unicode(3) "147" +unicode(3) "148" +unicode(3) "149" +unicode(3) "150" +unicode(3) "151" +unicode(3) "152" +unicode(3) "153" +unicode(3) "154" +unicode(3) "155" +unicode(3) "156" +unicode(3) "157" +unicode(3) "158" +unicode(3) "159" +unicode(3) "160" +unicode(3) "161" +unicode(3) "162" +unicode(3) "163" +unicode(3) "164" +unicode(3) "165" +unicode(3) "166" +unicode(3) "167" +unicode(3) "168" +unicode(3) "169" +unicode(3) "170" +unicode(3) "171" +unicode(3) "172" +unicode(3) "173" +unicode(3) "174" +unicode(3) "175" +unicode(3) "176" +unicode(3) "177" +unicode(3) "178" +unicode(3) "179" +unicode(3) "180" +unicode(3) "181" +unicode(3) "182" +unicode(3) "183" +unicode(3) "184" +unicode(3) "185" +unicode(3) "186" +unicode(3) "187" +unicode(3) "188" +unicode(3) "189" +unicode(3) "190" +unicode(3) "191" +unicode(3) "192" +unicode(3) "193" +unicode(3) "194" +unicode(3) "195" +unicode(3) "196" +unicode(3) "197" +unicode(3) "198" +unicode(3) "199" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bug35973.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/bug35973.phpt diff -u php-src/ext/oci8/tests/bug35973.phpt:1.1 php-src/ext/oci8/tests/bug35973.phpt:1.2 --- php-src/ext/oci8/tests/bug35973.phpt:1.1 Wed Aug 9 15:23:50 2006 +++ php-src/ext/oci8/tests/bug35973.phpt Fri Nov 10 16:56:19 2006 @@ -41,3 +41,14 @@ string(%d) "%s5" string(%d) "%sa" Done +--UEXPECTF-- +array(1) { + [u"NC"]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +unicode(%d) "%s5" +unicode(%d) "%sa" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bug36096.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/bug36096.phpt diff -u php-src/ext/oci8/tests/bug36096.phpt:1.3 php-src/ext/oci8/tests/bug36096.phpt:1.4 --- php-src/ext/oci8/tests/bug36096.phpt:1.3 Tue Jan 31 18:39:50 2006 +++ php-src/ext/oci8/tests/bug36096.phpt Fri Nov 10 16:56:19 2006 @@ -26,3 +26,9 @@ string(5) "'ABC'" string(4) "CHAR" Done +--UEXPECT-- +bool(false) +bool(false) +unicode(5) "'ABC'" +unicode(4) "CHAR" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_011_func.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_011_func.phpt diff -u php-src/ext/oci8/tests/coll_011_func.phpt:1.3 php-src/ext/oci8/tests/coll_011_func.phpt:1.4 --- php-src/ext/oci8/tests/coll_011_func.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_011_func.phpt Fri Nov 10 16:56:19 2006 @@ -41,3 +41,9 @@ bool(true) string(6) "string" Done +--UEXPECT-- +bool(true) +bool(true) +bool(true) +unicode(6) "string" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_011.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_011.phpt diff -u php-src/ext/oci8/tests/coll_011.phpt:1.3 php-src/ext/oci8/tests/coll_011.phpt:1.4 --- php-src/ext/oci8/tests/coll_011.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_011.phpt Fri Nov 10 16:56:19 2006 @@ -41,3 +41,9 @@ bool(true) string(6) "string" Done +--UEXPECT-- +bool(true) +bool(true) +bool(true) +unicode(6) "string" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_012_func.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_012_func.phpt diff -u php-src/ext/oci8/tests/coll_012_func.phpt:1.3 php-src/ext/oci8/tests/coll_012_func.phpt:1.4 --- php-src/ext/oci8/tests/coll_012_func.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_012_func.phpt Fri Nov 10 16:56:19 2006 @@ -39,3 +39,8 @@ bool(true) string(9) "28-JUL-05" Done +--UEXPECT-- +bool(true) +bool(true) +unicode(9) "28-JUL-05" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_012.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_012.phpt diff -u php-src/ext/oci8/tests/coll_012.phpt:1.3 php-src/ext/oci8/tests/coll_012.phpt:1.4 --- php-src/ext/oci8/tests/coll_012.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_012.phpt Fri Nov 10 16:56:19 2006 @@ -39,3 +39,8 @@ bool(true) string(9) "28-JUL-05" Done +--UEXPECT-- +bool(true) +bool(true) +unicode(9) "28-JUL-05" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_013_func.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_013_func.phpt diff -u php-src/ext/oci8/tests/coll_013_func.phpt:1.3 php-src/ext/oci8/tests/coll_013_func.phpt:1.4 --- php-src/ext/oci8/tests/coll_013_func.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_013_func.phpt Fri Nov 10 16:56:19 2006 @@ -36,3 +36,8 @@ bool(true) string(9) "01-JAN-05" Done +--UEXPECT-- +bool(true) +bool(true) +unicode(9) "01-JAN-05" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_013.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_013.phpt diff -u php-src/ext/oci8/tests/coll_013.phpt:1.3 php-src/ext/oci8/tests/coll_013.phpt:1.4 --- php-src/ext/oci8/tests/coll_013.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_013.phpt Fri Nov 10 16:56:19 2006 @@ -36,3 +36,8 @@ bool(true) string(9) "01-JAN-05" Done +--UEXPECT-- +bool(true) +bool(true) +unicode(9) "01-JAN-05" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_014_func.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_014_func.phpt diff -u php-src/ext/oci8/tests/coll_014_func.phpt:1.3 php-src/ext/oci8/tests/coll_014_func.phpt:1.4 --- php-src/ext/oci8/tests/coll_014_func.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_014_func.phpt Fri Nov 10 16:56:19 2006 @@ -36,3 +36,8 @@ bool(true) string(4) "blah" Done +--UEXPECT-- +bool(true) +bool(true) +unicode(4) "blah" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_014.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_014.phpt diff -u php-src/ext/oci8/tests/coll_014.phpt:1.3 php-src/ext/oci8/tests/coll_014.phpt:1.4 --- php-src/ext/oci8/tests/coll_014.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_014.phpt Fri Nov 10 16:56:19 2006 @@ -36,3 +36,8 @@ bool(true) string(4) "blah" Done +--UEXPECT-- +bool(true) +bool(true) +unicode(4) "blah" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/commit_old.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/commit_old.phpt diff -u php-src/ext/oci8/tests/commit_old.phpt:1.4 php-src/ext/oci8/tests/commit_old.phpt:1.5 --- php-src/ext/oci8/tests/commit_old.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/commit_old.phpt Fri Nov 10 16:56:19 2006 @@ -170,24 +170,24 @@ [u"ID"]=> array(4) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" [3]=> - string(1) "1" + unicode(1) "1" } [u"VALUE"]=> array(4) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" [3]=> - string(1) "1" + unicode(1) "1" } [u"BLOB"]=> array(4) { http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/commit.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/commit.phpt diff -u php-src/ext/oci8/tests/commit.phpt:1.4 php-src/ext/oci8/tests/commit.phpt:1.5 --- php-src/ext/oci8/tests/commit.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/commit.phpt Fri Nov 10 16:56:19 2006 @@ -172,24 +172,24 @@ [u"ID"]=> array(4) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" [3]=> - string(1) "1" + unicode(1) "1" } [u"VALUE"]=> array(4) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" [3]=> - string(1) "1" + unicode(1) "1" } [u"BLOB"]=> array(4) { http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/cursor_bind.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/oci8/tests/cursor_bind.phpt diff -u php-src/ext/oci8/tests/cursor_bind.phpt:1.2 php-src/ext/oci8/tests/cursor_bind.phpt:1.3 --- php-src/ext/oci8/tests/cursor_bind.phpt:1.2 Wed Dec 21 11:43:23 2005 +++ php-src/ext/oci8/tests/cursor_bind.phpt Fri Nov 10 16:56:19 2006 @@ -97,3 +97,24 @@ } bool(false) Done +--UEXPECT-- +array(2) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" +} +array(2) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" +} +array(2) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" +} +bool(false) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/cursors_old.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/cursors_old.phpt diff -u php-src/ext/oci8/tests/cursors_old.phpt:1.4 php-src/ext/oci8/tests/cursors_old.phpt:1.5 --- php-src/ext/oci8/tests/cursors_old.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/cursors_old.phpt Fri Nov 10 16:56:19 2006 @@ -65,18 +65,18 @@ --UEXPECTF-- array(2) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } bool(true) Warning: ocifetchinto(): ORA-01002: fetch out of sequence in %s on line %d array(2) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } bool(true) Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/cursors.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/cursors.phpt diff -u php-src/ext/oci8/tests/cursors.phpt:1.5 php-src/ext/oci8/tests/cursors.phpt:1.6 --- php-src/ext/oci8/tests/cursors.phpt:1.5 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/cursors.phpt Fri Nov 10 16:56:19 2006 @@ -66,9 +66,9 @@ --UEXPECTF-- array(5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/define1.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/define1.phpt diff -u php-src/ext/oci8/tests/define1.phpt:1.1 php-src/ext/oci8/tests/define1.phpt:1.2 --- php-src/ext/oci8/tests/define1.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/define1.phpt Fri Nov 10 16:56:19 2006 @@ -50,3 +50,14 @@ NULL string(4) "some" Done +--UEXPECTF-- +bool(true) +bool(false) + +Warning: oci_define_by_name(): Column name cannot be empty in %s on line %d +bool(false) + +Warning: oci_define_by_name() expects at least 3 parameters, 2 given in %s on line %d +NULL +unicode(4) "some" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/define_old.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/define_old.phpt diff -u php-src/ext/oci8/tests/define_old.phpt:1.3 php-src/ext/oci8/tests/define_old.phpt:1.4 --- php-src/ext/oci8/tests/define_old.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/define_old.phpt Fri Nov 10 16:56:19 2006 @@ -39,3 +39,6 @@ --EXPECT-- string(4) "some" Done +--UEXPECT-- +unicode(4) "some" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/define.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/define.phpt diff -u php-src/ext/oci8/tests/define.phpt:1.3 php-src/ext/oci8/tests/define.phpt:1.4 --- php-src/ext/oci8/tests/define.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/define.phpt Fri Nov 10 16:56:19 2006 @@ -39,3 +39,6 @@ --EXPECT-- string(4) "some" Done +--UEXPECT-- +unicode(4) "some" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/error1.phpt?r1=1.6&r2=1.7&diff_format=u Index: php-src/ext/oci8/tests/error1.phpt diff -u php-src/ext/oci8/tests/error1.phpt:1.6 php-src/ext/oci8/tests/error1.phpt:1.7 --- php-src/ext/oci8/tests/error1.phpt:1.6 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/error1.phpt Fri Nov 10 16:56:19 2006 @@ -25,17 +25,3 @@ string(0) "" } Done ---UEXPECTF-- -Warning: oci_connect(): ORA-12154: TNS:could not resolve service name in %s on line %d -bool(false) -array(4) { - [u"code"]=> - int(12154) - [u"message"]=> - string(45) "ORA-12154: TNS:could not resolve service name" - [u"offset"]=> - int(0) - [u"sqltext"]=> - string(0) "" -} -Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/error_old.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/error_old.phpt diff -u php-src/ext/oci8/tests/error_old.phpt:1.4 php-src/ext/oci8/tests/error_old.phpt:1.5 --- php-src/ext/oci8/tests/error_old.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/error_old.phpt Fri Nov 10 16:56:19 2006 @@ -45,13 +45,13 @@ Warning: ociexecute(): ORA-00900: invalid SQL statement in %s on line %d bool(false) array(4) { - [u"code"]=> + ["code"]=> int(900) - [u"message"]=> - string(32) "ORA-00900: invalid SQL statement" - [u"offset"]=> + ["message"]=> + unicode(32) "ORA-00900: invalid SQL statement" + ["offset"]=> int(0) - [u"sqltext"]=> - string(12) "WRONG SYNTAX" + ["sqltext"]=> + unicode(12) "WRONG SYNTAX" } Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/error.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/error.phpt diff -u php-src/ext/oci8/tests/error.phpt:1.4 php-src/ext/oci8/tests/error.phpt:1.5 --- php-src/ext/oci8/tests/error.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/error.phpt Fri Nov 10 16:56:19 2006 @@ -45,13 +45,13 @@ Warning: oci_execute(): ORA-00900: invalid SQL statement in %s on line %d bool(false) array(4) { - [u"code"]=> + ["code"]=> int(900) - [u"message"]=> - string(32) "ORA-00900: invalid SQL statement" - [u"offset"]=> + ["message"]=> + unicode(32) "ORA-00900: invalid SQL statement" + ["offset"]=> int(0) - [u"sqltext"]=> - string(12) "WRONG SYNTAX" + ["sqltext"]=> + unicode(12) "WRONG SYNTAX" } Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_all.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/fetch_all.phpt diff -u php-src/ext/oci8/tests/fetch_all.phpt:1.4 php-src/ext/oci8/tests/fetch_all.phpt:1.5 --- php-src/ext/oci8/tests/fetch_all.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/fetch_all.phpt Fri Nov 10 16:56:19 2006 @@ -153,20 +153,20 @@ [u"ID"]=> array(3) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" } [u"VALUE"]=> array(3) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" } [u"BLOB"]=> array(3) { @@ -201,20 +201,20 @@ [u"ID"]=> array(3) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" } [u"VALUE"]=> array(3) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" } [u"BLOB"]=> array(3) { http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_array.phpt?r1=1.6&r2=1.7&diff_format=u Index: php-src/ext/oci8/tests/fetch_array.phpt diff -u php-src/ext/oci8/tests/fetch_array.phpt:1.6 php-src/ext/oci8/tests/fetch_array.phpt:1.7 --- php-src/ext/oci8/tests/fetch_array.phpt:1.6 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/fetch_array.phpt Fri Nov 10 16:56:19 2006 @@ -309,13 +309,13 @@ --UEXPECT-- array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -331,13 +331,13 @@ } array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -353,13 +353,13 @@ } array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -375,109 +375,109 @@ } array(2) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" } array(2) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" } array(2) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" } array(2) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(2) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(2) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -493,13 +493,13 @@ } array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -515,13 +515,13 @@ } array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_assoc.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/fetch_assoc.phpt diff -u php-src/ext/oci8/tests/fetch_assoc.phpt:1.5 php-src/ext/oci8/tests/fetch_assoc.phpt:1.6 --- php-src/ext/oci8/tests/fetch_assoc.phpt:1.5 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/fetch_assoc.phpt Fri Nov 10 16:56:19 2006 @@ -83,9 +83,9 @@ --UEXPECT-- array(5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> @@ -95,9 +95,9 @@ } array(5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> @@ -107,9 +107,9 @@ } array(5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_into1.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/fetch_into1.phpt diff -u php-src/ext/oci8/tests/fetch_into1.phpt:1.4 php-src/ext/oci8/tests/fetch_into1.phpt:1.5 --- php-src/ext/oci8/tests/fetch_into1.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/fetch_into1.phpt Fri Nov 10 16:56:19 2006 @@ -194,23 +194,23 @@ int(5) array(2) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" } int(5) array(2) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } int(5) array(5) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [3]=> @@ -221,31 +221,31 @@ int(5) array(2) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" } int(5) array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } int(5) array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -262,13 +262,13 @@ int(5) array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -285,9 +285,9 @@ int(5) array(5) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [3]=> @@ -298,9 +298,9 @@ int(5) array(5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> @@ -311,9 +311,9 @@ int(5) array(5) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [3]=> http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_into2.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/fetch_into2.phpt diff -u php-src/ext/oci8/tests/fetch_into2.phpt:1.3 php-src/ext/oci8/tests/fetch_into2.phpt:1.4 --- php-src/ext/oci8/tests/fetch_into2.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/fetch_into2.phpt Fri Nov 10 16:56:19 2006 @@ -68,3 +68,25 @@ string(1) "1" } Done +--UEXPECTF-- +Warning: ocifetchinto() expects at least 2 parameters, 1 given in %s on line %d +NULL + +Notice: Undefined variable: all in %s on line %d +NULL + +Warning: ocifetchinto() expects at most 3 parameters, 4 given in %s on line %d +NULL +NULL + +Warning: ocifetchinto(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) +NULL +int(5) +array(2) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_into.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/fetch_into.phpt diff -u php-src/ext/oci8/tests/fetch_into.phpt:1.4 php-src/ext/oci8/tests/fetch_into.phpt:1.5 --- php-src/ext/oci8/tests/fetch_into.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/fetch_into.phpt Fri Nov 10 16:56:19 2006 @@ -84,20 +84,20 @@ int(5) array(2) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" } int(5) array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_object.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/fetch_object.phpt diff -u php-src/ext/oci8/tests/fetch_object.phpt:1.5 php-src/ext/oci8/tests/fetch_object.phpt:1.6 --- php-src/ext/oci8/tests/fetch_object.phpt:1.5 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/fetch_object.phpt Fri Nov 10 16:56:19 2006 @@ -83,9 +83,9 @@ --UEXPECTF-- object(stdClass)#%d (5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> @@ -95,9 +95,9 @@ } object(stdClass)#%d (5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> @@ -107,9 +107,9 @@ } object(stdClass)#%d (5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/fetch.phpt diff -u php-src/ext/oci8/tests/fetch.phpt:1.3 php-src/ext/oci8/tests/fetch.phpt:1.4 --- php-src/ext/oci8/tests/fetch.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/fetch.phpt Fri Nov 10 16:56:19 2006 @@ -54,3 +54,11 @@ string(1) "1" string(1) "1" Done +--UEXPECT-- +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_row.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/fetch_row.phpt diff -u php-src/ext/oci8/tests/fetch_row.phpt:1.4 php-src/ext/oci8/tests/fetch_row.phpt:1.5 --- php-src/ext/oci8/tests/fetch_row.phpt:1.4 Tue Mar 28 09:13:35 2006 +++ php-src/ext/oci8/tests/fetch_row.phpt Fri Nov 10 16:56:19 2006 @@ -80,3 +80,41 @@ NULL } Done +--UEXPECT-- +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/field_funcs1.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/field_funcs1.phpt diff -u php-src/ext/oci8/tests/field_funcs1.phpt:1.3 php-src/ext/oci8/tests/field_funcs1.phpt:1.4 --- php-src/ext/oci8/tests/field_funcs1.phpt:1.3 Thu May 18 13:20:00 2006 +++ php-src/ext/oci8/tests/field_funcs1.phpt Fri Nov 10 16:56:19 2006 @@ -177,3 +177,104 @@ Warning: oci_field_size() expects exactly 2 parameters, 1 given in %s on line %d bool(false) Done +--UEXPECTF-- +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} + +Warning: oci_field_is_null(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_name(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_type(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_type_raw(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_scale(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_precision(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_size(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_is_null(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_name(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_type(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_type_raw(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_scale(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_precision(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_size(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_is_null(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_name(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_type(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_type_raw(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_scale(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_precision(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_size(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_is_null(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_name(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_type(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_type_raw(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_scale(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_precision(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_size(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_size() expects exactly 2 parameters, 1 given in %s on line %d +bool(false) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/field_funcs_old.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/field_funcs_old.phpt diff -u php-src/ext/oci8/tests/field_funcs_old.phpt:1.5 php-src/ext/oci8/tests/field_funcs_old.phpt:1.6 --- php-src/ext/oci8/tests/field_funcs_old.phpt:1.5 Tue May 30 22:37:08 2006 +++ php-src/ext/oci8/tests/field_funcs_old.phpt Fri Nov 10 16:56:19 2006 @@ -103,3 +103,52 @@ int(0) int(10) Done +--UEXPECTF-- +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +bool(false) +unicode(2) "ID" +unicode(6) "NUMBER" +int(2) +int(0) +int(0) +int(22) +bool(false) +unicode(5) "VALUE" +unicode(6) "NUMBER" +int(2) +int(0) +int(0) +int(22) +bool(true) +unicode(4) "BLOB" +unicode(4) "BLOB" +int(113) +int(0) +int(0) +int(4000) +bool(true) +unicode(4) "CLOB" +unicode(4) "CLOB" +int(112) +int(0) +int(0) +int(4000) +bool(true) +unicode(6) "STRING" +unicode(8) "VARCHAR2" +int(1) +int(0) +int(0) +int(10) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/field_funcs.phpt?r1=1.6&r2=1.7&diff_format=u Index: php-src/ext/oci8/tests/field_funcs.phpt diff -u php-src/ext/oci8/tests/field_funcs.phpt:1.6 php-src/ext/oci8/tests/field_funcs.phpt:1.7 --- php-src/ext/oci8/tests/field_funcs.phpt:1.6 Tue May 30 22:37:08 2006 +++ php-src/ext/oci8/tests/field_funcs.phpt Fri Nov 10 16:56:19 2006 @@ -103,3 +103,52 @@ int(0) int(10) Done +--UEXPECTF-- +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +bool(false) +unicode(2) "ID" +unicode(6) "NUMBER" +int(2) +int(0) +int(0) +int(22) +bool(false) +unicode(5) "VALUE" +unicode(6) "NUMBER" +int(2) +int(0) +int(0) +int(22) +bool(true) +unicode(4) "BLOB" +unicode(4) "BLOB" +int(113) +int(0) +int(0) +int(4000) +bool(true) +unicode(4) "CLOB" +unicode(4) "CLOB" +int(112) +int(0) +int(0) +int(4000) +bool(true) +unicode(6) "STRING" +unicode(8) "VARCHAR2" +int(1) +int(0) +int(0) +int(10) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_001.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/lob_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_002.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_002.phpt diff -u php-src/ext/oci8/tests/lob_002.phpt:1.4 php-src/ext/oci8/tests/lob_002.phpt:1.5 --- php-src/ext/oci8/tests/lob_002.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_002.phpt Fri Nov 10 16:56:19 2006 @@ -22,12 +22,12 @@ var_dump($blob); -var_dump($blob->write("test", -1)); -var_dump($blob->write("test", "str")); -var_dump($blob->write("test", 1000000)); -var_dump($blob->write(str_repeat("test", 10000), 1000000)); +var_dump($blob->write(b"test", -1)); +var_dump($blob->write(b"test", "str")); +var_dump($blob->write(b"test", 1000000)); +var_dump($blob->write((binary)str_repeat("test", 10000), 1000000)); var_dump($blob->tell()); -var_dump($blob->seek("str", -5)); +var_dump($blob->seek(b"str", -5)); var_dump($blob->flush()); oci_commit($c); @@ -77,7 +77,7 @@ int(40000) int(40004) -Warning: OCI-Lob::seek() expects parameter 1 to be long, Unicode string given in %s on line %d +Warning: OCI-Lob::seek() expects parameter 1 to be long, binary string given in %s on line %d NULL bool(false) int(40004) http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_003.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_003.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_004.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_004.phpt diff -u php-src/ext/oci8/tests/lob_004.phpt:1.4 php-src/ext/oci8/tests/lob_004.phpt:1.5 --- php-src/ext/oci8/tests/lob_004.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_004.phpt Fri Nov 10 16:56:19 2006 @@ -22,9 +22,9 @@ var_dump($blob); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump($blob->rewind()); -var_dump($blob->write("str")); +var_dump($blob->write(b"str")); var_dump($blob->seek(10, OCI_SEEK_SET)); oci_commit($c); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_006.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_006.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_007.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_007.phpt diff -u php-src/ext/oci8/tests/lob_007.phpt:1.4 php-src/ext/oci8/tests/lob_007.phpt:1.5 --- php-src/ext/oci8/tests/lob_007.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_007.phpt Fri Nov 10 16:56:19 2006 @@ -23,7 +23,7 @@ var_dump($blob); var_dump($blob->size()); -var_dump($blob->write(str_repeat("string.", 1000))); +var_dump($blob->write((binary)str_repeat("string.", 1000))); var_dump($blob->size()); oci_commit($c); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_008.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_008.phpt diff -u php-src/ext/oci8/tests/lob_008.phpt:1.4 php-src/ext/oci8/tests/lob_008.phpt:1.5 --- php-src/ext/oci8/tests/lob_008.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_008.phpt Fri Nov 10 16:56:19 2006 @@ -22,7 +22,7 @@ var_dump($blob); -var_dump($blob->write(str_repeat("string.", 1000))); +var_dump($blob->write((binary)str_repeat("string.", 1000))); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_010.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_010.phpt diff -u php-src/ext/oci8/tests/lob_010.phpt:1.3 php-src/ext/oci8/tests/lob_010.phpt:1.4 --- php-src/ext/oci8/tests/lob_010.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_010.phpt Fri Nov 10 16:56:19 2006 @@ -20,8 +20,8 @@ oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); -var_dump($blob->save("string")); -var_dump($blob->save("string", 3)); +var_dump($blob->save(b"string")); +var_dump($blob->save(b"string", 3)); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_011.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/lob_011.phpt diff -u php-src/ext/oci8/tests/lob_011.phpt:1.5 php-src/ext/oci8/tests/lob_011.phpt:1.6 --- php-src/ext/oci8/tests/lob_011.phpt:1.5 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_011.phpt Fri Nov 10 16:56:19 2006 @@ -20,7 +20,7 @@ oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); -var_dump($blob->write("some string here. string, I said")); +var_dump($blob->write(b"some string here. string, I said")); oci_commit($c); $ora_sql = "INSERT INTO http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_012.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_012.phpt diff -u php-src/ext/oci8/tests/lob_012.phpt:1.3 php-src/ext/oci8/tests/lob_012.phpt:1.4 --- php-src/ext/oci8/tests/lob_012.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_012.phpt Fri Nov 10 16:56:19 2006 @@ -22,7 +22,7 @@ $blob; -var_dump($blob->write("test string is here\nnew string")); +var_dump($blob->write(b"test string is here\nnew string")); oci_commit($c); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_013.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_013.phpt diff -u php-src/ext/oci8/tests/lob_013.phpt:1.3 php-src/ext/oci8/tests/lob_013.phpt:1.4 --- php-src/ext/oci8/tests/lob_013.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_013.phpt Fri Nov 10 16:56:19 2006 @@ -20,10 +20,10 @@ oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump($blob->getBuffering()); var_dump($blob->setBuffering(true)); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump($blob->getBuffering()); var_dump($blob->flush()); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_014.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_014.phpt diff -u php-src/ext/oci8/tests/lob_014.phpt:1.3 php-src/ext/oci8/tests/lob_014.phpt:1.4 --- php-src/ext/oci8/tests/lob_014.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_014.phpt Fri Nov 10 16:56:19 2006 @@ -22,11 +22,11 @@ $blob; -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump($blob->close()); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump($blob->free()); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); oci_commit($c); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_016.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_016.phpt diff -u php-src/ext/oci8/tests/lob_016.phpt:1.4 php-src/ext/oci8/tests/lob_016.phpt:1.5 --- php-src/ext/oci8/tests/lob_016.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_016.phpt Fri Nov 10 16:56:19 2006 @@ -25,8 +25,8 @@ $row = oci_fetch_assoc($statement); -$row['LOB_1']->write("first"); -$row['LOB_2']->write("second"); +$row['LOB_1']->write(b"first"); +$row['LOB_2']->write(b"second"); unset($row); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_017.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_017.phpt diff -u php-src/ext/oci8/tests/lob_017.phpt:1.4 php-src/ext/oci8/tests/lob_017.phpt:1.5 --- php-src/ext/oci8/tests/lob_017.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_017.phpt Fri Nov 10 16:56:19 2006 @@ -27,8 +27,8 @@ $row = oci_fetch_assoc($statement); -$row['LOB_1']->write("first"); -$row['LOB_2']->write("second"); +$row['LOB_1']->write(b"first"); +$row['LOB_2']->write(b"second"); unset($row); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_018.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_018.phpt diff -u php-src/ext/oci8/tests/lob_018.phpt:1.3 php-src/ext/oci8/tests/lob_018.phpt:1.4 --- php-src/ext/oci8/tests/lob_018.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_018.phpt Fri Nov 10 16:56:19 2006 @@ -65,3 +65,9 @@ string(9) "long data" string(4) "data" Done +--UEXPECTF-- +unicode(4) "data" +unicode(9) "long data" +unicode(9) "long data" +unicode(4) "data" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_019.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_019.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_020.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_020.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_021.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/lob_021.phpt diff -u php-src/ext/oci8/tests/lob_021.phpt:1.1 php-src/ext/oci8/tests/lob_021.phpt:1.2 --- php-src/ext/oci8/tests/lob_021.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/lob_021.phpt Fri Nov 10 16:56:19 2006 @@ -20,13 +20,11 @@ oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); -$blob; - -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump($blob->close()); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump(oci_free_descriptor($blob)); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump(oci_free_descriptor($blob)); var_dump(oci_free_descriptor(new stdclass)); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_022.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/lob_022.phpt diff -u php-src/ext/oci8/tests/lob_022.phpt:1.1 php-src/ext/oci8/tests/lob_022.phpt:1.2 --- php-src/ext/oci8/tests/lob_022.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/lob_022.phpt Fri Nov 10 16:56:19 2006 @@ -78,3 +78,16 @@ string(9) "long data" string(4) "data" Done +--UEXPECTF-- +Warning: OCI-Lob::save() expects at least 1 parameter, 0 given in %s on line %d + +Warning: oci_lob_save() expects at least 2 parameters, 0 given in %s on line %d + +Warning: oci_lob_save(): Unable to find descriptor property in %s on line %d + +Warning: OCI-Lob::save(): Offset parameter must be greater than or equal to 0 in %s on line %d +unicode(4) "data" +unicode(9) "long data" +unicode(9) "long data" +unicode(4) "data" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_023.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/lob_023.phpt diff -u php-src/ext/oci8/tests/lob_023.phpt:1.1 php-src/ext/oci8/tests/lob_023.phpt:1.2 --- php-src/ext/oci8/tests/lob_023.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/lob_023.phpt Fri Nov 10 16:56:19 2006 @@ -82,3 +82,40 @@ test lob_009.phpt " Done +--UEXPECTF-- +object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) +} +bool(true) +bool(true) + +Warning: OCI-Lob::import() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: oci_lob_import() expects exactly 2 parameters, 1 given in %s on line %d +NULL +bool(true) + +Warning: oci_lob_import(): Unable to find descriptor property in %s on line %d +bool(false) +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + [u"BLOB"]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +string(43) "this +is +a +test +file for +test lob_009.phpt +" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_024.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/lob_024.phpt diff -u php-src/ext/oci8/tests/lob_024.phpt:1.1 php-src/ext/oci8/tests/lob_024.phpt:1.2 --- php-src/ext/oci8/tests/lob_024.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/lob_024.phpt Fri Nov 10 16:56:19 2006 @@ -23,7 +23,7 @@ var_dump($blob); var_dump($blob->size()); -var_dump($blob->write(str_repeat("string.", 1000))); +var_dump($blob->write((binary)str_repeat("string.", 1000))); var_dump($blob->size()); oci_commit($c); @@ -73,3 +73,32 @@ Warning: oci_lob_load(): Unable to find descriptor property in %s on line %d bool(false) Done +--UEXPECTF-- +object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) +} +int(0) +int(7000) +int(7000) +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + [u"BLOB"]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +int(7000) +int(7000) + +Warning: oci_lob_load() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: oci_lob_load(): Unable to find descriptor property in %s on line %d +bool(false) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_025.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/lob_025.phpt diff -u php-src/ext/oci8/tests/lob_025.phpt:1.1 php-src/ext/oci8/tests/lob_025.phpt:1.2 --- php-src/ext/oci8/tests/lob_025.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/lob_025.phpt Fri Nov 10 16:56:19 2006 @@ -21,7 +21,7 @@ oci_execute($statement, OCI_DEFAULT); var_dump($blob->size()); -var_dump($blob->write(str_repeat("string.", 1000))); +var_dump($blob->write((binary)str_repeat("string.", 1000))); var_dump($blob->size()); oci_commit($c); @@ -80,3 +80,37 @@ Warning: oci_lob_eof(): Unable to find descriptor property in %s on line %d bool(false) Done +--UEXPECTF-- +int(0) +int(7000) +int(7000) +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + [u"BLOB"]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +string(2) "st" + +Warning: oci_lob_read() expects exactly 2 parameters, 1 given in %s on line %d +NULL + +Warning: oci_lob_read() expects exactly 2 parameters, 0 given in %s on line %d +NULL +bool(false) + +Warning: oci_lob_eof() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: oci_lob_read(): Unable to find descriptor property in %s on line %d +bool(false) + +Warning: oci_lob_eof(): Unable to find descriptor property in %s on line %d +bool(false) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_026.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/lob_026.phpt diff -u php-src/ext/oci8/tests/lob_026.phpt:1.1 php-src/ext/oci8/tests/lob_026.phpt:1.2 --- php-src/ext/oci8/tests/lob_026.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/lob_026.phpt Fri Nov 10 16:56:19 2006 @@ -22,10 +22,10 @@ var_dump($blob); -var_dump(oci_lob_write($blob, "test")); +var_dump(oci_lob_write($blob, b"test")); var_dump(oci_lob_rewind()); var_dump(oci_lob_rewind($blob)); -var_dump(oci_lob_write($blob, "str")); +var_dump(oci_lob_write($blob, b"str")); var_dump(oci_lob_seek(10, OCI_SEEK_SET)); var_dump(oci_lob_seek($blob, 10, OCI_SEEK_SET)); @@ -98,3 +98,43 @@ string(4) "strt" string(8) "strtstrt" Done +--UEXPECTF-- +object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) +} +int(4) + +Warning: oci_lob_rewind() expects exactly 1 parameter, 0 given in %s on line %d +NULL +bool(true) +int(3) + +Warning: oci_lob_seek() expects parameter 1 to be OCI-Lob, integer given in %s on line %d +NULL +bool(true) +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + [u"BLOB"]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} + +Warning: oci_lob_append() expects exactly 2 parameters, 0 given in %s on line %d +NULL + +Warning: oci_lob_append() expects exactly 2 parameters, 1 given in %s on line %d +NULL +bool(true) + +Warning: oci_lob_read() expects exactly 2 parameters, 1 given in %s on line %d +NULL +string(4) "strt" +string(8) "strtstrt" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_temp1.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_temp1.phpt diff -u php-src/ext/oci8/tests/lob_temp1.phpt:1.3 php-src/ext/oci8/tests/lob_temp1.phpt:1.4 --- php-src/ext/oci8/tests/lob_temp1.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_temp1.phpt Fri Nov 10 16:56:19 2006 @@ -30,3 +30,11 @@ string(4) "test" bool(true) Done +--UEXPECTF-- +bool(true) +unicode(4) "test" +bool(true) +bool(true) +unicode(4) "test" +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_temp.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_temp.phpt diff -u php-src/ext/oci8/tests/lob_temp.phpt:1.3 php-src/ext/oci8/tests/lob_temp.phpt:1.4 --- php-src/ext/oci8/tests/lob_temp.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_temp.phpt Fri Nov 10 16:56:19 2006 @@ -34,3 +34,13 @@ bool(true) string(2) "te" Done +--UEXPECTF-- +bool(true) +unicode(4) "test" +bool(true) +unicode(2) "te" +bool(true) +unicode(4) "test" +bool(true) +unicode(2) "te" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/pecl_bug8816.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/pecl_bug8816.phpt diff -u php-src/ext/oci8/tests/pecl_bug8816.phpt:1.1 php-src/ext/oci8/tests/pecl_bug8816.phpt:1.2 --- php-src/ext/oci8/tests/pecl_bug8816.phpt:1.1 Fri Oct 6 09:57:29 2006 +++ php-src/ext/oci8/tests/pecl_bug8816.phpt Fri Nov 10 16:56:19 2006 @@ -96,3 +96,35 @@ string(19) "1234567890111111111" } Done +--UEXPECT-- +array(2) { + [u"L1"]=> + unicode(19) "1234567890111111111" + [u"L2"]=> + unicode(9) "987654321" +} +array(2) { + [u"L1"]=> + unicode(15) "122222222222222" + [u"L2"]=> + unicode(9) "123456789" +} +array(2) { + [u"L1"]=> + unicode(30) "985456745674567654567654567654" + [u"L2"]=> + unicode(30) "985456745674567654567654567654" +} +array(2) { + [u"L1"]=> + unicode(9) "123456789" + [u"L2"]=> + unicode(15) "122222222222222" +} +array(2) { + [u"L1"]=> + unicode(9) "987654321" + [u"L2"]=> + unicode(19) "1234567890111111111" +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/serverversion.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/serverversion.phpt diff -u php-src/ext/oci8/tests/serverversion.phpt:1.3 php-src/ext/oci8/tests/serverversion.phpt:1.4 --- php-src/ext/oci8/tests/serverversion.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/serverversion.phpt Fri Nov 10 16:56:19 2006 @@ -28,3 +28,8 @@ string(%d) "%s" string(%d) "%s" Done +--UEXPECTF-- +resource(%d) of type (oci8 connection) +unicode(%d) "%s" +unicode(%d) "%s" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/statement_cache.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/statement_cache.phpt diff -u php-src/ext/oci8/tests/statement_cache.phpt:1.5 php-src/ext/oci8/tests/statement_cache.phpt:1.6 --- php-src/ext/oci8/tests/statement_cache.phpt:1.5 Tue Aug 22 11:08:28 2006 +++ php-src/ext/oci8/tests/statement_cache.phpt Fri Nov 10 16:56:19 2006 @@ -36,14 +36,14 @@ --UEXPECTF-- array(2) { [0]=> - string(1) "4" + unicode(1) "4" [u"1+3"]=> - string(1) "4" + unicode(1) "4" } array(2) { [0]=> - string(1) "4" + unicode(1) "4" [u"1+3"]=> - string(1) "4" + unicode(1) "4" } Done
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.323&r2=1.324&diff_format=u Index: php-src/ext/oci8/oci8.c diff -u php-src/ext/oci8/oci8.c:1.323 php-src/ext/oci8/oci8.c:1.324 --- php-src/ext/oci8/oci8.c:1.323 Fri Nov 10 16:33:28 2006 +++ php-src/ext/oci8/oci8.c Fri Nov 10 16:56:19 2006 @@ -26,7 +26,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8.c,v 1.323 2006/11/10 16:33:28 tony2001 Exp $ */ +/* $Id: oci8.c,v 1.324 2006/11/10 16:56:19 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.323 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.324 $"); sprintf(buf, "%ld", OCI_G(num_persistent)); php_info_print_table_row(2, "Active Persistent Connections", buf); @@ -762,9 +762,9 @@ zval_ptr_dtor(&define->zval); - if (define->name) { - efree(define->name); - define->name = NULL; + if (define->name.v) { + efree(define->name.v); + define->name.v = NULL; } } /* }}} */ @@ -813,8 +813,8 @@ efree(column->data); } - if (column->name) { - efree(column->name); + if (column->name.v) { + efree(column->name.v); } } /* }}} */ @@ -863,7 +863,7 @@ case OCI_SUCCESS_WITH_INFO: errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC); if (errbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: %s", errbuf); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: %R", (UG(unicode) ? IS_UNICODE : IS_STRING), errbuf); efree(errbuf); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: failed to fetch error message"); @@ -878,7 +878,7 @@ case OCI_ERROR: errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC); if (errbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%R", (UG(unicode) ? IS_UNICODE : IS_STRING), errbuf); efree(errbuf); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to fetch error message"); @@ -909,18 +909,26 @@ text tmp_buf[PHP_OCI_ERRBUF_LEN]; tmp_buf[0] = '\0'; - + + 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 = strlen(tmp_buf); - - if (tmp_buf_len && tmp_buf[tmp_buf_len - 1] == '\n') { - tmp_buf[tmp_buf_len - 1] = '\0'; + 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'; + } + } 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 (tmp_buf_len && error_buf) { - *error_buf = NULL; - *error_buf = estrndup(tmp_buf, tmp_buf_len); + *error_buf = estrndup(tmp_buf, TEXT_BYTES(tmp_buf_len)); } } return error_code; @@ -929,12 +937,18 @@ #ifdef HAVE_OCI8_ATTR_STATEMENT /* {{{ php_oci_fetch_sqltext_offset() Compute offset in the SQL statement */ -int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset TSRMLS_DC) +int php_oci_fetch_sqltext_offset(php_oci_statement *statement, zstr *sqltext, ub2 *error_offset TSRMLS_DC) { - *sqltext = NULL; + ub4 sqltext_len = 0; + + *sqltext = NULL_ZSTR; *error_offset = 0; - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (text *) sqltext, (ub4 *)0, OCI_ATTR_STATEMENT, statement->err)); + if (UG(unicode)) { + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) &(sqltext->u), (ub4 *)&sqltext_len, OCI_ATTR_STATEMENT, statement->err)); + } else { + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) &(sqltext->s), (ub4 *)&sqltext_len, OCI_ATTR_STATEMENT, statement->err)); + } if (statement->errcode != OCI_SUCCESS) { php_oci_error(statement->err, statement->errcode TSRMLS_CC); @@ -956,22 +970,20 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclusive) { php_oci_connection *connection; - char *username, *password; - char *dbname = NULL, *charset = NULL; + zstr username, password; + zstr dbname, charset = NULL_ZSTR; int username_len = 0, password_len = 0; int dbname_len = 0, charset_len = 0; + zend_uchar username_type, password_type; + zend_uchar dbname_type, charset_type; long session_mode = OCI_DEFAULT; /* if a fourth parameter is handed over, it is the charset identifier (but is only used in Oracle 9i+) */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ssl", &username, &username_len, &password, &password_len, &dbname, &dbname_len, &charset, &charset_len, &session_mode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "TT|TTl", &username, &username_len, &username_type, &password, &password_len, &password_type, &dbname, &dbname_len, &dbname_type, &charset, &charset_len, &charset_type, &session_mode) == FAILURE) { return; } - - if (!charset_len) { - charset = NULL; - } - - connection = php_oci_do_connect_ex(username, username_len, password, password_len, NULL, 0, dbname, dbname_len, charset, session_mode, persistent, exclusive TSRMLS_CC); + + connection = php_oci_do_connect_ex(username, username_len, password, password_len, NULL_ZSTR, 0, dbname, dbname_len, charset, session_mode, persistent, exclusive, username_type TSRMLS_CC); if (!connection) { RETURN_FALSE; @@ -982,7 +994,7 @@ /* {{{ php_oci_do_connect_ex() * The real connect function. Allocates all the resources needed, establishes the connection and returns the result handle (or NULL) */ -php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC) +php_oci_connection *php_oci_do_connect_ex(zstr username, int username_len, zstr password, int password_len, zstr new_password, int new_password_len, zstr dbname, int dbname_len, zstr charset, long session_mode, int persistent, int exclusive, zend_uchar type TSRMLS_DC) { zend_rsrc_list_entry *le; zend_rsrc_list_entry new_le; @@ -1011,17 +1023,17 @@ } 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, username.s, USTR_BYTES(type, 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); + password_hash = zend_u_inline_hash_func(type, 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); + if (dbname_len) { + smart_str_appendl_ex(&hashed_details, dbname.s, USTR_BYTES(type, dbname_len), 0); } smart_str_appendl_ex(&hashed_details, "__", sizeof("__") - 1, 0); @@ -1031,26 +1043,31 @@ } #if HAVE_OCI_ENV_NLS_CREATE - if (charset && *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 { - smart_str_append_unsigned_ex(&hashed_details, charsetid, 0); + if (!UG(unicode)) { + if (charset.s && *charset.s) { + PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, (OCI_G(env), charset.s)); + if (!charsetid) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid character set name: %s", charset.s); + } else { + smart_str_append_unsigned_ex(&hashed_details, charsetid, 0); + } } - } + - /* use NLS_LANG if no or invalid charset specified */ - if (!charsetid) { - size_t rsize = 0; - sword result; + /* use NLS_LANG if no or invalid charset specified */ + + if (!charsetid) { + size_t rsize = 0; + sword result; - PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize)) - if (result != OCI_SUCCESS) { - charsetid_nls_lang = 0; + PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize)) + if (result != OCI_SUCCESS) { + charsetid_nls_lang = 0; + } + smart_str_append_unsigned_ex(&hashed_details, charsetid_nls_lang, 0); } - smart_str_append_unsigned_ex(&hashed_details, charsetid_nls_lang, 0); } + #else if (charset && *charset) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Your version of Oracle Client doesn't support setting the charset; bad or no charset conversions may result"); @@ -1065,7 +1082,7 @@ /* make it lowercase */ php_strtolower(hashed_details.c, hashed_details.len); - if (!exclusive && !new_password) { + if (!exclusive && !new_password.v) { zend_bool found = 0; if (persistent && zend_hash_find(&EG(persistent_list), hashed_details.c, hashed_details.len+1, (void **) &le) == SUCCESS) { @@ -1112,7 +1129,7 @@ connection->used_this_request = 1; 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 && + if (tmp != NULL && rsrc_type == le_pconnection && tmp->hash_key_len == hashed_details.len && memcmp(tmp->hash_key, hashed_details.c, hashed_details.len) == 0 && zend_list_addref(connection->rsrc_id) == SUCCESS) { /* do nothing */ } else { @@ -1165,15 +1182,18 @@ if (alloc_non_persistent) { connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection)); connection->hash_key = estrndup(hashed_details.c, hashed_details.len); + connection->hash_key_len = hashed_details.len; connection->is_persistent = 0; } else { connection = (php_oci_connection *) calloc(1, sizeof(php_oci_connection)); connection->hash_key = zend_strndup(hashed_details.c, hashed_details.len); + connection->hash_key_len = hashed_details.len; connection->is_persistent = 1; } } else { connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection)); connection->hash_key = estrndup(hashed_details.c, hashed_details.len); + connection->hash_key_len = hashed_details.len; connection->is_persistent = 0; } @@ -1190,11 +1210,15 @@ /* allocate environment handle */ #if HAVE_OCI_ENV_NLS_CREATE #define PHP_OCI_INIT_FUNC_NAME "OCIEnvNlsCreate" - - if (charsetid) { - connection->charset = charsetid; + + if (UG(unicode)) { + connection->charset = OCI_UTF16ID; } else { - connection->charset = charsetid_nls_lang; + if (charsetid) { + connection->charset = charsetid; + } else { + connection->charset = charsetid_nls_lang; + } } /* create an environment using the character set id, Oracle 9i+ ONLY */ @@ -1225,7 +1249,7 @@ php_oci_connection_close(connection TSRMLS_CC); return NULL; } - + /* allocate our server handle {{{ */ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->server), OCI_HTYPE_SERVER, 0, NULL)); @@ -1236,7 +1260,7 @@ } /* }}} */ /* attach to the server {{{ */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerAttach, (connection->server, OCI_G(err), (text*)dbname, dbname_len, (ub4) OCI_DEFAULT)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerAttach, (connection->server, OCI_G(err), (text*)dbname.s, USTR_BYTES(type, dbname_len), (ub4) OCI_DEFAULT)); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); @@ -1273,8 +1297,8 @@ } /* }}} */ /* set the username {{{ */ - if (username) { - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) username, (ub4) username_len, (ub4) OCI_ATTR_USERNAME, OCI_G(err))); + if (username.v) { + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) username.s, (ub4) USTR_BYTES(type, username_len), (ub4) OCI_ATTR_USERNAME, OCI_G(err))); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); @@ -1284,8 +1308,8 @@ }/* }}} */ /* set the password {{{ */ - if (password) { - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) password, (ub4) password_len, (ub4) OCI_ATTR_PASSWORD, OCI_G(err))); + if (password.v) { + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) password.s, (ub4) USTR_BYTES(type, password_len), (ub4) OCI_ATTR_PASSWORD, OCI_G(err))); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); @@ -1312,9 +1336,9 @@ return NULL; } /* }}} */ - if (new_password) { + if (new_password_len) { /* try to change password if new one was provided {{{ */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPasswordChange, (connection->svc, OCI_G(err), (text *)username, username_len, (text *)password, password_len, (text *)new_password, new_password_len, OCI_AUTH)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPasswordChange, (connection->svc, OCI_G(err), (text *)username.s, USTR_BYTES(type, username_len), (text *)password.s, USTR_BYTES(type, password_len), (text *)new_password.s, USTR_BYTES(type, new_password_len), OCI_AUTH)); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); @@ -1344,7 +1368,7 @@ case OCI_SYSDBA: case OCI_SYSOPER: default: - if (username_len == 1 && username[0] == '/' && password_len == 0) { + if (username_len == 1 && username.s[0] == '/' && password_len == 0) { PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_EXT, (ub4) session_mode)); } else { PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_RDBMS, (ub4) session_mode)); @@ -1387,13 +1411,13 @@ new_le.type = le_pconnection; connection->used_this_request = 1; connection->rsrc_id = zend_list_insert(connection, le_pconnection); - zend_hash_update(&EG(persistent_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), NULL); + 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)++; } else if (!exclusive) { connection->rsrc_id = zend_list_insert(connection, le_connection); 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); + zend_hash_update(&EG(regular_list), connection->hash_key, connection->hash_key_len+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), NULL); OCI_G(num_links)++; } else { connection->rsrc_id = zend_list_insert(connection, le_connection); @@ -1543,9 +1567,9 @@ /* {{{ php_oci_password_change() 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 TSRMLS_DC) +int php_oci_password_change(php_oci_connection *connection, zstr user, int user_len, zstr pass_old, int pass_old_len, zstr pass_new, int pass_new_len, zend_uchar type TSRMLS_DC) { - PHP_OCI_CALL_RETURN(connection->errcode, OCIPasswordChange, (connection->svc, connection->err, (text *)user, user_len, (text *)pass_old, pass_old_len, (text *)pass_new, pass_new_len, OCI_DEFAULT)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIPasswordChange, (connection->svc, connection->err, (text *)user.s, USTR_BYTES(type, user_len), (text *)pass_old.s, USTR_BYTES(type, pass_old_len), (text *)pass_new.s, USTR_BYTES(type, pass_new_len), OCI_DEFAULT)); if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); @@ -1557,9 +1581,9 @@ /* {{{ php_oci_server_get_version() Get Oracle server version */ -int php_oci_server_get_version(php_oci_connection *connection, char **version TSRMLS_DC) +int php_oci_server_get_version(php_oci_connection *connection, zstr *version TSRMLS_DC) { - char version_buff[256]; + char version_buff[512]; PHP_OCI_CALL_RETURN(connection->errcode, OCIServerVersion, (connection->svc, connection->err, (text*)version_buff, sizeof(version_buff), OCI_HTYPE_SVCCTX)); @@ -1568,8 +1592,12 @@ PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - - *version = estrdup(version_buff); + + if (UG(unicode)) { + version->u = eustrdup((UChar *)version_buff); + } else { + version->s = estrdup(version_buff); + } return 0; } /* }}} */ @@ -1580,7 +1608,7 @@ php_oci_descriptor *descriptor; ub4 lob_length; int column_size; - char *lob_buffer; + zstr lob_buffer, zstr_data = (zstr)column->data; if (column->indicator == -1) { /* column is NULL */ ZVAL_NULL(value); @@ -1609,19 +1637,35 @@ } 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)) { ZVAL_FALSE(value); return 1; - } else { - if (lob_length > 0) { - ZVAL_STRINGL(value, lob_buffer, lob_length, 0); - } else { - ZVAL_EMPTY_STRING(value); - } - return 0; } + + if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC) > 0) { + return 1; + } + + switch (lob_type) { + case OCI_IS_CLOB: + if (lob_length > 0) { + ZVAL_TEXTL(value, lob_buffer, TEXT_CHARS(lob_length), 0); + } else { + ZVAL_EMPTY_TEXT(value); + } + break; + case OCI_IS_BLOB: + if (lob_length > 0) { + ZVAL_STRINGL(value, lob_buffer.s, lob_length, 0); + } else { + ZVAL_EMPTY_STRING(value); + } + break; + } + return 0; } else { /* return the locator */ object_init_ex(value, oci_lob_class_entry_ptr); @@ -1644,7 +1688,7 @@ return 0; } - ZVAL_STRINGL(value, column->data, column_size, 1); + ZVAL_TEXTL(value, zstr_data, TEXT_CHARS(column_size), 1); } return 0; } @@ -1711,7 +1755,7 @@ for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); if (column == NULL) { continue; @@ -1733,7 +1777,7 @@ if (fetch_mode & PHP_OCI_NUM) { ZVAL_ADDREF(element); } - add_assoc_zval(return_value, column->name, element); + add_u_assoc_zval(return_value, (UG(unicode) ? IS_UNICODE : IS_STRING), column->name, element); } } else { @@ -1741,7 +1785,7 @@ add_index_null(return_value, i); } if (fetch_mode & PHP_OCI_ASSOC) { - add_assoc_null(return_value, column->name); + add_u_assoc_null(return_value, (UG(unicode) ? IS_UNICODE : IS_STRING), column->name); } } } http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_collection.c?r1=1.9&r2=1.10&diff_format=u Index: php-src/ext/oci8/oci8_collection.c diff -u php-src/ext/oci8/oci8_collection.c:1.9 php-src/ext/oci8/oci8_collection.c:1.10 --- php-src/ext/oci8/oci8_collection.c:1.9 Mon Aug 21 16:40:46 2006 +++ php-src/ext/oci8/oci8_collection.c Fri Nov 10 16:56:19 2006 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_collection.c,v 1.9 2006/08/21 16:40:46 tony2001 Exp $ */ +/* $Id: oci8_collection.c,v 1.10 2006/11/10 16:56:19 tony2001 Exp $ */ @@ -44,7 +44,7 @@ /* {{{ php_oci_collection_create() Create and return connection handle */ -php_oci_collection * php_oci_collection_create(php_oci_connection* connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC) +php_oci_collection * php_oci_collection_create(php_oci_connection* connection, zstr tdo, int tdo_len, zstr schema, int schema_len TSRMLS_DC) { dvoid *dschp1; dvoid *parmp1; @@ -62,10 +62,10 @@ connection->env, connection->err, connection->svc, - (text *) schema, - (ub4) schema_len, - (text *) tdo, - (ub4) tdo_len, + (text *) schema.s, + (ub4) TEXT_BYTES(schema_len), + (text *) tdo.s, + (ub4) TEXT_BYTES(tdo_len), (CONST text *) 0, (ub4) 0, OCI_DURATION_SESSION, @@ -289,14 +289,14 @@ /* {{{ php_oci_collection_append_date() Append DATE element to the end of the collection (use "DD-MON-YY" format) */ -int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len TSRMLS_DC) +int php_oci_collection_append_date(php_oci_collection *collection, zstr date, int date_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; OCIDate oci_date; 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, date_len, NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, date.s, TEXT_BYTES(date_len), NULL, 0, NULL, 0, &oci_date)); if (connection->errcode != OCI_SUCCESS) { /* failed to convert string to date */ @@ -324,14 +324,18 @@ /* {{{ php_oci_collection_append_number() Append NUMBER to the end of the collection */ -int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len TSRMLS_DC) +int php_oci_collection_append_number(php_oci_collection *collection, zstr number, int number_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; double element_double; OCINumber oci_number; php_oci_connection *connection = collection->connection; - element_double = zend_strtod(number, NULL); + if (UG(unicode)) { + element_double = zend_u_strtod(number.u, NULL); + } else { + element_double = zend_strtod(number.s, NULL); + } PHP_OCI_CALL_RETURN(connection->errcode, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); @@ -360,13 +364,13 @@ /* {{{ php_oci_collection_append_string() Append STRING to the end of the collection */ -int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len TSRMLS_DC) +int php_oci_collection_append_string(php_oci_collection *collection, zstr element, int element_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; OCIString *ocistr = (OCIString *)0; php_oci_connection *connection = collection->connection; - PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, element, element_len, &ocistr)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, element.s, TEXT_BYTES(element_len), &ocistr)); if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); @@ -393,7 +397,7 @@ /* {{{ php_oci_collection_append() Append wrapper. Appends any supported element to the end of the collection */ -int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len TSRMLS_DC) +int php_oci_collection_append(php_oci_collection *collection, zstr element, int element_len TSRMLS_DC) { if (element_len == 0) { return php_oci_collection_append_null(collection TSRMLS_CC); @@ -484,9 +488,14 @@ return 1; } - ZVAL_STRINGL(*result_element, buff, buff_len, 1); - Z_STRVAL_P(*result_element)[buff_len] = '\0'; - + if (UG(unicode)) { + ZVAL_UNICODEL(*result_element, (UChar *)buff, TEXT_CHARS(buff_len), 1); + /* Z_UNIVAL_P(*result_element)[buff_len] = 0; XXX */ + } else { + ZVAL_STRINGL(*result_element, buff, buff_len, 1); + Z_STRVAL_P(*result_element)[buff_len] = '\0'; + } + return 0; break; @@ -498,7 +507,11 @@ PHP_OCI_CALL_RETURN(str, OCIStringPtr, (connection->env, oci_string)); if (str) { - ZVAL_STRING(*result_element, str, 1); + if (UG(unicode)) { + ZVAL_UNICODE(*result_element, (UChar *)str, 1); + } else { + ZVAL_STRING(*result_element, str, 1); + } } return 0; } @@ -560,14 +573,14 @@ /* {{{ php_oci_collection_element_set_date() Change element's value to the given DATE */ -int php_oci_collection_element_set_date(php_oci_collection *collection, long index, char *date, int date_len TSRMLS_DC) +int php_oci_collection_element_set_date(php_oci_collection *collection, long index, zstr date, int date_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; OCIDate oci_date; 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, date_len, NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, date.s, TEXT_BYTES(date_len), NULL, 0, NULL, 0, &oci_date)); if (connection->errcode != OCI_SUCCESS) { /* failed to convert string to date */ @@ -596,14 +609,18 @@ /* {{{ php_oci_collection_element_set_number() Change element's value to the given NUMBER */ -int php_oci_collection_element_set_number(php_oci_collection *collection, long index, char *number, int number_len TSRMLS_DC) +int php_oci_collection_element_set_number(php_oci_collection *collection, long index, zstr number, int number_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; double element_double; OCINumber oci_number; php_oci_connection *connection = collection->connection; - element_double = zend_strtod(number, NULL); + if (UG(unicode)) { + element_double = zend_u_strtod(number.u, NULL); + } else { + element_double = zend_strtod(number.s, NULL); + } PHP_OCI_CALL_RETURN(connection->errcode, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); @@ -633,13 +650,13 @@ /* {{{ php_oci_collection_element_set_string() Change element's value to the given string */ -int php_oci_collection_element_set_string(php_oci_collection *collection, long index, char *element, int element_len TSRMLS_DC) +int php_oci_collection_element_set_string(php_oci_collection *collection, long index, zstr element, int element_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; OCIString *ocistr = (OCIString *)0; php_oci_connection *connection = collection->connection; - PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, element, element_len, &ocistr)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, element.s, TEXT_BYTES(element_len), &ocistr)); if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); @@ -667,7 +684,7 @@ /* {{{ php_oci_collection_element_set() Collection element setter */ -int php_oci_collection_element_set(php_oci_collection *collection, long index, char *value, int value_len TSRMLS_DC) +int php_oci_collection_element_set(php_oci_collection *collection, long index, zstr value, int value_len TSRMLS_DC) { if (value_len == 0) { return php_oci_collection_element_set_null(collection, index TSRMLS_CC); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_interface.c?r1=1.18&r2=1.19&diff_format=u Index: php-src/ext/oci8/oci8_interface.c diff -u php-src/ext/oci8/oci8_interface.c:1.18 php-src/ext/oci8/oci8_interface.c:1.19 --- php-src/ext/oci8/oci8_interface.c:1.18 Tue Aug 22 11:08:28 2006 +++ php-src/ext/oci8/oci8_interface.c Fri Nov 10 16:56:19 2006 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_interface.c,v 1.18 2006/08/22 11:08:28 tony2001 Exp $ */ +/* $Id: oci8_interface.c,v 1.19 2006/11/10 16:56:19 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -46,13 +46,14 @@ PHP_FUNCTION(oci_define_by_name) { zval *stmt, *var; - char *name; + zstr name; int name_len; + zend_uchar name_type; long type = SQLT_CHR; php_oci_statement *statement; php_oci_define *define, *tmp_define; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|l", &stmt, &name, &name_len, &var, &type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rtz/|l", &stmt, &name, &name_len, &name_type, &var, &type) == FAILURE) { return; } @@ -70,7 +71,7 @@ define = ecalloc(1,sizeof(php_oci_define)); - if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) { + if (zend_hash_add(statement->defines, name.s, USTR_BYTES(name_type, name_len+1), define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) { efree(define); define = tmp_define; } else { @@ -78,8 +79,14 @@ RETURN_FALSE; } - define->name = (text*) estrndup(name, name_len); + if (name_type == IS_UNICODE) { + define->name.u = eustrndup(name.u, name_len); + } else { + define->name.s = estrndup(name.s, name_len); + } + define->name_len = name_len; + define->name_type = name_type; define->type = type; define->zval = var; zval_add_ref(&var); @@ -96,12 +103,13 @@ ub2 bind_type = SQLT_CHR; /* unterminated string */ int name_len; long maxlen = -1, type = 0; - char *name; + zstr name; + zend_uchar name_type; zval *z_statement; zval *bind_var = NULL; php_oci_statement *statement; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|ll", &z_statement, &name, &name_len, &bind_var, &maxlen, &type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rtz/|ll", &z_statement, &name, &name_len, &name_type, &bind_var, &maxlen, &type) == FAILURE) { return; } @@ -111,7 +119,7 @@ PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - if (php_oci_bind_by_name(statement, name, name_len, bind_var, maxlen, bind_type TSRMLS_CC)) { + if (php_oci_bind_by_name(statement, name, name_len, bind_var, maxlen, bind_type, name_type TSRMLS_CC)) { RETURN_FALSE; } RETURN_TRUE; @@ -126,12 +134,13 @@ long max_item_len = -1; long max_array_len = 0; long type = SQLT_AFC; - char *name; + zstr name; + zend_uchar name_type; zval *z_statement; zval *bind_var = NULL; php_oci_statement *statement; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/l|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rtz/l|ll", &z_statement, &name, &name_len, &name_type, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) { return; } @@ -146,7 +155,7 @@ RETURN_FALSE; } - if (php_oci_bind_array_by_name(statement, name, name_len, bind_var, max_array_len, max_item_len, type TSRMLS_CC)) { + if (php_oci_bind_array_by_name(statement, name, name_len, bind_var, max_array_len, max_item_len, type, name_type TSRMLS_CC)) { RETURN_FALSE; } RETURN_TRUE; @@ -184,18 +193,18 @@ { zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - char *data; + zstr data; int data_len; + zend_uchar data_type; long offset = 0; ub4 bytes_written; if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t|l", &data, &data_len, &data_type, &offset) == FAILURE) { return; } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &offset) == FAILURE) { + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ot|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &data_type, &offset) == FAILURE) { return; } } @@ -211,8 +220,8 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset parameter must be greater than or equal to 0"); RETURN_FALSE; } - - if (php_oci_lob_write(descriptor, offset, data, data_len, &bytes_written TSRMLS_CC)) { + + if (php_oci_lob_write(descriptor, offset, data, USTR_BYTES(data_type, data_len), &bytes_written TSRMLS_CC)) { RETURN_FALSE; } RETURN_TRUE; @@ -259,8 +268,9 @@ { zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - char *buffer = NULL; + zstr buffer = NULL_ZSTR; ub4 buffer_len; + php_oci_lob_type lob_type; if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { @@ -278,11 +288,24 @@ if (php_oci_lob_read(descriptor, -1, 0, &buffer, &buffer_len TSRMLS_CC)) { RETURN_FALSE; } - if (buffer_len > 0) { - RETURN_STRINGL(buffer, buffer_len, 0); + + if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC) > 0) { + RETURN_FALSE; } - else { - RETURN_EMPTY_STRING(); + + switch (lob_type) { + case OCI_IS_CLOB: + if (buffer_len > 0) { + RETURN_TEXTL(buffer, TEXT_CHARS(buffer_len), 0); + } + RETURN_EMPTY_TEXT(); + break; + case OCI_IS_BLOB: + if (buffer_len > 0) { + RETURN_STRINGL(buffer.s, buffer_len, 0); + } + RETURN_EMPTY_STRING(); + break; } } /* }}} */ @@ -294,8 +317,9 @@ zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; long length; - char *buffer; + zstr buffer; ub4 buffer_len; + php_oci_lob_type lob_type; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) { @@ -322,12 +346,25 @@ if (php_oci_lob_read(descriptor, length, descriptor->lob_current_position, &buffer, &buffer_len TSRMLS_CC)) { RETURN_FALSE; - } - if (buffer_len > 0) { - RETURN_STRINGL(buffer, buffer_len, 0); } - else { - RETURN_EMPTY_STRING(); + + if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC) > 0) { + RETURN_FALSE; + } + + switch (lob_type) { + case OCI_IS_CLOB: + if (buffer_len > 0) { + RETURN_TEXTL(buffer, TEXT_CHARS(buffer_len), 0); + } + RETURN_EMPTY_TEXT(); + break; + case OCI_IS_BLOB: + if (buffer_len > 0) { + RETURN_STRINGL(buffer.s, buffer_len, 0); + } + RETURN_EMPTY_STRING(); + break; } } /* }}} */ @@ -439,7 +476,6 @@ PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { RETURN_FALSE; } @@ -449,7 +485,7 @@ descriptor->lob_current_position += offset; break; case PHP_OCI_SEEK_END: - if (descriptor->lob_size + offset >= 0) { + if ((descriptor->lob_size + offset) >= 0) { descriptor->lob_current_position = descriptor->lob_size + offset; } else { @@ -458,10 +494,9 @@ break; case PHP_OCI_SEEK_SET: default: - descriptor->lob_current_position = (offset > 0) ? offset : 0; + descriptor->lob_current_position = (offset > 0) ? offset : 0; break; } - RETURN_TRUE; } /* }}} */ @@ -503,10 +538,11 @@ int data_len; long write_len = 0; ub4 bytes_written; - char *data; + zstr data; + zend_uchar data_type; if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &write_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t|l", &data, &data_len, &data_type, &write_len) == FAILURE) { return; } @@ -515,7 +551,7 @@ } } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &write_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ot|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &data_type, &write_len) == FAILURE) { return; } @@ -534,8 +570,8 @@ if (data_len <= 0) { RETURN_LONG(0); } - - if (php_oci_lob_write(descriptor, descriptor->lob_current_position, data, data_len, &bytes_written TSRMLS_CC)) { + + if (php_oci_lob_write(descriptor, descriptor->lob_current_position, data, USTR_BYTES(data_type, data_len), &bytes_written TSRMLS_CC)) { RETURN_FALSE; } RETURN_LONG(bytes_written); @@ -850,11 +886,13 @@ { zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - char *filename, *buffer; + char *filename; + zstr buffer; int filename_len; long start = -1, length = -1, block_length; php_stream *stream; ub4 lob_length; + php_oci_lob_type lob_type; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &filename, &filename_len, &start, &length) == FAILURE) { @@ -920,19 +958,23 @@ block_length = length; } + if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC)) { + RETURN_FALSE; + } + while(length > 0) { ub4 tmp_bytes_read = 0; if (php_oci_lob_read(descriptor, block_length, start, &buffer, &tmp_bytes_read TSRMLS_CC)) { php_stream_close(stream); RETURN_FALSE; } - if (tmp_bytes_read && !php_stream_write(stream, buffer, tmp_bytes_read)) { + if (tmp_bytes_read && !php_stream_u_write(stream, (lob_type == OCI_IS_CLOB ? IS_UNICODE : IS_STRING), buffer, tmp_bytes_read)) { php_stream_close(stream); - efree(buffer); + efree(buffer.v); RETURN_FALSE; } - if (buffer) { - efree(buffer); + if (buffer.v) { + efree(buffer.v); } length -= tmp_bytes_read; @@ -956,17 +998,18 @@ { zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - char *data; + zstr data; int data_len; + zend_uchar data_type; long type = OCI_TEMP_CLOB; if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t|l", &data, &data_len, &data_type, &type) == FAILURE) { return; } } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ot|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &data_type, &type) == FAILURE) { return; } } @@ -978,7 +1021,7 @@ PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); - if (php_oci_lob_write_tmp(descriptor, type, data, data_len TSRMLS_CC)) { + if (php_oci_lob_write_tmp(descriptor, type, data, USTR_BYTES(data_type, data_len) TSRMLS_CC)) { RETURN_FALSE; } RETURN_TRUE; @@ -1099,7 +1142,7 @@ php_oci_out_column *column; if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0) ) ) { - RETURN_STRINGL(column->name, column->name_len, 1); + RETURN_TEXTL(column->name, column->name_len, 1); } RETURN_FALSE; } @@ -1163,49 +1206,49 @@ switch (column->data_type) { #ifdef SQLT_TIMESTAMP case SQLT_TIMESTAMP: - RETVAL_STRING("TIMESTAMP",1); + RETVAL_ASCII_STRING("TIMESTAMP", ZSTR_DUPLICATE); break; #endif #ifdef SQLT_TIMESTAMP_TZ case SQLT_TIMESTAMP_TZ: - RETVAL_STRING("TIMESTAMP_TZ",1); + RETVAL_ASCII_STRING("TIMESTAMP_TZ", ZSTR_DUPLICATE); break; #endif case SQLT_DAT: - RETVAL_STRING("DATE",1); + RETVAL_ASCII_STRING("DATE", ZSTR_DUPLICATE); break; case SQLT_NUM: - RETVAL_STRING("NUMBER",1); + RETVAL_ASCII_STRING("NUMBER", ZSTR_DUPLICATE); break; case SQLT_LNG: - RETVAL_STRING("LONG",1); + RETVAL_ASCII_STRING("LONG", ZSTR_DUPLICATE); break; case SQLT_BIN: - RETVAL_STRING("RAW",1); + RETVAL_ASCII_STRING("RAW", ZSTR_DUPLICATE); break; case SQLT_LBI: - RETVAL_STRING("LONG RAW",1); + RETVAL_ASCII_STRING("LONG RAW", ZSTR_DUPLICATE); break; case SQLT_CHR: - RETVAL_STRING("VARCHAR2",1); + RETVAL_ASCII_STRING("VARCHAR2", ZSTR_DUPLICATE); break; case SQLT_RSET: - RETVAL_STRING("REFCURSOR",1); + RETVAL_ASCII_STRING("REFCURSOR", ZSTR_DUPLICATE); break; case SQLT_AFC: - RETVAL_STRING("CHAR",1); + RETVAL_ASCII_STRING("CHAR", ZSTR_DUPLICATE); break; case SQLT_BLOB: - RETVAL_STRING("BLOB",1); + RETVAL_ASCII_STRING("BLOB", ZSTR_DUPLICATE); break; case SQLT_CLOB: - RETVAL_STRING("CLOB",1); + RETVAL_ASCII_STRING("CLOB", ZSTR_DUPLICATE); break; case SQLT_BFILE: - RETVAL_STRING("BFILE",1); + RETVAL_ASCII_STRING("BFILE", ZSTR_DUPLICATE); break; case SQLT_RDD: - RETVAL_STRING("ROWID",1); + RETVAL_ASCII_STRING("ROWID", ZSTR_DUPLICATE); break; default: RETVAL_LONG(column->data_type); @@ -1356,7 +1399,7 @@ columns = safe_emalloc(statement->ncolumns, sizeof(php_oci_out_column *), 0); for (i = 0; i < statement->ncolumns; i++) { - columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); } while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) { @@ -1372,7 +1415,7 @@ if (flags & PHP_OCI_NUM) { zend_hash_next_index_insert(Z_ARRVAL_P(row), &element, sizeof(zval*), NULL); } else { /* default to ASSOC */ - zend_hash_update(Z_ARRVAL_P(row), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL); + zend_u_hash_update(Z_ARRVAL_P(row), (UG(unicode) ? IS_UNICODE : IS_STRING), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL); } } @@ -1392,7 +1435,7 @@ if (flags & PHP_OCI_NUM) { for (i = 0; i < statement->ncolumns; i++) { - columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); MAKE_STD_ZVAL(tmp); array_init(tmp); @@ -1400,11 +1443,11 @@ } } else { /* default to ASSOC */ for (i = 0; i < statement->ncolumns; i++) { - columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); MAKE_STD_ZVAL(tmp); array_init(tmp); - zend_hash_update(Z_ARRVAL_P(array), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ])); + zend_u_hash_update(Z_ARRVAL_P(array), (UG(unicode) ? IS_UNICODE : IS_STRING), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ])); } } @@ -1549,7 +1592,7 @@ dvoid *errh = NULL; #ifdef HAVE_OCI8_ATTR_STATEMENT ub2 error_offset = 0; - text *sqltext = NULL; + zstr sqltext = NULL_ZSTR; #endif if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == FAILURE) { @@ -1595,10 +1638,18 @@ if (errcode) { array_init(return_value); add_assoc_long(return_value, "code", errcode); - add_assoc_string(return_value, "message", (char*) errbuf, 0); + if (UG(unicode)) { + add_assoc_unicode(return_value, "message", (UChar *)errbuf, 0); + } else { + add_assoc_string(return_value, "message", errbuf, 0); + } #ifdef HAVE_OCI8_ATTR_STATEMENT add_assoc_long(return_value, "offset", error_offset); - add_assoc_string(return_value, "sqltext", sqltext ? (char *) sqltext : "", 1); + if (sqltext.v) { + add_assoc_text(return_value, "sqltext", sqltext, 1); + } else { + add_assoc_ascii_string(return_value, "sqltext", "", 1); + } #endif } else { RETURN_FALSE; @@ -1630,16 +1681,17 @@ zval *z_connection; php_oci_connection *connection; php_oci_statement *statement; - char *query; + zstr query; + zend_uchar query_type; int query_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &query, &query_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rt", &z_connection, &query, &query_len, &query_type) == FAILURE) { return; } PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - statement = php_oci_statement_create(connection, query, query_len TSRMLS_CC); + statement = php_oci_statement_create(connection, query, query_len, query_type TSRMLS_CC); if (statement) { RETURN_RESOURCE(statement->id); @@ -1674,11 +1726,12 @@ PHP_FUNCTION(oci_password_change) { zval *z_connection; - text *user, *pass_old, *pass_new, *dbname; + zstr user, pass_old, pass_new, dbname; + zend_uchar user_type, pass_old_type, pass_new_type, dbname_type; int user_len, pass_old_len, pass_new_len, dbname_len; php_oci_connection *connection; - 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) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rTTT", &z_connection, &user, &user_len, &user_type, &pass_old, &pass_old_len, &pass_old_type, &pass_new, &pass_new_len, &pass_new_type) == SUCCESS) { PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); if (!user_len) { @@ -1694,11 +1747,11 @@ RETURN_FALSE; } - if (php_oci_password_change(connection, user, user_len, pass_old, pass_old_len, pass_new, pass_new_len TSRMLS_CC)) { + if (php_oci_password_change(connection, user, user_len, pass_old, pass_old_len, pass_new, pass_new_len, user_type TSRMLS_CC)) { RETURN_FALSE; } RETURN_TRUE; - } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ssss", &dbname, &dbname_len, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) { + } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "TTTT", &dbname, &dbname_len, &dbname_type, &user, &user_len, &user_type, &pass_old, &pass_old_len, &pass_old_type, &pass_new, &pass_new_len, &pass_new_type) == SUCCESS) { if (!user_len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "username cannot be empty"); @@ -1713,7 +1766,7 @@ 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); + connection = php_oci_do_connect_ex(user, user_len, pass_old, pass_old_len, pass_new, pass_new_len, dbname, dbname_len, NULL_ZSTR, OCI_DEFAULT, 0, 0, user_type TSRMLS_CC); if (!connection) { RETURN_FALSE; } @@ -1737,7 +1790,7 @@ PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - statement = php_oci_statement_create(connection, NULL, 0 TSRMLS_CC); + statement = php_oci_statement_create(connection, NULL_ZSTR, 0, 0 TSRMLS_CC); if (statement) { RETURN_RESOURCE(statement->id); @@ -1768,7 +1821,7 @@ { zval *z_connection; php_oci_connection *connection; - char *version = NULL; + zstr version = NULL_ZSTR; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) { return; @@ -1780,7 +1833,7 @@ RETURN_FALSE; } - RETURN_STRING(version, 0); + RETURN_TEXT(version, 0); } /* }}} */ @@ -1889,16 +1942,16 @@ { zval **tmp, *z_collection = getThis(); php_oci_collection *collection; - char *value; + zstr value; int value_len; + zend_uchar value_type; if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &value, &value_len, &value_type) == FAILURE) { return; } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &z_collection, oci_coll_class_entry_ptr, &value, &value_len) == FAILURE) { + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ot", &z_collection, oci_coll_class_entry_ptr, &value, &value_len, &value_type) == FAILURE) { return; } } @@ -2000,15 +2053,15 @@ php_oci_collection *collection; int value_len; long element_index; - char *value; + zstr value; + zend_uchar value_type; if (getThis()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &element_index, &value, &value_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lt", &element_index, &value, &value_len, &value_type) == FAILURE) { return; } - } - else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ols", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len) == FAILURE) { + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Olt", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len, &value_type) == FAILURE) { return; } } @@ -2123,10 +2176,11 @@ zval *z_connection; php_oci_connection *connection; php_oci_collection *collection; - char *tdo, *schema = NULL; + zstr tdo, schema = NULL_ZSTR; int tdo_len, schema_len = 0; + zend_uchar tdo_type, schema_type; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s", &z_connection, &tdo, &tdo_len, &schema, &schema_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rT|T", &z_connection, &tdo, &tdo_len, &tdo_type, &schema, &schema_len, &schema_type) == FAILURE) { return; } @@ -2135,8 +2189,7 @@ if ( (collection = php_oci_collection_create(connection, tdo, tdo_len, schema, schema_len TSRMLS_CC)) ) { object_init_ex(return_value, oci_coll_class_entry_ptr); add_property_resource(return_value, "collection", collection->id); - } - else { + } else { RETURN_FALSE; } } http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_lob.c?r1=1.19&r2=1.20&diff_format=u Index: php-src/ext/oci8/oci8_lob.c diff -u php-src/ext/oci8/oci8_lob.c:1.19 php-src/ext/oci8/oci8_lob.c:1.20 --- php-src/ext/oci8/oci8_lob.c:1.19 Sun Oct 8 13:34:22 2006 +++ php-src/ext/oci8/oci8_lob.c Fri Nov 10 16:56:19 2006 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_lob.c,v 1.19 2006/10/08 13:34:22 bjori Exp $ */ +/* $Id: oci8_lob.c,v 1.20 2006/11/10 16:56:19 tony2001 Exp $ */ @@ -156,14 +156,20 @@ { ub4 lenp = (ub4) len; php_oci_lob_ctx *ctx = (php_oci_lob_ctx *)ctxp; + TSRMLS_FETCH(); switch (piece) { case OCI_LAST_PIECE: - *(ctx->lob_data) = erealloc(*(ctx->lob_data), (size_t) (*(ctx->lob_len) + lenp + 1)); + *(ctx->lob_data) = erealloc(*(ctx->lob_data), (size_t) (*(ctx->lob_len) + lenp + TEXT_BYTES(1))); memcpy(*(ctx->lob_data) + *(ctx->lob_len), bufxp, (size_t) lenp); *(ctx->lob_len) += lenp; - *(*(ctx->lob_data) + *(ctx->lob_len)) = 0x00; + + if (UG(unicode)) { + *(*(ctx->lob_data) + *(ctx->lob_len) + 1) = 0; + } + *(*(ctx->lob_data) + *(ctx->lob_len)) = 0; + return OCI_CONTINUE; case OCI_FIRST_PIECE: @@ -173,14 +179,12 @@ *(ctx->lob_len) += lenp; return OCI_CONTINUE; - default: { - TSRMLS_FETCH(); + default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected LOB piece id received (value:%d)", piece); efree(*(ctx->lob_data)); *(ctx->lob_data) = NULL; *(ctx->lob_len) = 0; return OCI_ERROR; - } } } /* }}} */ @@ -211,27 +215,27 @@ /* {{{ php_oci_lob_read() Read specified portion of the LOB into the buffer */ -int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long initial_offset, char **data, ub4 *data_len TSRMLS_DC) +int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long initial_offset, zstr *data, ub4 *data_len TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; ub4 length = 0; int buffer_size = PHP_OCI_LOB_BUFFER_SIZE; php_oci_lob_ctx ctx; ub1 *bufp; + php_oci_lob_type lob_type; #if defined(HAVE_OCI_LOB_READ2) oraub8 bytes_read, offset = 0; oraub8 requested_len = read_length; /* this is by default */ oraub8 chars_read = 0; - int is_clob = 0; #else int bytes_read, offset = 0; int requested_len = read_length; /* this is by default */ #endif *data_len = 0; - *data = NULL; + *data = NULL_ZSTR; ctx.lob_len = data_len; - ctx.lob_data = data; + ctx.lob_data = &(data->s); if (php_oci_lob_get_length(descriptor, &length TSRMLS_CC)) { return 1; @@ -257,7 +261,7 @@ if (requested_len <= 0) { return 0; } - + offset = initial_offset; if (descriptor->type == OCI_DTYPE_FILE) { @@ -269,24 +273,13 @@ return 1; } } -#ifdef HAVE_OCI_LOB_READ2 - else { - ub2 charset_id = 0; - - PHP_OCI_CALL_RETURN(connection->errcode, OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id)); - - if (connection->errcode != OCI_SUCCESS) { - php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - if (charset_id > 0) { /* charset_id is always > 0 for [N]CLOBs */ - is_clob = 1; - } + if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC) > 0) { + return 1; } - if (is_clob) { +#ifdef HAVE_OCI_LOB_READ2 + if (lob_type == OCI_IS_CLOB) { chars_read = requested_len; bytes_read = 0; } else { @@ -318,7 +311,7 @@ efree(bufp); - if (is_clob) { + if (lob_type == OCI_IS_CLOB) { offset = descriptor->lob_current_position + chars_read; } else { offset = descriptor->lob_current_position + bytes_read; @@ -348,22 +341,26 @@ ); efree(bufp); - offset = descriptor->lob_current_position + bytes_read; + if (!is_clob) { + offset = descriptor->lob_current_position + TEXT_BYTES(bytes_read); + } else { + offset = descriptor->lob_current_position + bytes_read; + } #endif if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - if (*data) { - efree(*data); - *data = NULL; + if (data->s) { + efree(data->s); + *data = NULL_ZSTR; } *data_len = 0; return 1; } - descriptor->lob_current_position = (int)offset; + descriptor->lob_current_position = (offset <= descriptor->lob_size) ? offset : descriptor->lob_size; if (descriptor->type == OCI_DTYPE_FILE) { PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); @@ -371,9 +368,9 @@ if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - if (*data) { - efree(*data); - *data = NULL; + if (data->s) { + efree(data->s); + *data = NULL_ZSTR; } *data_len = 0; return 1; @@ -385,18 +382,28 @@ /* {{{ php_oci_lob_write() Write data to the LOB */ -int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written TSRMLS_DC) +int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, zstr data, int data_len, ub4 *bytes_written TSRMLS_DC) { OCILobLocator *lob = (OCILobLocator *) descriptor->descriptor; php_oci_connection *connection = (php_oci_connection *) descriptor->connection; ub4 lob_length; + ub4 data_len_out = data_len; + php_oci_lob_type lob_type; *bytes_written = 0; if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { return 1; } - - if (!data || data_len <= 0) { + + if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC)) { + return 1; + } + + if (lob_type == OCI_IS_CLOB) { + data_len_out = TEXT_CHARS(data_len); + } + + if (!data.v || data_len <= 0) { return 0; } @@ -407,15 +414,15 @@ if (offset > descriptor->lob_current_position) { offset = descriptor->lob_current_position; } - + PHP_OCI_CALL_RETURN(connection->errcode, OCILobWrite, ( connection->svc, connection->err, lob, - (ub4 *)&data_len, + (ub4 *)&data_len_out, (ub4) offset + 1, - (dvoid *) data, + (dvoid *) (text *)data.s, (ub4) data_len, OCI_ONE_PIECE, (dvoid *)0, @@ -431,8 +438,8 @@ *bytes_written = 0; return 1; } - *bytes_written = data_len; - descriptor->lob_current_position += data_len; + *bytes_written = data_len_out; + descriptor->lob_current_position += data_len_out; if (descriptor->lob_current_position > descriptor->lob_size) { descriptor->lob_size = descriptor->lob_current_position; @@ -779,7 +786,7 @@ if (length == -1) { length = lob_length; } - + PHP_OCI_CALL_RETURN(connection->errcode, OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, offset+1)); if (connection->errcode != OCI_SUCCESS) { @@ -812,7 +819,7 @@ /* {{{ php_oci_lob_write_tmp() Create temporary LOB and write data to it */ -int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, ub1 type, char *data, int data_len TSRMLS_DC) +int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, ub1 type, zstr data, int data_len TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; OCILobLocator *lob = descriptor->descriptor; @@ -829,7 +836,7 @@ break; } - if (!data || data_len <= 0) { + if (!data.v || data_len <= 0) { /* nothing to write, silently fail */ return 1; } @@ -864,4 +871,44 @@ return php_oci_lob_write(descriptor, 0, data, data_len, &bytes_written TSRMLS_CC); } /* }}} */ +int php_oci_lob_get_type(php_oci_descriptor *descriptor, php_oci_lob_type *lob_type TSRMLS_DC) /* {{{ */ +{ + php_oci_connection *connection = descriptor->connection; + + *lob_type = 0; + + if (descriptor->lob_type) { + *lob_type = descriptor->lob_type; + return 0; + } + + if (descriptor->type == OCI_DTYPE_FILE) { + *lob_type = OCI_IS_BLOB; + descriptor->lob_type = OCI_IS_BLOB; + return 0; + } else { + ub2 charset_id = 0; + + PHP_OCI_CALL_RETURN(connection->errcode, OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id)); + + if (connection->errcode != OCI_SUCCESS) { + php_oci_error(connection->err, connection->errcode TSRMLS_CC); + PHP_OCI_HANDLE_ERROR(connection, connection->errcode); + return 1; + } + + if (charset_id > 0) { /* charset_id is always > 0 for [N]CLOBs */ + *lob_type = OCI_IS_CLOB; + descriptor->lob_type = OCI_IS_CLOB; + return 0; + } + } + + *lob_type = OCI_IS_BLOB; + descriptor->lob_type = OCI_IS_BLOB; + + return 0; +} +/* }}} */ + #endif /* HAVE_OCI8 */ http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.33&r2=1.34&diff_format=u Index: php-src/ext/oci8/oci8_statement.c diff -u php-src/ext/oci8/oci8_statement.c:1.33 php-src/ext/oci8/oci8_statement.c:1.34 --- php-src/ext/oci8/oci8_statement.c:1.33 Fri Nov 10 16:33:28 2006 +++ php-src/ext/oci8/oci8_statement.c Fri Nov 10 16:56:19 2006 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_statement.c,v 1.33 2006/11/10 16:33:28 tony2001 Exp $ */ +/* $Id: oci8_statement.c,v 1.34 2006/11/10 16:56:19 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, int query_len TSRMLS_DC) +php_oci_statement *php_oci_statement_create (php_oci_connection *connection, zstr query, int query_len, zend_uchar type TSRMLS_DC) { php_oci_statement *statement; @@ -67,8 +67,8 @@ connection->svc, &(statement->stmt), connection->err, - (text *)query, - query_len, + (text *)query.s, + USTR_BYTES(type, query_len), NULL, 0, OCI_NTV_SYNTAX, @@ -95,8 +95,10 @@ } } - if (query && query_len) { - statement->last_query = estrndup(query, query_len); + if (query.s && query_len) { + statement->last_query = emalloc(USTR_BYTES(type, query_len + 1)); + memcpy(statement->last_query, query.s, USTR_BYTES(type, query_len)); + statement->last_query[USTR_BYTES(type, query_len)] = '\0'; statement->last_query_len = query_len; } else { @@ -161,8 +163,8 @@ ub4 typep, iterp, idxp; ub1 in_outp, piecep; zend_bool piecewisecols = 0; - php_oci_out_column *column; + zstr zstr_data; PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); @@ -190,7 +192,7 @@ /* reset length for all piecewise columns */ for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); if (column->piecewise) { column->retlen4 = 0; piecewisecols = 1; @@ -215,12 +217,14 @@ /* scan through our columns for a piecewise column with a matching handle */ for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - if (column->piecewise && handlepp == column->oci_define) { + column = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); + if (column->piecewise && handlepp == column->oci_define) { if (!column->data) { - column->data = (text *) ecalloc(1, PHP_OCI_PIECE_SIZE + 1); + zstr_data.v = ecalloc(1, PHP_OCI_PIECE_SIZE + 1); + column->data = zstr_data.v; } else { - column->data = erealloc(column->data, column->retlen4 + PHP_OCI_PIECE_SIZE + 1); + zstr_data.v = erealloc(column->data, column->retlen4 + PHP_OCI_PIECE_SIZE + 1); + column->data = zstr_data.v; } column->cb_retlen = PHP_OCI_PIECE_SIZE; @@ -230,7 +234,7 @@ (void *) column->oci_define, OCI_HTYPE_DEFINE, statement->err, - ((char*)column->data) + column->retlen4, + ((void*)zstr_data.s) + column->retlen4, &(column->cb_retlen), piecep, &column->indicator, @@ -245,7 +249,7 @@ if (piecewisecols) { for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); if (column && column->piecewise && handlepp == column->oci_define) { column->retlen4 += column->cb_retlen; } @@ -258,7 +262,7 @@ /* do the stuff needed for OCIDefineByName */ for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); if (column == NULL) { continue; } @@ -285,7 +289,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, int column_name_len TSRMLS_DC) +php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, long column_index, zstr column_name, int column_name_len TSRMLS_DC) { php_oci_out_column *column = NULL; int i; @@ -294,13 +298,17 @@ return NULL; } - if (column_name) { + if (column_name.v != NULL) { for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, i + 1, NULL_ZSTR, 0 TSRMLS_CC); if (column == NULL) { continue; - } else if (((int) column->name_len == column_name_len) && (!strncmp(column->name, column_name, column_name_len))) { - return column; + } else if ((int) column->name_len == column_name_len) { + if (!UG(unicode) && !strncmp(column->name.s, column_name.s, column_name_len)) { + return column; + } else if (UG(unicode) && !u_strncmp(column->name.u, column_name.u, column_name_len)) { + return column; + } } } } else if (column_index != -1) { @@ -469,7 +477,7 @@ } outcol->storage_size4 = outcol->data_size; - outcol->retlen = outcol->data_size; + outcol->retlen = TEXT_CHARS(outcol->data_size); /* get scale of the column */ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->scale, (dvoid *)0, OCI_ATTR_SCALE, statement->err)); @@ -502,17 +510,22 @@ } PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - outcol->name = estrndup((char*) colname, outcol->name_len); + if (UG(unicode)) { + outcol->name_len = TEXT_CHARS(outcol->name_len); + outcol->name.u = eustrndup((UChar*) colname, outcol->name_len); + } else { + outcol->name.s = estrndup((char*) colname, outcol->name_len); + } /* find a user-setted define */ if (statement->defines) { - zend_hash_find(statement->defines,outcol->name,outcol->name_len,(void **) &outcol->define); + zend_hash_find(statement->defines, outcol->name.s, TEXT_BYTES(outcol->name_len+1), (void **) &outcol->define); } buf = 0; switch (outcol->data_type) { case SQLT_RSET: - outcol->statement = php_oci_statement_create(statement->connection, NULL, 0 TSRMLS_CC); + outcol->statement = php_oci_statement_create(statement->connection, NULL_ZSTR, 0, 0 TSRMLS_CC); outcol->stmtid = outcol->statement->id; outcol->statement->nested = 1; @@ -544,7 +557,7 @@ descr = php_oci_lob_create(statement->connection, dtype TSRMLS_CC); if (!descr) { - efree(outcol->name); + efree(outcol->name.v); return 1; } outcol->descid = descr->id; @@ -732,6 +745,14 @@ } else if (Z_TYPE_P(bind->zval) == IS_STRING && Z_STRLEN_P(bind->zval) > 0) { Z_STRVAL_P(bind->zval) = erealloc(Z_STRVAL_P(bind->zval), Z_STRLEN_P(bind->zval)+1); Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0'; + } else if (Z_TYPE_P(bind->zval) == IS_UNICODE && Z_UNILEN_P(bind->zval) > 0) { + if (bind->out) { + /* OCI returns _bytes_ as data length for OUT binds */ + Z_UNILEN_P(bind->zval) = TEXT_CHARS(Z_UNILEN_P(bind->zval)); + } + Z_UNIVAL_P(bind->zval).u = eurealloc(Z_UNIVAL_P(bind->zval).u, Z_UNILEN_P(bind->zval)+1); + Z_UNIVAL_P(bind->zval).s[ TEXT_BYTES(Z_UNILEN_P(bind->zval)) - 1 ] = '\0'; + Z_UNIVAL_P(bind->zval).s[ TEXT_BYTES(Z_UNILEN_P(bind->zval)) ] = '\0'; } else if (Z_TYPE_P(bind->zval) == IS_ARRAY) { int i; zval **entry; @@ -779,16 +800,20 @@ php_oci_error(connection->err, connection->errcode TSRMLS_CC); ZVAL_NULL(*entry); } else { - ZVAL_STRINGL(*entry, buff, buff_len, 1); + zstr tmp; + tmp.s = buff; + ZVAL_TEXTL(*entry, tmp, buff_len, 1); } zend_hash_move_forward(hash); } else { + zstr tmp; PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); + tmp.s = buff; if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); add_next_index_null(bind->zval); } else { - add_next_index_stringl(bind->zval, buff, buff_len, 1); + add_next_index_textl(bind->zval, tmp, buff_len, 1); } } } @@ -800,15 +825,20 @@ case SQLT_AVC: case SQLT_STR: case SQLT_LVC: - for (i = 0; i < bind->array.current_length; i++) { - /* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */ - int curr_element_length = bind->array.element_lengths[i]; - if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { - zval_dtor(*entry); - ZVAL_STRINGL(*entry, ((text *)bind->array.elements)+i*bind->array.max_length, curr_element_length, 1); - zend_hash_move_forward(hash); - } else { - add_next_index_stringl(bind->zval, ((text *)bind->array.elements)+i*bind->array.max_length, curr_element_length, 1); + { + zstr tmp; + for (i = 0; i < bind->array.current_length; i++) { + /* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */ + int curr_element_length = bind->array.element_lengths[i]; + if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { + zval_dtor(*entry); + tmp.s = ((text *)bind->array.elements)+i*bind->array.max_length; + ZVAL_TEXTL(*entry, tmp, curr_element_length, 1); + zend_hash_move_forward(hash); + } else { + tmp.s = ((text *)bind->array.elements)+i*bind->array.max_length; + add_next_index_textl(bind->zval, tmp, curr_element_length, 1); + } } } break; @@ -821,7 +851,7 @@ /* {{{ php_oci_bind_by_name() Bind zval to the given placeholder */ -int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval* var, long maxlength, long type TSRMLS_DC) +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) { php_oci_collection *bind_collection = NULL; php_oci_descriptor *bind_descriptor = NULL; @@ -894,10 +924,20 @@ case SQLT_CHR: /* this is the default case when type was not specified */ if (Z_TYPE_P(var) != IS_NULL) { - convert_to_string(var); + convert_to_text(var); } if (maxlength == -1) { - value_sz = (Z_TYPE_P(var) == IS_STRING) ? Z_STRLEN_P(var) : 0; + switch (Z_TYPE_P(var)) { + case IS_STRING: + value_sz = Z_STRLEN_P(var); + break; + case IS_UNICODE: + value_sz = Z_UNILEN_P(var); + break; + default: + value_sz = 0; + break; + } } else { value_sz = maxlength; } @@ -930,13 +970,13 @@ } memset((void*)&bind,0,sizeof(php_oci_bind)); - if (zend_hash_find(statement->binds, name, name_len + 1, (void **)&old_bind) == SUCCESS) { + if (zend_hash_find(statement->binds, name.s, USTR_BYTES(uni_type, name_len + 1), (void **)&old_bind) == SUCCESS) { bindp = old_bind; if (bindp->zval) { zval_ptr_dtor(&bindp->zval); } } else { - zend_hash_update(statement->binds, name, name_len + 1, &bind, sizeof(php_oci_bind), (void **)&bindp); + zend_hash_update(statement->binds, name.s, USTR_BYTES(uni_type, name_len + 1), &bind, sizeof(php_oci_bind), (void **)&bindp); } bindp->descriptor = oci_desc; @@ -951,10 +991,10 @@ statement->stmt, /* statement handle */ (OCIBind **)&bindp->bind, /* bind hdl (will alloc) */ statement->err, /* error handle */ - (text*) name, /* placeholder name */ - name_len, /* placeholder length */ + (text*) name.s, /* placeholder name */ + USTR_BYTES(uni_type, name_len), /* placeholder length */ (dvoid *)bind_data, /* in/out data */ - value_sz, /* PHP_OCI_MAX_DATA_SIZE, */ /* max size of input/output data */ + TEXT_BYTES(value_sz), /* PHP_OCI_MAX_DATA_SIZE, */ /* max size of input/output data */ (ub2)type, /* in/out data type */ (dvoid *)&bindp->indicator, /* indicator (ignored) */ (ub2 *)0, /* size array (ignored) */ @@ -1045,10 +1085,15 @@ *indpp = (dvoid *)&phpbind->indicator; } else if ((phpbind->descriptor == 0) && (phpbind->statement == 0)) { /* "normal string bind */ - convert_to_string(val); + convert_to_text(val); - *bufpp = Z_STRVAL_P(val); - *alenp = Z_STRLEN_P(val); + if (UG(unicode)) { + *bufpp = Z_UNIVAL_P(val).v; + *alenp = UBYTES(Z_UNILEN_P(val)); + } else { + *bufpp = Z_STRVAL_P(val); + *alenp = Z_STRLEN_P(val); + } *indpp = (dvoid *)&phpbind->indicator; } else if (phpbind->statement != 0) { /* RSET */ @@ -1089,25 +1134,41 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value"); return retval; } + + phpbind->out = 1; /* mark as OUT bind */ if ((Z_TYPE_P(val) == IS_OBJECT) || (Z_TYPE_P(val) == IS_RESOURCE)) { retval = OCI_CONTINUE; - } else { - convert_to_string(val); - zval_dtor(val); - - Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */ - Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(phpbind->zval) + 1); - - /* XXX we assume that zend-zval len has 4 bytes */ - *alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval); - *bufpp = Z_STRVAL_P(phpbind->zval); - *piecep = OCI_ONE_PIECE; - *rcodepp = &phpbind->retcode; - *indpp = &phpbind->indicator; - retval = OCI_CONTINUE; + } else { + if (UG(unicode)) { + convert_to_unicode(val); + zval_dtor(val); + + Z_UNILEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */ + Z_UNIVAL_P(val).v = ecalloc(1, UBYTES(Z_UNILEN_P(phpbind->zval) + 1)); + + *alenpp = (ub4*) &Z_UNILEN_P(phpbind->zval); + *bufpp = Z_UNIVAL_P(phpbind->zval).v; + *piecep = OCI_ONE_PIECE; + *rcodepp = &phpbind->retcode; + *indpp = &phpbind->indicator; + retval = OCI_CONTINUE; + } else { + convert_to_string(val); + zval_dtor(val); + + Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */ + Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(phpbind->zval) + 1); + + /* XXX we assume that zend-zval len has 4 bytes */ + *alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval); + *bufpp = Z_STRVAL_P(phpbind->zval); + *piecep = OCI_ONE_PIECE; + *rcodepp = &phpbind->retcode; + *indpp = &phpbind->indicator; + retval = OCI_CONTINUE; + } } - return retval; } /* }}} */ @@ -1134,15 +1195,15 @@ return NULL; } - if (Z_TYPE_PP(column_index) == IS_STRING) { - column = php_oci_statement_get_column(statement, -1, Z_STRVAL_PP(column_index), Z_STRLEN_PP(column_index) TSRMLS_CC); + if (Z_TYPE_PP(column_index) == IS_STRING || Z_TYPE_PP(column_index) == IS_UNICODE) { + column = php_oci_statement_get_column(statement, -1, Z_UNIVAL_PP(column_index), Z_UNILEN_PP(column_index) TSRMLS_CC); if (!column) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_PP(column_index)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column name \"%v\"", Z_UNIVAL_PP(column_index)); return NULL; } } else { convert_to_long_ex(column_index); - column = php_oci_statement_get_column(statement, Z_LVAL_PP(column_index), NULL, 0 TSRMLS_CC); + column = php_oci_statement_get_column(statement, Z_LVAL_PP(column_index), NULL_ZSTR, 0 TSRMLS_CC); if (!column) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%ld\"", Z_LVAL_PP(column_index)); return NULL; @@ -1195,7 +1256,7 @@ /* {{{ php_oci_bind_array_by_name() Bind arrays to PL/SQL types */ -int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval* var, long max_table_length, long maxlength, long type TSRMLS_DC) +int php_oci_bind_array_by_name(php_oci_statement *statement, zstr name, int name_len, zval* var, long max_table_length, long maxlength, long type, zend_uchar uni_type TSRMLS_DC) { php_oci_bind *bind, *bindp; @@ -1248,7 +1309,7 @@ zend_hash_init(statement->binds, 13, NULL, php_oci_bind_hash_dtor, 0); } - zend_hash_update(statement->binds, name, name_len + 1, bind, sizeof(php_oci_bind), (void **)&bindp); + zend_hash_update(statement->binds, name.s, USTR_BYTES(uni_type, name_len + 1), bind, sizeof(php_oci_bind), (void **)&bindp); bindp->descriptor = NULL; bindp->statement = NULL; @@ -1264,10 +1325,10 @@ statement->stmt, (OCIBind **)&bindp->bind, statement->err, - (text *)name, - name_len, + (text *)name.s, + USTR_BYTES(uni_type, name_len), (dvoid *) bindp->array.elements, - (sb4) bind->array.max_length, + (sb4) USTR_BYTES(uni_type, bind->array.max_length), type, (dvoid *)0, /* bindp->array.indicators, */ (ub2 *)bind->array.element_lengths, @@ -1303,9 +1364,9 @@ if (maxlength == -1) { zend_hash_internal_pointer_reset(hash); while (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) { - convert_to_string_ex(entry); - if (Z_STRLEN_PP(entry) > maxlength) { - maxlength = Z_STRLEN_PP(entry) + 1; + convert_to_text_ex(entry); + if (Z_UNILEN_PP(entry) > maxlength) { + maxlength = Z_UNILEN_PP(entry) + 1; } zend_hash_move_forward(hash); } @@ -1322,8 +1383,8 @@ for (i = 0; i < bind->array.current_length; i++) { if (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) { - convert_to_string_ex(entry); - bind->array.element_lengths[i] = Z_STRLEN_PP(entry); + convert_to_text_ex(entry); + bind->array.element_lengths[i] = Z_UNILEN_PP(entry); zend_hash_move_forward(hash); } else { break; @@ -1335,10 +1396,10 @@ if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { int element_length; - convert_to_string_ex(entry); - element_length = (maxlength > Z_STRLEN_PP(entry)) ? Z_STRLEN_PP(entry) : maxlength; + convert_to_text_ex(entry); + element_length = (maxlength > Z_UNILEN_PP(entry)) ? Z_UNILEN_PP(entry) : maxlength; - memcpy((text *)bind->array.elements + i*maxlength, Z_STRVAL_PP(entry), element_length); + memcpy((text *)bind->array.elements + i*maxlength, Z_UNIVAL_PP(entry).s, element_length); ((text *)bind->array.elements)[i*maxlength + element_length] = '\0'; zend_hash_move_forward(hash); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/php_oci8_int.h?r1=1.23&r2=1.24&diff_format=u Index: php-src/ext/oci8/php_oci8_int.h diff -u php-src/ext/oci8/php_oci8_int.h:1.23 php-src/ext/oci8/php_oci8_int.h:1.24 --- php-src/ext/oci8/php_oci8_int.h:1.23 Fri Nov 10 16:33:28 2006 +++ php-src/ext/oci8/php_oci8_int.h Fri Nov 10 16:56:19 2006 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_oci8_int.h,v 1.23 2006/11/10 16:33:28 tony2001 Exp $ */ +/* $Id: php_oci8_int.h,v 1.24 2006/11/10 16:56:19 tony2001 Exp $ */ #if HAVE_OCI8 # ifndef PHP_OCI8_INT_H @@ -97,6 +97,11 @@ /* }}} */ +typedef enum { + OCI_IS_CLOB=1, + OCI_IS_BLOB +} php_oci_lob_type; + typedef struct { /* php_oci_connection {{{ */ OCIEnv *env; /* private env handle */ ub2 charset; /* charset ID */ @@ -116,19 +121,21 @@ time_t idle_expiry; /* time when the connection will be considered as expired */ time_t next_ping; /* time of the next ping */ char *hash_key; /* hashed details of the connection */ + int hash_key_len; } php_oci_connection; /* }}} */ typedef struct { /* php_oci_descriptor {{{ */ int id; php_oci_connection *connection; /* parent connection handle */ dvoid *descriptor; /* OCI descriptor handle */ - ub4 type; /* descriptor type */ + ub4 type; /* descriptor type (FILE/LOB) */ int lob_current_position; /* LOB internal pointer */ int lob_size; /* cached LOB size. -1 = Lob wasn't initialized yet */ int buffering; /* cached buffering flag. 0 - off, 1 - on, 2 - on and buffer was used */ ub4 chunk_size; /* chunk size of the LOB. 0 - unknown */ ub1 charset_form; /* charset form, required for NCLOBs */ ub2 charset_id; /* charset ID */ + php_oci_lob_type lob_type; /* CLOB/BLOB */ } php_oci_descriptor; /* }}} */ typedef struct { /* php_oci_lob_ctx {{{ */ @@ -149,7 +156,8 @@ typedef struct { /* php_oci_define {{{ */ zval *zval; /* zval used in define */ - text *name; /* placeholder's name */ + zstr name; /* placeholder's name */ + zend_uchar name_type; /* unicode or not */ ub4 name_len; /* placeholder's name length */ ub4 type; /* define type */ } php_oci_define; /* }}} */ @@ -190,12 +198,13 @@ } array; sb2 indicator; /* -1 means NULL */ ub2 retcode; /* */ + zend_bool out; /* OUT bind or not */ } php_oci_bind; /* }}} */ typedef struct { /* php_oci_out_column {{{ */ php_oci_statement *statement; /* statement handle. used when fetching REFCURSORS */ OCIDefine *oci_define; /* define handle */ - char *name; /* column name */ + zstr name; /* column name */ ub4 name_len; /* column name length */ ub2 data_type; /* column data type */ ub2 data_size; /* data size */ @@ -302,17 +311,17 @@ sb4 php_oci_error (OCIError *, sword TSRMLS_DC); sb4 php_oci_fetch_errmsg(OCIError *, text ** TSRMLS_DC); #ifdef HAVE_OCI8_ATTR_STATEMENT -int php_oci_fetch_sqltext_offset(php_oci_statement *, text **, ub2 * TSRMLS_DC); +int php_oci_fetch_sqltext_offset(php_oci_statement *, zstr *, ub2 * TSRMLS_DC); #endif void php_oci_do_connect (INTERNAL_FUNCTION_PARAMETERS, int , int); -php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC); +php_oci_connection *php_oci_do_connect_ex(zstr username, int username_len, zstr password, int password_len, zstr new_password, int new_password_len, zstr dbname, int dbname_len, zstr charset, long session_mode, int persistent, int exclusive, zend_uchar type TSRMLS_DC); int php_oci_connection_rollback(php_oci_connection * TSRMLS_DC); int php_oci_connection_commit(php_oci_connection * TSRMLS_DC); -int php_oci_password_change(php_oci_connection *, char *, int, char *, int, char *, int TSRMLS_DC); -int php_oci_server_get_version(php_oci_connection *, char ** TSRMLS_DC); +int php_oci_password_change(php_oci_connection *, zstr, int, zstr, int, zstr, int, zend_uchar TSRMLS_DC); +int php_oci_server_get_version(php_oci_connection *, zstr* TSRMLS_DC); void php_oci_fetch_row(INTERNAL_FUNCTION_PARAMETERS, int, int); int php_oci_column_to_zval(php_oci_out_column *, zval *, int TSRMLS_DC); @@ -323,15 +332,16 @@ php_oci_descriptor * php_oci_lob_create (php_oci_connection *, long TSRMLS_DC); int php_oci_lob_get_length (php_oci_descriptor *, ub4 * TSRMLS_DC); -int php_oci_lob_read (php_oci_descriptor *, long, long, char **, ub4 * TSRMLS_DC); -int php_oci_lob_write (php_oci_descriptor *, ub4, char *, int, ub4 * TSRMLS_DC); +int php_oci_lob_get_type(php_oci_descriptor *descriptor, php_oci_lob_type *lob_type TSRMLS_DC); +int php_oci_lob_read (php_oci_descriptor *, long, long, zstr *, ub4 * TSRMLS_DC); +int php_oci_lob_write (php_oci_descriptor *, ub4, zstr, 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 *); 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); -int php_oci_lob_write_tmp (php_oci_descriptor *, ub1, char *, int TSRMLS_DC); +int php_oci_lob_write_tmp (php_oci_descriptor *, ub1, zstr, int TSRMLS_DC); #endif void php_oci_lob_free(php_oci_descriptor * TSRMLS_DC); int php_oci_lob_import(php_oci_descriptor *descriptor, char * TSRMLS_DC); @@ -344,51 +354,50 @@ #else sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, ub4 len, ub1 piece); #endif - /* }}} */ /* collection related prototypes {{{ */ -php_oci_collection * php_oci_collection_create(php_oci_connection *, char *, int, char *, int TSRMLS_DC); +php_oci_collection * php_oci_collection_create(php_oci_connection *, zstr, int, zstr, int TSRMLS_DC); int php_oci_collection_size(php_oci_collection *, sb4 * TSRMLS_DC); int php_oci_collection_max(php_oci_collection *, long * TSRMLS_DC); int php_oci_collection_trim(php_oci_collection *, long TSRMLS_DC); -int php_oci_collection_append(php_oci_collection *, char *, int TSRMLS_DC); +int php_oci_collection_append(php_oci_collection *, zstr, int TSRMLS_DC); int php_oci_collection_element_get(php_oci_collection *, long, zval** TSRMLS_DC); -int php_oci_collection_element_set(php_oci_collection *, long, char*, int TSRMLS_DC); +int php_oci_collection_element_set(php_oci_collection *, long, zstr, int TSRMLS_DC); int php_oci_collection_element_set_null(php_oci_collection *, long TSRMLS_DC); -int php_oci_collection_element_set_date(php_oci_collection *, long, char *, int TSRMLS_DC); -int php_oci_collection_element_set_number(php_oci_collection *, long, char *, int TSRMLS_DC); -int php_oci_collection_element_set_string(php_oci_collection *, long, char *, int TSRMLS_DC); +int php_oci_collection_element_set_date(php_oci_collection *, long, zstr, int TSRMLS_DC); +int php_oci_collection_element_set_number(php_oci_collection *, long, zstr, int TSRMLS_DC); +int php_oci_collection_element_set_string(php_oci_collection *, long, zstr, int TSRMLS_DC); int php_oci_collection_assign(php_oci_collection *, php_oci_collection * TSRMLS_DC); void php_oci_collection_close(php_oci_collection * TSRMLS_DC); int php_oci_collection_append_null(php_oci_collection * TSRMLS_DC); -int php_oci_collection_append_date(php_oci_collection *, char *, int TSRMLS_DC); -int php_oci_collection_append_number(php_oci_collection *, char *, int TSRMLS_DC); -int php_oci_collection_append_string(php_oci_collection *, char *, int TSRMLS_DC); +int php_oci_collection_append_date(php_oci_collection *, zstr, int TSRMLS_DC); +int php_oci_collection_append_number(php_oci_collection *, zstr, int TSRMLS_DC); +int php_oci_collection_append_string(php_oci_collection *, zstr, int TSRMLS_DC); /* }}} */ /* statement related prototypes {{{ */ -php_oci_statement * php_oci_statement_create (php_oci_connection *, char *, int TSRMLS_DC); +php_oci_statement * php_oci_statement_create (php_oci_connection *, zstr, int, zend_uchar 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*, int TSRMLS_DC); +php_oci_out_column * php_oci_statement_get_column (php_oci_statement *, long, zstr, 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); int php_oci_bind_pre_exec(void *data TSRMLS_DC); int php_oci_bind_post_exec(void *data TSRMLS_DC); -int php_oci_bind_by_name(php_oci_statement *, char *, int, zval*, long, long TSRMLS_DC); +int php_oci_bind_by_name(php_oci_statement *, zstr, int, zval*, long, long, zend_uchar TSRMLS_DC); sb4 php_oci_bind_in_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 *, ub1 *, dvoid **); sb4 php_oci_bind_out_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 **, ub1 *, dvoid **, ub2 **); php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data); int php_oci_statement_get_type(php_oci_statement *, ub2 * TSRMLS_DC); int php_oci_statement_get_numrows(php_oci_statement *, ub4 * TSRMLS_DC); -int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval* var, long max_table_length, long maxlength, long type TSRMLS_DC); +int php_oci_bind_array_by_name(php_oci_statement *statement, zstr name, int name_len, zval* var, long max_table_length, long maxlength, long type, zend_uchar uni_type TSRMLS_DC); php_oci_bind *php_oci_bind_array_helper_number(zval* var, long max_table_length TSRMLS_DC); php_oci_bind *php_oci_bind_array_helper_double(zval* var, long max_table_length TSRMLS_DC); php_oci_bind *php_oci_bind_array_helper_string(zval* var, long max_table_length, long maxlength TSRMLS_DC); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/array_bind_005.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/array_bind_005.phpt diff -u php-src/ext/oci8/tests/array_bind_005.phpt:1.3 php-src/ext/oci8/tests/array_bind_005.phpt:1.4 --- php-src/ext/oci8/tests/array_bind_005.phpt:1.3 Mon Jul 31 10:28:46 2006 +++ php-src/ext/oci8/tests/array_bind_005.phpt Fri Nov 10 16:56:19 2006 @@ -73,3 +73,18 @@ string(0) "" } Done +--UEXPECTF-- +Warning: oci_execute(): ORA-01405: fetched column value is NULL in %s on line %d +array(5) { + [0]=> + unicode(0) "" + [1]=> + unicode(0) "" + [2]=> + unicode(0) "" + [3]=> + unicode(0) "" + [4]=> + unicode(0) "" +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/array_bind_008.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/oci8/tests/array_bind_008.phpt diff -u php-src/ext/oci8/tests/array_bind_008.phpt:1.2 php-src/ext/oci8/tests/array_bind_008.phpt:1.3 --- php-src/ext/oci8/tests/array_bind_008.phpt:1.2 Thu Dec 8 22:31:55 2005 +++ php-src/ext/oci8/tests/array_bind_008.phpt Fri Nov 10 16:56:19 2006 @@ -76,3 +76,21 @@ string(1) "5" } Done +--UEXPECTF-- +Warning: oci_execute(): ORA-06550: line 1, column 28: +PLS-00418: array bind type must match PL/SQL table row type +ORA-06550: line 1, column 7: +PL/SQL: Statement ignored in %s on line %d +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "2" + [2]=> + unicode(1) "3" + [3]=> + unicode(1) "4" + [4]=> + unicode(1) "5" +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/array_bind_010.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/oci8/tests/array_bind_010.phpt diff -u php-src/ext/oci8/tests/array_bind_010.phpt:1.2 php-src/ext/oci8/tests/array_bind_010.phpt:1.3 --- php-src/ext/oci8/tests/array_bind_010.phpt:1.2 Thu Dec 8 22:31:55 2005 +++ php-src/ext/oci8/tests/array_bind_010.phpt Fri Nov 10 16:56:19 2006 @@ -1,5 +1,5 @@ --TEST-- -oci_bind_array_by_name() and invalid values 8 +oci_bind_array_by_name() and invalid values 10 --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --FILE-- @@ -34,3 +34,18 @@ string(1) "5" } Done +--UEXPECTF-- +Warning: oci_bind_array_by_name(): ORA-01036: illegal variable name/number in %s on line %d +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "2" + [2]=> + unicode(1) "3" + [3]=> + unicode(1) "4" + [4]=> + unicode(1) "5" +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bind_long.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/bind_long.phpt diff -u php-src/ext/oci8/tests/bind_long.phpt:1.4 php-src/ext/oci8/tests/bind_long.phpt:1.5 --- php-src/ext/oci8/tests/bind_long.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/bind_long.phpt Fri Nov 10 16:56:19 2006 @@ -23,7 +23,7 @@ oci_execute($stmt); $row = oci_fetch_row($stmt); -var_dump(md5($row[0])); +var_dump(md5((binary)$row[0])); var_dump(strlen($row[0])); $stmt = oci_parse($c, "drop table phptestlng"); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bind_long_raw.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/bind_long_raw.phpt diff -u php-src/ext/oci8/tests/bind_long_raw.phpt:1.3 php-src/ext/oci8/tests/bind_long_raw.phpt:1.4 --- php-src/ext/oci8/tests/bind_long_raw.phpt:1.3 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/bind_long_raw.phpt Fri Nov 10 16:56:19 2006 @@ -23,7 +23,7 @@ oci_execute($stmt); $row = oci_fetch_row($stmt); -var_dump(md5($row[0])); +var_dump(md5((binary)$row[0])); var_dump(strlen($row[0])); $stmt = oci_parse($c, "drop table phptestlngraw"); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bind_raw.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/bind_raw.phpt diff -u php-src/ext/oci8/tests/bind_raw.phpt:1.3 php-src/ext/oci8/tests/bind_raw.phpt:1.4 --- php-src/ext/oci8/tests/bind_raw.phpt:1.3 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/bind_raw.phpt Fri Nov 10 16:56:19 2006 @@ -24,7 +24,7 @@ oci_execute($stmt); $row = oci_fetch_row($stmt); -var_dump(md5($row[0])); +var_dump(md5((binary)$row[0])); var_dump(strlen($row[0])); $stmt = oci_parse($c, "drop table phptestrawtable"); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bug27303_2.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/bug27303_2.phpt diff -u php-src/ext/oci8/tests/bug27303_2.phpt:1.3 php-src/ext/oci8/tests/bug27303_2.phpt:1.4 --- php-src/ext/oci8/tests/bug27303_2.phpt:1.3 Tue Dec 6 19:26:56 2005 +++ php-src/ext/oci8/tests/bug27303_2.phpt Fri Nov 10 16:56:19 2006 @@ -250,3 +250,204 @@ string(3) "198" string(3) "199" Done +--UEXPECTF-- +unicode(1) "1" +unicode(1) "2" +unicode(1) "3" +unicode(1) "4" +unicode(1) "5" +unicode(1) "6" +unicode(1) "7" +unicode(1) "8" +unicode(1) "9" +unicode(2) "10" +unicode(2) "11" +unicode(2) "12" +unicode(2) "13" +unicode(2) "14" +unicode(2) "15" +unicode(2) "16" +unicode(2) "17" +unicode(2) "18" +unicode(2) "19" +unicode(2) "20" +unicode(2) "21" +unicode(2) "22" +unicode(2) "23" +unicode(2) "24" +unicode(2) "25" +unicode(2) "26" +unicode(2) "27" +unicode(2) "28" +unicode(2) "29" +unicode(2) "30" +unicode(2) "31" +unicode(2) "32" +unicode(2) "33" +unicode(2) "34" +unicode(2) "35" +unicode(2) "36" +unicode(2) "37" +unicode(2) "38" +unicode(2) "39" +unicode(2) "40" +unicode(2) "41" +unicode(2) "42" +unicode(2) "43" +unicode(2) "44" +unicode(2) "45" +unicode(2) "46" +unicode(2) "47" +unicode(2) "48" +unicode(2) "49" +unicode(2) "50" +unicode(2) "51" +unicode(2) "52" +unicode(2) "53" +unicode(2) "54" +unicode(2) "55" +unicode(2) "56" +unicode(2) "57" +unicode(2) "58" +unicode(2) "59" +unicode(2) "60" +unicode(2) "61" +unicode(2) "62" +unicode(2) "63" +unicode(2) "64" +unicode(2) "65" +unicode(2) "66" +unicode(2) "67" +unicode(2) "68" +unicode(2) "69" +unicode(2) "70" +unicode(2) "71" +unicode(2) "72" +unicode(2) "73" +unicode(2) "74" +unicode(2) "75" +unicode(2) "76" +unicode(2) "77" +unicode(2) "78" +unicode(2) "79" +unicode(2) "80" +unicode(2) "81" +unicode(2) "82" +unicode(2) "83" +unicode(2) "84" +unicode(2) "85" +unicode(2) "86" +unicode(2) "87" +unicode(2) "88" +unicode(2) "89" +unicode(2) "90" +unicode(2) "91" +unicode(2) "92" +unicode(2) "93" +unicode(2) "94" +unicode(2) "95" +unicode(2) "96" +unicode(2) "97" +unicode(2) "98" +unicode(2) "99" +unicode(3) "100" +unicode(3) "101" +unicode(3) "102" +unicode(3) "103" +unicode(3) "104" +unicode(3) "105" +unicode(3) "106" +unicode(3) "107" +unicode(3) "108" +unicode(3) "109" +unicode(3) "110" +unicode(3) "111" +unicode(3) "112" +unicode(3) "113" +unicode(3) "114" +unicode(3) "115" +unicode(3) "116" +unicode(3) "117" +unicode(3) "118" +unicode(3) "119" +unicode(3) "120" +unicode(3) "121" +unicode(3) "122" +unicode(3) "123" +unicode(3) "124" +unicode(3) "125" +unicode(3) "126" +unicode(3) "127" +unicode(3) "128" +unicode(3) "129" +unicode(3) "130" +unicode(3) "131" +unicode(3) "132" +unicode(3) "133" +unicode(3) "134" +unicode(3) "135" +unicode(3) "136" +unicode(3) "137" +unicode(3) "138" +unicode(3) "139" +unicode(3) "140" +unicode(3) "141" +unicode(3) "142" +unicode(3) "143" +unicode(3) "144" +unicode(3) "145" +unicode(3) "146" +unicode(3) "147" +unicode(3) "148" +unicode(3) "149" +unicode(3) "150" +unicode(3) "151" +unicode(3) "152" +unicode(3) "153" +unicode(3) "154" +unicode(3) "155" +unicode(3) "156" +unicode(3) "157" +unicode(3) "158" +unicode(3) "159" +unicode(3) "160" +unicode(3) "161" +unicode(3) "162" +unicode(3) "163" +unicode(3) "164" +unicode(3) "165" +unicode(3) "166" +unicode(3) "167" +unicode(3) "168" +unicode(3) "169" +unicode(3) "170" +unicode(3) "171" +unicode(3) "172" +unicode(3) "173" +unicode(3) "174" +unicode(3) "175" +unicode(3) "176" +unicode(3) "177" +unicode(3) "178" +unicode(3) "179" +unicode(3) "180" +unicode(3) "181" +unicode(3) "182" +unicode(3) "183" +unicode(3) "184" +unicode(3) "185" +unicode(3) "186" +unicode(3) "187" +unicode(3) "188" +unicode(3) "189" +unicode(3) "190" +unicode(3) "191" +unicode(3) "192" +unicode(3) "193" +unicode(3) "194" +unicode(3) "195" +unicode(3) "196" +unicode(3) "197" +unicode(3) "198" +unicode(3) "199" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bug27303_4.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/bug27303_4.phpt diff -u php-src/ext/oci8/tests/bug27303_4.phpt:1.3 php-src/ext/oci8/tests/bug27303_4.phpt:1.4 --- php-src/ext/oci8/tests/bug27303_4.phpt:1.3 Tue Dec 6 19:26:56 2005 +++ php-src/ext/oci8/tests/bug27303_4.phpt Fri Nov 10 16:56:19 2006 @@ -250,3 +250,204 @@ string(3) "198" string(3) "199" Done +--UEXPECTF-- +unicode(1) "1" +unicode(1) "2" +unicode(1) "3" +unicode(1) "4" +unicode(1) "5" +unicode(1) "6" +unicode(1) "7" +unicode(1) "8" +unicode(1) "9" +unicode(2) "10" +unicode(2) "11" +unicode(2) "12" +unicode(2) "13" +unicode(2) "14" +unicode(2) "15" +unicode(2) "16" +unicode(2) "17" +unicode(2) "18" +unicode(2) "19" +unicode(2) "20" +unicode(2) "21" +unicode(2) "22" +unicode(2) "23" +unicode(2) "24" +unicode(2) "25" +unicode(2) "26" +unicode(2) "27" +unicode(2) "28" +unicode(2) "29" +unicode(2) "30" +unicode(2) "31" +unicode(2) "32" +unicode(2) "33" +unicode(2) "34" +unicode(2) "35" +unicode(2) "36" +unicode(2) "37" +unicode(2) "38" +unicode(2) "39" +unicode(2) "40" +unicode(2) "41" +unicode(2) "42" +unicode(2) "43" +unicode(2) "44" +unicode(2) "45" +unicode(2) "46" +unicode(2) "47" +unicode(2) "48" +unicode(2) "49" +unicode(2) "50" +unicode(2) "51" +unicode(2) "52" +unicode(2) "53" +unicode(2) "54" +unicode(2) "55" +unicode(2) "56" +unicode(2) "57" +unicode(2) "58" +unicode(2) "59" +unicode(2) "60" +unicode(2) "61" +unicode(2) "62" +unicode(2) "63" +unicode(2) "64" +unicode(2) "65" +unicode(2) "66" +unicode(2) "67" +unicode(2) "68" +unicode(2) "69" +unicode(2) "70" +unicode(2) "71" +unicode(2) "72" +unicode(2) "73" +unicode(2) "74" +unicode(2) "75" +unicode(2) "76" +unicode(2) "77" +unicode(2) "78" +unicode(2) "79" +unicode(2) "80" +unicode(2) "81" +unicode(2) "82" +unicode(2) "83" +unicode(2) "84" +unicode(2) "85" +unicode(2) "86" +unicode(2) "87" +unicode(2) "88" +unicode(2) "89" +unicode(2) "90" +unicode(2) "91" +unicode(2) "92" +unicode(2) "93" +unicode(2) "94" +unicode(2) "95" +unicode(2) "96" +unicode(2) "97" +unicode(2) "98" +unicode(2) "99" +unicode(3) "100" +unicode(3) "101" +unicode(3) "102" +unicode(3) "103" +unicode(3) "104" +unicode(3) "105" +unicode(3) "106" +unicode(3) "107" +unicode(3) "108" +unicode(3) "109" +unicode(3) "110" +unicode(3) "111" +unicode(3) "112" +unicode(3) "113" +unicode(3) "114" +unicode(3) "115" +unicode(3) "116" +unicode(3) "117" +unicode(3) "118" +unicode(3) "119" +unicode(3) "120" +unicode(3) "121" +unicode(3) "122" +unicode(3) "123" +unicode(3) "124" +unicode(3) "125" +unicode(3) "126" +unicode(3) "127" +unicode(3) "128" +unicode(3) "129" +unicode(3) "130" +unicode(3) "131" +unicode(3) "132" +unicode(3) "133" +unicode(3) "134" +unicode(3) "135" +unicode(3) "136" +unicode(3) "137" +unicode(3) "138" +unicode(3) "139" +unicode(3) "140" +unicode(3) "141" +unicode(3) "142" +unicode(3) "143" +unicode(3) "144" +unicode(3) "145" +unicode(3) "146" +unicode(3) "147" +unicode(3) "148" +unicode(3) "149" +unicode(3) "150" +unicode(3) "151" +unicode(3) "152" +unicode(3) "153" +unicode(3) "154" +unicode(3) "155" +unicode(3) "156" +unicode(3) "157" +unicode(3) "158" +unicode(3) "159" +unicode(3) "160" +unicode(3) "161" +unicode(3) "162" +unicode(3) "163" +unicode(3) "164" +unicode(3) "165" +unicode(3) "166" +unicode(3) "167" +unicode(3) "168" +unicode(3) "169" +unicode(3) "170" +unicode(3) "171" +unicode(3) "172" +unicode(3) "173" +unicode(3) "174" +unicode(3) "175" +unicode(3) "176" +unicode(3) "177" +unicode(3) "178" +unicode(3) "179" +unicode(3) "180" +unicode(3) "181" +unicode(3) "182" +unicode(3) "183" +unicode(3) "184" +unicode(3) "185" +unicode(3) "186" +unicode(3) "187" +unicode(3) "188" +unicode(3) "189" +unicode(3) "190" +unicode(3) "191" +unicode(3) "192" +unicode(3) "193" +unicode(3) "194" +unicode(3) "195" +unicode(3) "196" +unicode(3) "197" +unicode(3) "198" +unicode(3) "199" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bug27303.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/bug27303.phpt diff -u php-src/ext/oci8/tests/bug27303.phpt:1.3 php-src/ext/oci8/tests/bug27303.phpt:1.4 --- php-src/ext/oci8/tests/bug27303.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/bug27303.phpt Fri Nov 10 16:56:19 2006 @@ -250,3 +250,204 @@ string(3) "198" string(3) "199" Done +--UEXPECTF-- +unicode(1) "1" +unicode(1) "2" +unicode(1) "3" +unicode(1) "4" +unicode(1) "5" +unicode(1) "6" +unicode(1) "7" +unicode(1) "8" +unicode(1) "9" +unicode(2) "10" +unicode(2) "11" +unicode(2) "12" +unicode(2) "13" +unicode(2) "14" +unicode(2) "15" +unicode(2) "16" +unicode(2) "17" +unicode(2) "18" +unicode(2) "19" +unicode(2) "20" +unicode(2) "21" +unicode(2) "22" +unicode(2) "23" +unicode(2) "24" +unicode(2) "25" +unicode(2) "26" +unicode(2) "27" +unicode(2) "28" +unicode(2) "29" +unicode(2) "30" +unicode(2) "31" +unicode(2) "32" +unicode(2) "33" +unicode(2) "34" +unicode(2) "35" +unicode(2) "36" +unicode(2) "37" +unicode(2) "38" +unicode(2) "39" +unicode(2) "40" +unicode(2) "41" +unicode(2) "42" +unicode(2) "43" +unicode(2) "44" +unicode(2) "45" +unicode(2) "46" +unicode(2) "47" +unicode(2) "48" +unicode(2) "49" +unicode(2) "50" +unicode(2) "51" +unicode(2) "52" +unicode(2) "53" +unicode(2) "54" +unicode(2) "55" +unicode(2) "56" +unicode(2) "57" +unicode(2) "58" +unicode(2) "59" +unicode(2) "60" +unicode(2) "61" +unicode(2) "62" +unicode(2) "63" +unicode(2) "64" +unicode(2) "65" +unicode(2) "66" +unicode(2) "67" +unicode(2) "68" +unicode(2) "69" +unicode(2) "70" +unicode(2) "71" +unicode(2) "72" +unicode(2) "73" +unicode(2) "74" +unicode(2) "75" +unicode(2) "76" +unicode(2) "77" +unicode(2) "78" +unicode(2) "79" +unicode(2) "80" +unicode(2) "81" +unicode(2) "82" +unicode(2) "83" +unicode(2) "84" +unicode(2) "85" +unicode(2) "86" +unicode(2) "87" +unicode(2) "88" +unicode(2) "89" +unicode(2) "90" +unicode(2) "91" +unicode(2) "92" +unicode(2) "93" +unicode(2) "94" +unicode(2) "95" +unicode(2) "96" +unicode(2) "97" +unicode(2) "98" +unicode(2) "99" +unicode(3) "100" +unicode(3) "101" +unicode(3) "102" +unicode(3) "103" +unicode(3) "104" +unicode(3) "105" +unicode(3) "106" +unicode(3) "107" +unicode(3) "108" +unicode(3) "109" +unicode(3) "110" +unicode(3) "111" +unicode(3) "112" +unicode(3) "113" +unicode(3) "114" +unicode(3) "115" +unicode(3) "116" +unicode(3) "117" +unicode(3) "118" +unicode(3) "119" +unicode(3) "120" +unicode(3) "121" +unicode(3) "122" +unicode(3) "123" +unicode(3) "124" +unicode(3) "125" +unicode(3) "126" +unicode(3) "127" +unicode(3) "128" +unicode(3) "129" +unicode(3) "130" +unicode(3) "131" +unicode(3) "132" +unicode(3) "133" +unicode(3) "134" +unicode(3) "135" +unicode(3) "136" +unicode(3) "137" +unicode(3) "138" +unicode(3) "139" +unicode(3) "140" +unicode(3) "141" +unicode(3) "142" +unicode(3) "143" +unicode(3) "144" +unicode(3) "145" +unicode(3) "146" +unicode(3) "147" +unicode(3) "148" +unicode(3) "149" +unicode(3) "150" +unicode(3) "151" +unicode(3) "152" +unicode(3) "153" +unicode(3) "154" +unicode(3) "155" +unicode(3) "156" +unicode(3) "157" +unicode(3) "158" +unicode(3) "159" +unicode(3) "160" +unicode(3) "161" +unicode(3) "162" +unicode(3) "163" +unicode(3) "164" +unicode(3) "165" +unicode(3) "166" +unicode(3) "167" +unicode(3) "168" +unicode(3) "169" +unicode(3) "170" +unicode(3) "171" +unicode(3) "172" +unicode(3) "173" +unicode(3) "174" +unicode(3) "175" +unicode(3) "176" +unicode(3) "177" +unicode(3) "178" +unicode(3) "179" +unicode(3) "180" +unicode(3) "181" +unicode(3) "182" +unicode(3) "183" +unicode(3) "184" +unicode(3) "185" +unicode(3) "186" +unicode(3) "187" +unicode(3) "188" +unicode(3) "189" +unicode(3) "190" +unicode(3) "191" +unicode(3) "192" +unicode(3) "193" +unicode(3) "194" +unicode(3) "195" +unicode(3) "196" +unicode(3) "197" +unicode(3) "198" +unicode(3) "199" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bug35973.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/bug35973.phpt diff -u php-src/ext/oci8/tests/bug35973.phpt:1.1 php-src/ext/oci8/tests/bug35973.phpt:1.2 --- php-src/ext/oci8/tests/bug35973.phpt:1.1 Wed Aug 9 15:23:50 2006 +++ php-src/ext/oci8/tests/bug35973.phpt Fri Nov 10 16:56:19 2006 @@ -41,3 +41,14 @@ string(%d) "%s5" string(%d) "%sa" Done +--UEXPECTF-- +array(1) { + [u"NC"]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +unicode(%d) "%s5" +unicode(%d) "%sa" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/bug36096.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/bug36096.phpt diff -u php-src/ext/oci8/tests/bug36096.phpt:1.3 php-src/ext/oci8/tests/bug36096.phpt:1.4 --- php-src/ext/oci8/tests/bug36096.phpt:1.3 Tue Jan 31 18:39:50 2006 +++ php-src/ext/oci8/tests/bug36096.phpt Fri Nov 10 16:56:19 2006 @@ -26,3 +26,9 @@ string(5) "'ABC'" string(4) "CHAR" Done +--UEXPECT-- +bool(false) +bool(false) +unicode(5) "'ABC'" +unicode(4) "CHAR" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_011_func.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_011_func.phpt diff -u php-src/ext/oci8/tests/coll_011_func.phpt:1.3 php-src/ext/oci8/tests/coll_011_func.phpt:1.4 --- php-src/ext/oci8/tests/coll_011_func.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_011_func.phpt Fri Nov 10 16:56:19 2006 @@ -41,3 +41,9 @@ bool(true) string(6) "string" Done +--UEXPECT-- +bool(true) +bool(true) +bool(true) +unicode(6) "string" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_011.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_011.phpt diff -u php-src/ext/oci8/tests/coll_011.phpt:1.3 php-src/ext/oci8/tests/coll_011.phpt:1.4 --- php-src/ext/oci8/tests/coll_011.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_011.phpt Fri Nov 10 16:56:19 2006 @@ -41,3 +41,9 @@ bool(true) string(6) "string" Done +--UEXPECT-- +bool(true) +bool(true) +bool(true) +unicode(6) "string" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_012_func.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_012_func.phpt diff -u php-src/ext/oci8/tests/coll_012_func.phpt:1.3 php-src/ext/oci8/tests/coll_012_func.phpt:1.4 --- php-src/ext/oci8/tests/coll_012_func.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_012_func.phpt Fri Nov 10 16:56:19 2006 @@ -39,3 +39,8 @@ bool(true) string(9) "28-JUL-05" Done +--UEXPECT-- +bool(true) +bool(true) +unicode(9) "28-JUL-05" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_012.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_012.phpt diff -u php-src/ext/oci8/tests/coll_012.phpt:1.3 php-src/ext/oci8/tests/coll_012.phpt:1.4 --- php-src/ext/oci8/tests/coll_012.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_012.phpt Fri Nov 10 16:56:19 2006 @@ -39,3 +39,8 @@ bool(true) string(9) "28-JUL-05" Done +--UEXPECT-- +bool(true) +bool(true) +unicode(9) "28-JUL-05" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_013_func.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_013_func.phpt diff -u php-src/ext/oci8/tests/coll_013_func.phpt:1.3 php-src/ext/oci8/tests/coll_013_func.phpt:1.4 --- php-src/ext/oci8/tests/coll_013_func.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_013_func.phpt Fri Nov 10 16:56:19 2006 @@ -36,3 +36,8 @@ bool(true) string(9) "01-JAN-05" Done +--UEXPECT-- +bool(true) +bool(true) +unicode(9) "01-JAN-05" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_013.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_013.phpt diff -u php-src/ext/oci8/tests/coll_013.phpt:1.3 php-src/ext/oci8/tests/coll_013.phpt:1.4 --- php-src/ext/oci8/tests/coll_013.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_013.phpt Fri Nov 10 16:56:19 2006 @@ -36,3 +36,8 @@ bool(true) string(9) "01-JAN-05" Done +--UEXPECT-- +bool(true) +bool(true) +unicode(9) "01-JAN-05" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_014_func.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_014_func.phpt diff -u php-src/ext/oci8/tests/coll_014_func.phpt:1.3 php-src/ext/oci8/tests/coll_014_func.phpt:1.4 --- php-src/ext/oci8/tests/coll_014_func.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_014_func.phpt Fri Nov 10 16:56:19 2006 @@ -36,3 +36,8 @@ bool(true) string(4) "blah" Done +--UEXPECT-- +bool(true) +bool(true) +unicode(4) "blah" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/coll_014.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/coll_014.phpt diff -u php-src/ext/oci8/tests/coll_014.phpt:1.3 php-src/ext/oci8/tests/coll_014.phpt:1.4 --- php-src/ext/oci8/tests/coll_014.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/coll_014.phpt Fri Nov 10 16:56:19 2006 @@ -36,3 +36,8 @@ bool(true) string(4) "blah" Done +--UEXPECT-- +bool(true) +bool(true) +unicode(4) "blah" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/commit_old.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/commit_old.phpt diff -u php-src/ext/oci8/tests/commit_old.phpt:1.4 php-src/ext/oci8/tests/commit_old.phpt:1.5 --- php-src/ext/oci8/tests/commit_old.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/commit_old.phpt Fri Nov 10 16:56:19 2006 @@ -170,24 +170,24 @@ [u"ID"]=> array(4) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" [3]=> - string(1) "1" + unicode(1) "1" } [u"VALUE"]=> array(4) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" [3]=> - string(1) "1" + unicode(1) "1" } [u"BLOB"]=> array(4) { http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/commit.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/commit.phpt diff -u php-src/ext/oci8/tests/commit.phpt:1.4 php-src/ext/oci8/tests/commit.phpt:1.5 --- php-src/ext/oci8/tests/commit.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/commit.phpt Fri Nov 10 16:56:19 2006 @@ -172,24 +172,24 @@ [u"ID"]=> array(4) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" [3]=> - string(1) "1" + unicode(1) "1" } [u"VALUE"]=> array(4) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" [3]=> - string(1) "1" + unicode(1) "1" } [u"BLOB"]=> array(4) { http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/cursor_bind.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/oci8/tests/cursor_bind.phpt diff -u php-src/ext/oci8/tests/cursor_bind.phpt:1.2 php-src/ext/oci8/tests/cursor_bind.phpt:1.3 --- php-src/ext/oci8/tests/cursor_bind.phpt:1.2 Wed Dec 21 11:43:23 2005 +++ php-src/ext/oci8/tests/cursor_bind.phpt Fri Nov 10 16:56:19 2006 @@ -97,3 +97,24 @@ } bool(false) Done +--UEXPECT-- +array(2) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" +} +array(2) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" +} +array(2) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" +} +bool(false) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/cursors_old.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/cursors_old.phpt diff -u php-src/ext/oci8/tests/cursors_old.phpt:1.4 php-src/ext/oci8/tests/cursors_old.phpt:1.5 --- php-src/ext/oci8/tests/cursors_old.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/cursors_old.phpt Fri Nov 10 16:56:19 2006 @@ -65,18 +65,18 @@ --UEXPECTF-- array(2) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } bool(true) Warning: ocifetchinto(): ORA-01002: fetch out of sequence in %s on line %d array(2) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } bool(true) Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/cursors.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/cursors.phpt diff -u php-src/ext/oci8/tests/cursors.phpt:1.5 php-src/ext/oci8/tests/cursors.phpt:1.6 --- php-src/ext/oci8/tests/cursors.phpt:1.5 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/cursors.phpt Fri Nov 10 16:56:19 2006 @@ -66,9 +66,9 @@ --UEXPECTF-- array(5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/define1.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/define1.phpt diff -u php-src/ext/oci8/tests/define1.phpt:1.1 php-src/ext/oci8/tests/define1.phpt:1.2 --- php-src/ext/oci8/tests/define1.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/define1.phpt Fri Nov 10 16:56:19 2006 @@ -50,3 +50,14 @@ NULL string(4) "some" Done +--UEXPECTF-- +bool(true) +bool(false) + +Warning: oci_define_by_name(): Column name cannot be empty in %s on line %d +bool(false) + +Warning: oci_define_by_name() expects at least 3 parameters, 2 given in %s on line %d +NULL +unicode(4) "some" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/define_old.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/define_old.phpt diff -u php-src/ext/oci8/tests/define_old.phpt:1.3 php-src/ext/oci8/tests/define_old.phpt:1.4 --- php-src/ext/oci8/tests/define_old.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/define_old.phpt Fri Nov 10 16:56:19 2006 @@ -39,3 +39,6 @@ --EXPECT-- string(4) "some" Done +--UEXPECT-- +unicode(4) "some" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/define.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/define.phpt diff -u php-src/ext/oci8/tests/define.phpt:1.3 php-src/ext/oci8/tests/define.phpt:1.4 --- php-src/ext/oci8/tests/define.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/define.phpt Fri Nov 10 16:56:19 2006 @@ -39,3 +39,6 @@ --EXPECT-- string(4) "some" Done +--UEXPECT-- +unicode(4) "some" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/error1.phpt?r1=1.6&r2=1.7&diff_format=u Index: php-src/ext/oci8/tests/error1.phpt diff -u php-src/ext/oci8/tests/error1.phpt:1.6 php-src/ext/oci8/tests/error1.phpt:1.7 --- php-src/ext/oci8/tests/error1.phpt:1.6 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/error1.phpt Fri Nov 10 16:56:19 2006 @@ -25,17 +25,3 @@ string(0) "" } Done ---UEXPECTF-- -Warning: oci_connect(): ORA-12154: TNS:could not resolve service name in %s on line %d -bool(false) -array(4) { - [u"code"]=> - int(12154) - [u"message"]=> - string(45) "ORA-12154: TNS:could not resolve service name" - [u"offset"]=> - int(0) - [u"sqltext"]=> - string(0) "" -} -Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/error_old.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/error_old.phpt diff -u php-src/ext/oci8/tests/error_old.phpt:1.4 php-src/ext/oci8/tests/error_old.phpt:1.5 --- php-src/ext/oci8/tests/error_old.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/error_old.phpt Fri Nov 10 16:56:19 2006 @@ -45,13 +45,13 @@ Warning: ociexecute(): ORA-00900: invalid SQL statement in %s on line %d bool(false) array(4) { - [u"code"]=> + ["code"]=> int(900) - [u"message"]=> - string(32) "ORA-00900: invalid SQL statement" - [u"offset"]=> + ["message"]=> + unicode(32) "ORA-00900: invalid SQL statement" + ["offset"]=> int(0) - [u"sqltext"]=> - string(12) "WRONG SYNTAX" + ["sqltext"]=> + unicode(12) "WRONG SYNTAX" } Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/error.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/error.phpt diff -u php-src/ext/oci8/tests/error.phpt:1.4 php-src/ext/oci8/tests/error.phpt:1.5 --- php-src/ext/oci8/tests/error.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/error.phpt Fri Nov 10 16:56:19 2006 @@ -45,13 +45,13 @@ Warning: oci_execute(): ORA-00900: invalid SQL statement in %s on line %d bool(false) array(4) { - [u"code"]=> + ["code"]=> int(900) - [u"message"]=> - string(32) "ORA-00900: invalid SQL statement" - [u"offset"]=> + ["message"]=> + unicode(32) "ORA-00900: invalid SQL statement" + ["offset"]=> int(0) - [u"sqltext"]=> - string(12) "WRONG SYNTAX" + ["sqltext"]=> + unicode(12) "WRONG SYNTAX" } Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_all.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/fetch_all.phpt diff -u php-src/ext/oci8/tests/fetch_all.phpt:1.4 php-src/ext/oci8/tests/fetch_all.phpt:1.5 --- php-src/ext/oci8/tests/fetch_all.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/fetch_all.phpt Fri Nov 10 16:56:19 2006 @@ -153,20 +153,20 @@ [u"ID"]=> array(3) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" } [u"VALUE"]=> array(3) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" } [u"BLOB"]=> array(3) { @@ -201,20 +201,20 @@ [u"ID"]=> array(3) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" } [u"VALUE"]=> array(3) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> - string(1) "1" + unicode(1) "1" } [u"BLOB"]=> array(3) { http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_array.phpt?r1=1.6&r2=1.7&diff_format=u Index: php-src/ext/oci8/tests/fetch_array.phpt diff -u php-src/ext/oci8/tests/fetch_array.phpt:1.6 php-src/ext/oci8/tests/fetch_array.phpt:1.7 --- php-src/ext/oci8/tests/fetch_array.phpt:1.6 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/fetch_array.phpt Fri Nov 10 16:56:19 2006 @@ -309,13 +309,13 @@ --UEXPECT-- array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -331,13 +331,13 @@ } array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -353,13 +353,13 @@ } array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -375,109 +375,109 @@ } array(2) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" } array(2) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" } array(2) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" } array(2) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(2) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(2) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -493,13 +493,13 @@ } array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -515,13 +515,13 @@ } array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_assoc.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/fetch_assoc.phpt diff -u php-src/ext/oci8/tests/fetch_assoc.phpt:1.5 php-src/ext/oci8/tests/fetch_assoc.phpt:1.6 --- php-src/ext/oci8/tests/fetch_assoc.phpt:1.5 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/fetch_assoc.phpt Fri Nov 10 16:56:19 2006 @@ -83,9 +83,9 @@ --UEXPECT-- array(5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> @@ -95,9 +95,9 @@ } array(5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> @@ -107,9 +107,9 @@ } array(5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_into1.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/fetch_into1.phpt diff -u php-src/ext/oci8/tests/fetch_into1.phpt:1.4 php-src/ext/oci8/tests/fetch_into1.phpt:1.5 --- php-src/ext/oci8/tests/fetch_into1.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/fetch_into1.phpt Fri Nov 10 16:56:19 2006 @@ -194,23 +194,23 @@ int(5) array(2) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" } int(5) array(2) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } int(5) array(5) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [3]=> @@ -221,31 +221,31 @@ int(5) array(2) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" } int(5) array(4) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" } int(5) array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -262,13 +262,13 @@ int(5) array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> @@ -285,9 +285,9 @@ int(5) array(5) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [3]=> @@ -298,9 +298,9 @@ int(5) array(5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> @@ -311,9 +311,9 @@ int(5) array(5) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [3]=> http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_into2.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/fetch_into2.phpt diff -u php-src/ext/oci8/tests/fetch_into2.phpt:1.3 php-src/ext/oci8/tests/fetch_into2.phpt:1.4 --- php-src/ext/oci8/tests/fetch_into2.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/fetch_into2.phpt Fri Nov 10 16:56:19 2006 @@ -68,3 +68,25 @@ string(1) "1" } Done +--UEXPECTF-- +Warning: ocifetchinto() expects at least 2 parameters, 1 given in %s on line %d +NULL + +Notice: Undefined variable: all in %s on line %d +NULL + +Warning: ocifetchinto() expects at most 3 parameters, 4 given in %s on line %d +NULL +NULL + +Warning: ocifetchinto(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) +NULL +int(5) +array(2) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_into.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/fetch_into.phpt diff -u php-src/ext/oci8/tests/fetch_into.phpt:1.4 php-src/ext/oci8/tests/fetch_into.phpt:1.5 --- php-src/ext/oci8/tests/fetch_into.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/fetch_into.phpt Fri Nov 10 16:56:19 2006 @@ -84,20 +84,20 @@ int(5) array(2) { [0]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" } int(5) array(10) { [0]=> - string(1) "1" + unicode(1) "1" [u"ID"]=> - string(1) "1" + unicode(1) "1" [1]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [2]=> NULL [u"BLOB"]=> http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_object.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/fetch_object.phpt diff -u php-src/ext/oci8/tests/fetch_object.phpt:1.5 php-src/ext/oci8/tests/fetch_object.phpt:1.6 --- php-src/ext/oci8/tests/fetch_object.phpt:1.5 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/fetch_object.phpt Fri Nov 10 16:56:19 2006 @@ -83,9 +83,9 @@ --UEXPECTF-- object(stdClass)#%d (5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> @@ -95,9 +95,9 @@ } object(stdClass)#%d (5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> @@ -107,9 +107,9 @@ } object(stdClass)#%d (5) { [u"ID"]=> - string(1) "1" + unicode(1) "1" [u"VALUE"]=> - string(1) "1" + unicode(1) "1" [u"BLOB"]=> NULL [u"CLOB"]=> http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/fetch.phpt diff -u php-src/ext/oci8/tests/fetch.phpt:1.3 php-src/ext/oci8/tests/fetch.phpt:1.4 --- php-src/ext/oci8/tests/fetch.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/fetch.phpt Fri Nov 10 16:56:19 2006 @@ -54,3 +54,11 @@ string(1) "1" string(1) "1" Done +--UEXPECT-- +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +unicode(1) "1" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/fetch_row.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/fetch_row.phpt diff -u php-src/ext/oci8/tests/fetch_row.phpt:1.4 php-src/ext/oci8/tests/fetch_row.phpt:1.5 --- php-src/ext/oci8/tests/fetch_row.phpt:1.4 Tue Mar 28 09:13:35 2006 +++ php-src/ext/oci8/tests/fetch_row.phpt Fri Nov 10 16:56:19 2006 @@ -80,3 +80,41 @@ NULL } Done +--UEXPECT-- +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/field_funcs1.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/field_funcs1.phpt diff -u php-src/ext/oci8/tests/field_funcs1.phpt:1.3 php-src/ext/oci8/tests/field_funcs1.phpt:1.4 --- php-src/ext/oci8/tests/field_funcs1.phpt:1.3 Thu May 18 13:20:00 2006 +++ php-src/ext/oci8/tests/field_funcs1.phpt Fri Nov 10 16:56:19 2006 @@ -177,3 +177,104 @@ Warning: oci_field_size() expects exactly 2 parameters, 1 given in %s on line %d bool(false) Done +--UEXPECTF-- +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} + +Warning: oci_field_is_null(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_name(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_type(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_type_raw(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_scale(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_precision(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_size(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_is_null(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_name(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_type(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_type_raw(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_scale(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_precision(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_size(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_is_null(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_name(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_type(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_type_raw(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_scale(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_precision(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_size(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_is_null(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_name(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_type(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_type_raw(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_scale(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_precision(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_size(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_size() expects exactly 2 parameters, 1 given in %s on line %d +bool(false) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/field_funcs_old.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/field_funcs_old.phpt diff -u php-src/ext/oci8/tests/field_funcs_old.phpt:1.5 php-src/ext/oci8/tests/field_funcs_old.phpt:1.6 --- php-src/ext/oci8/tests/field_funcs_old.phpt:1.5 Tue May 30 22:37:08 2006 +++ php-src/ext/oci8/tests/field_funcs_old.phpt Fri Nov 10 16:56:19 2006 @@ -103,3 +103,52 @@ int(0) int(10) Done +--UEXPECTF-- +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +bool(false) +unicode(2) "ID" +unicode(6) "NUMBER" +int(2) +int(0) +int(0) +int(22) +bool(false) +unicode(5) "VALUE" +unicode(6) "NUMBER" +int(2) +int(0) +int(0) +int(22) +bool(true) +unicode(4) "BLOB" +unicode(4) "BLOB" +int(113) +int(0) +int(0) +int(4000) +bool(true) +unicode(4) "CLOB" +unicode(4) "CLOB" +int(112) +int(0) +int(0) +int(4000) +bool(true) +unicode(6) "STRING" +unicode(8) "VARCHAR2" +int(1) +int(0) +int(0) +int(10) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/field_funcs.phpt?r1=1.6&r2=1.7&diff_format=u Index: php-src/ext/oci8/tests/field_funcs.phpt diff -u php-src/ext/oci8/tests/field_funcs.phpt:1.6 php-src/ext/oci8/tests/field_funcs.phpt:1.7 --- php-src/ext/oci8/tests/field_funcs.phpt:1.6 Tue May 30 22:37:08 2006 +++ php-src/ext/oci8/tests/field_funcs.phpt Fri Nov 10 16:56:19 2006 @@ -103,3 +103,52 @@ int(0) int(10) Done +--UEXPECTF-- +array(5) { + [0]=> + unicode(1) "1" + [1]=> + unicode(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +bool(false) +unicode(2) "ID" +unicode(6) "NUMBER" +int(2) +int(0) +int(0) +int(22) +bool(false) +unicode(5) "VALUE" +unicode(6) "NUMBER" +int(2) +int(0) +int(0) +int(22) +bool(true) +unicode(4) "BLOB" +unicode(4) "BLOB" +int(113) +int(0) +int(0) +int(4000) +bool(true) +unicode(4) "CLOB" +unicode(4) "CLOB" +int(112) +int(0) +int(0) +int(4000) +bool(true) +unicode(6) "STRING" +unicode(8) "VARCHAR2" +int(1) +int(0) +int(0) +int(10) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_001.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/lob_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_002.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_002.phpt diff -u php-src/ext/oci8/tests/lob_002.phpt:1.4 php-src/ext/oci8/tests/lob_002.phpt:1.5 --- php-src/ext/oci8/tests/lob_002.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_002.phpt Fri Nov 10 16:56:19 2006 @@ -22,12 +22,12 @@ var_dump($blob); -var_dump($blob->write("test", -1)); -var_dump($blob->write("test", "str")); -var_dump($blob->write("test", 1000000)); -var_dump($blob->write(str_repeat("test", 10000), 1000000)); +var_dump($blob->write(b"test", -1)); +var_dump($blob->write(b"test", "str")); +var_dump($blob->write(b"test", 1000000)); +var_dump($blob->write((binary)str_repeat("test", 10000), 1000000)); var_dump($blob->tell()); -var_dump($blob->seek("str", -5)); +var_dump($blob->seek(b"str", -5)); var_dump($blob->flush()); oci_commit($c); @@ -77,7 +77,7 @@ int(40000) int(40004) -Warning: OCI-Lob::seek() expects parameter 1 to be long, Unicode string given in %s on line %d +Warning: OCI-Lob::seek() expects parameter 1 to be long, binary string given in %s on line %d NULL bool(false) int(40004) http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_003.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_003.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_004.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_004.phpt diff -u php-src/ext/oci8/tests/lob_004.phpt:1.4 php-src/ext/oci8/tests/lob_004.phpt:1.5 --- php-src/ext/oci8/tests/lob_004.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_004.phpt Fri Nov 10 16:56:19 2006 @@ -22,9 +22,9 @@ var_dump($blob); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump($blob->rewind()); -var_dump($blob->write("str")); +var_dump($blob->write(b"str")); var_dump($blob->seek(10, OCI_SEEK_SET)); oci_commit($c); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_006.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_006.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_007.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_007.phpt diff -u php-src/ext/oci8/tests/lob_007.phpt:1.4 php-src/ext/oci8/tests/lob_007.phpt:1.5 --- php-src/ext/oci8/tests/lob_007.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_007.phpt Fri Nov 10 16:56:19 2006 @@ -23,7 +23,7 @@ var_dump($blob); var_dump($blob->size()); -var_dump($blob->write(str_repeat("string.", 1000))); +var_dump($blob->write((binary)str_repeat("string.", 1000))); var_dump($blob->size()); oci_commit($c); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_008.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_008.phpt diff -u php-src/ext/oci8/tests/lob_008.phpt:1.4 php-src/ext/oci8/tests/lob_008.phpt:1.5 --- php-src/ext/oci8/tests/lob_008.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_008.phpt Fri Nov 10 16:56:19 2006 @@ -22,7 +22,7 @@ var_dump($blob); -var_dump($blob->write(str_repeat("string.", 1000))); +var_dump($blob->write((binary)str_repeat("string.", 1000))); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_010.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_010.phpt diff -u php-src/ext/oci8/tests/lob_010.phpt:1.3 php-src/ext/oci8/tests/lob_010.phpt:1.4 --- php-src/ext/oci8/tests/lob_010.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_010.phpt Fri Nov 10 16:56:19 2006 @@ -20,8 +20,8 @@ oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); -var_dump($blob->save("string")); -var_dump($blob->save("string", 3)); +var_dump($blob->save(b"string")); +var_dump($blob->save(b"string", 3)); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_011.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/lob_011.phpt diff -u php-src/ext/oci8/tests/lob_011.phpt:1.5 php-src/ext/oci8/tests/lob_011.phpt:1.6 --- php-src/ext/oci8/tests/lob_011.phpt:1.5 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_011.phpt Fri Nov 10 16:56:19 2006 @@ -20,7 +20,7 @@ oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); -var_dump($blob->write("some string here. string, I said")); +var_dump($blob->write(b"some string here. string, I said")); oci_commit($c); $ora_sql = "INSERT INTO http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_012.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_012.phpt diff -u php-src/ext/oci8/tests/lob_012.phpt:1.3 php-src/ext/oci8/tests/lob_012.phpt:1.4 --- php-src/ext/oci8/tests/lob_012.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_012.phpt Fri Nov 10 16:56:19 2006 @@ -22,7 +22,7 @@ $blob; -var_dump($blob->write("test string is here\nnew string")); +var_dump($blob->write(b"test string is here\nnew string")); oci_commit($c); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_013.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_013.phpt diff -u php-src/ext/oci8/tests/lob_013.phpt:1.3 php-src/ext/oci8/tests/lob_013.phpt:1.4 --- php-src/ext/oci8/tests/lob_013.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_013.phpt Fri Nov 10 16:56:19 2006 @@ -20,10 +20,10 @@ oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump($blob->getBuffering()); var_dump($blob->setBuffering(true)); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump($blob->getBuffering()); var_dump($blob->flush()); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_014.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_014.phpt diff -u php-src/ext/oci8/tests/lob_014.phpt:1.3 php-src/ext/oci8/tests/lob_014.phpt:1.4 --- php-src/ext/oci8/tests/lob_014.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_014.phpt Fri Nov 10 16:56:19 2006 @@ -22,11 +22,11 @@ $blob; -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump($blob->close()); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump($blob->free()); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); oci_commit($c); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_016.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_016.phpt diff -u php-src/ext/oci8/tests/lob_016.phpt:1.4 php-src/ext/oci8/tests/lob_016.phpt:1.5 --- php-src/ext/oci8/tests/lob_016.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_016.phpt Fri Nov 10 16:56:19 2006 @@ -25,8 +25,8 @@ $row = oci_fetch_assoc($statement); -$row['LOB_1']->write("first"); -$row['LOB_2']->write("second"); +$row['LOB_1']->write(b"first"); +$row['LOB_2']->write(b"second"); unset($row); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_017.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/lob_017.phpt diff -u php-src/ext/oci8/tests/lob_017.phpt:1.4 php-src/ext/oci8/tests/lob_017.phpt:1.5 --- php-src/ext/oci8/tests/lob_017.phpt:1.4 Mon Jul 10 20:48:04 2006 +++ php-src/ext/oci8/tests/lob_017.phpt Fri Nov 10 16:56:19 2006 @@ -27,8 +27,8 @@ $row = oci_fetch_assoc($statement); -$row['LOB_1']->write("first"); -$row['LOB_2']->write("second"); +$row['LOB_1']->write(b"first"); +$row['LOB_2']->write(b"second"); unset($row); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_018.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_018.phpt diff -u php-src/ext/oci8/tests/lob_018.phpt:1.3 php-src/ext/oci8/tests/lob_018.phpt:1.4 --- php-src/ext/oci8/tests/lob_018.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_018.phpt Fri Nov 10 16:56:19 2006 @@ -65,3 +65,9 @@ string(9) "long data" string(4) "data" Done +--UEXPECTF-- +unicode(4) "data" +unicode(9) "long data" +unicode(9) "long data" +unicode(4) "data" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_019.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_019.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_020.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_020.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_021.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/lob_021.phpt diff -u php-src/ext/oci8/tests/lob_021.phpt:1.1 php-src/ext/oci8/tests/lob_021.phpt:1.2 --- php-src/ext/oci8/tests/lob_021.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/lob_021.phpt Fri Nov 10 16:56:19 2006 @@ -20,13 +20,11 @@ oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); -$blob; - -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump($blob->close()); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump(oci_free_descriptor($blob)); -var_dump($blob->write("test")); +var_dump($blob->write(b"test")); var_dump(oci_free_descriptor($blob)); var_dump(oci_free_descriptor(new stdclass)); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_022.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/lob_022.phpt diff -u php-src/ext/oci8/tests/lob_022.phpt:1.1 php-src/ext/oci8/tests/lob_022.phpt:1.2 --- php-src/ext/oci8/tests/lob_022.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/lob_022.phpt Fri Nov 10 16:56:19 2006 @@ -78,3 +78,16 @@ string(9) "long data" string(4) "data" Done +--UEXPECTF-- +Warning: OCI-Lob::save() expects at least 1 parameter, 0 given in %s on line %d + +Warning: oci_lob_save() expects at least 2 parameters, 0 given in %s on line %d + +Warning: oci_lob_save(): Unable to find descriptor property in %s on line %d + +Warning: OCI-Lob::save(): Offset parameter must be greater than or equal to 0 in %s on line %d +unicode(4) "data" +unicode(9) "long data" +unicode(9) "long data" +unicode(4) "data" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_023.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/lob_023.phpt diff -u php-src/ext/oci8/tests/lob_023.phpt:1.1 php-src/ext/oci8/tests/lob_023.phpt:1.2 --- php-src/ext/oci8/tests/lob_023.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/lob_023.phpt Fri Nov 10 16:56:19 2006 @@ -82,3 +82,40 @@ test lob_009.phpt " Done +--UEXPECTF-- +object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) +} +bool(true) +bool(true) + +Warning: OCI-Lob::import() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: oci_lob_import() expects exactly 2 parameters, 1 given in %s on line %d +NULL +bool(true) + +Warning: oci_lob_import(): Unable to find descriptor property in %s on line %d +bool(false) +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + [u"BLOB"]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +string(43) "this +is +a +test +file for +test lob_009.phpt +" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_024.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/lob_024.phpt diff -u php-src/ext/oci8/tests/lob_024.phpt:1.1 php-src/ext/oci8/tests/lob_024.phpt:1.2 --- php-src/ext/oci8/tests/lob_024.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/lob_024.phpt Fri Nov 10 16:56:19 2006 @@ -23,7 +23,7 @@ var_dump($blob); var_dump($blob->size()); -var_dump($blob->write(str_repeat("string.", 1000))); +var_dump($blob->write((binary)str_repeat("string.", 1000))); var_dump($blob->size()); oci_commit($c); @@ -73,3 +73,32 @@ Warning: oci_lob_load(): Unable to find descriptor property in %s on line %d bool(false) Done +--UEXPECTF-- +object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) +} +int(0) +int(7000) +int(7000) +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + [u"BLOB"]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +int(7000) +int(7000) + +Warning: oci_lob_load() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: oci_lob_load(): Unable to find descriptor property in %s on line %d +bool(false) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_025.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/lob_025.phpt diff -u php-src/ext/oci8/tests/lob_025.phpt:1.1 php-src/ext/oci8/tests/lob_025.phpt:1.2 --- php-src/ext/oci8/tests/lob_025.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/lob_025.phpt Fri Nov 10 16:56:19 2006 @@ -21,7 +21,7 @@ oci_execute($statement, OCI_DEFAULT); var_dump($blob->size()); -var_dump($blob->write(str_repeat("string.", 1000))); +var_dump($blob->write((binary)str_repeat("string.", 1000))); var_dump($blob->size()); oci_commit($c); @@ -80,3 +80,37 @@ Warning: oci_lob_eof(): Unable to find descriptor property in %s on line %d bool(false) Done +--UEXPECTF-- +int(0) +int(7000) +int(7000) +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + [u"BLOB"]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +string(2) "st" + +Warning: oci_lob_read() expects exactly 2 parameters, 1 given in %s on line %d +NULL + +Warning: oci_lob_read() expects exactly 2 parameters, 0 given in %s on line %d +NULL +bool(false) + +Warning: oci_lob_eof() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: oci_lob_read(): Unable to find descriptor property in %s on line %d +bool(false) + +Warning: oci_lob_eof(): Unable to find descriptor property in %s on line %d +bool(false) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_026.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/lob_026.phpt diff -u php-src/ext/oci8/tests/lob_026.phpt:1.1 php-src/ext/oci8/tests/lob_026.phpt:1.2 --- php-src/ext/oci8/tests/lob_026.phpt:1.1 Tue Sep 12 20:32:06 2006 +++ php-src/ext/oci8/tests/lob_026.phpt Fri Nov 10 16:56:19 2006 @@ -22,10 +22,10 @@ var_dump($blob); -var_dump(oci_lob_write($blob, "test")); +var_dump(oci_lob_write($blob, b"test")); var_dump(oci_lob_rewind()); var_dump(oci_lob_rewind($blob)); -var_dump(oci_lob_write($blob, "str")); +var_dump(oci_lob_write($blob, b"str")); var_dump(oci_lob_seek(10, OCI_SEEK_SET)); var_dump(oci_lob_seek($blob, 10, OCI_SEEK_SET)); @@ -98,3 +98,43 @@ string(4) "strt" string(8) "strtstrt" Done +--UEXPECTF-- +object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) +} +int(4) + +Warning: oci_lob_rewind() expects exactly 1 parameter, 0 given in %s on line %d +NULL +bool(true) +int(3) + +Warning: oci_lob_seek() expects parameter 1 to be OCI-Lob, integer given in %s on line %d +NULL +bool(true) +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + [u"BLOB"]=> + object(OCI-Lob)#%d (1) { + [u"descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} + +Warning: oci_lob_append() expects exactly 2 parameters, 0 given in %s on line %d +NULL + +Warning: oci_lob_append() expects exactly 2 parameters, 1 given in %s on line %d +NULL +bool(true) + +Warning: oci_lob_read() expects exactly 2 parameters, 1 given in %s on line %d +NULL +string(4) "strt" +string(8) "strtstrt" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_temp1.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_temp1.phpt diff -u php-src/ext/oci8/tests/lob_temp1.phpt:1.3 php-src/ext/oci8/tests/lob_temp1.phpt:1.4 --- php-src/ext/oci8/tests/lob_temp1.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_temp1.phpt Fri Nov 10 16:56:19 2006 @@ -30,3 +30,11 @@ string(4) "test" bool(true) Done +--UEXPECTF-- +bool(true) +unicode(4) "test" +bool(true) +bool(true) +unicode(4) "test" +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_temp.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/lob_temp.phpt diff -u php-src/ext/oci8/tests/lob_temp.phpt:1.3 php-src/ext/oci8/tests/lob_temp.phpt:1.4 --- php-src/ext/oci8/tests/lob_temp.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/lob_temp.phpt Fri Nov 10 16:56:19 2006 @@ -34,3 +34,13 @@ bool(true) string(2) "te" Done +--UEXPECTF-- +bool(true) +unicode(4) "test" +bool(true) +unicode(2) "te" +bool(true) +unicode(4) "test" +bool(true) +unicode(2) "te" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/pecl_bug8816.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/oci8/tests/pecl_bug8816.phpt diff -u php-src/ext/oci8/tests/pecl_bug8816.phpt:1.1 php-src/ext/oci8/tests/pecl_bug8816.phpt:1.2 --- php-src/ext/oci8/tests/pecl_bug8816.phpt:1.1 Fri Oct 6 09:57:29 2006 +++ php-src/ext/oci8/tests/pecl_bug8816.phpt Fri Nov 10 16:56:19 2006 @@ -96,3 +96,35 @@ string(19) "1234567890111111111" } Done +--UEXPECT-- +array(2) { + [u"L1"]=> + unicode(19) "1234567890111111111" + [u"L2"]=> + unicode(9) "987654321" +} +array(2) { + [u"L1"]=> + unicode(15) "122222222222222" + [u"L2"]=> + unicode(9) "123456789" +} +array(2) { + [u"L1"]=> + unicode(30) "985456745674567654567654567654" + [u"L2"]=> + unicode(30) "985456745674567654567654567654" +} +array(2) { + [u"L1"]=> + unicode(9) "123456789" + [u"L2"]=> + unicode(15) "122222222222222" +} +array(2) { + [u"L1"]=> + unicode(9) "987654321" + [u"L2"]=> + unicode(19) "1234567890111111111" +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/serverversion.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/oci8/tests/serverversion.phpt diff -u php-src/ext/oci8/tests/serverversion.phpt:1.3 php-src/ext/oci8/tests/serverversion.phpt:1.4 --- php-src/ext/oci8/tests/serverversion.phpt:1.3 Tue Dec 6 19:26:57 2005 +++ php-src/ext/oci8/tests/serverversion.phpt Fri Nov 10 16:56:19 2006 @@ -28,3 +28,8 @@ string(%d) "%s" string(%d) "%s" Done +--UEXPECTF-- +resource(%d) of type (oci8 connection) +unicode(%d) "%s" +unicode(%d) "%s" +Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/statement_cache.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/oci8/tests/statement_cache.phpt diff -u php-src/ext/oci8/tests/statement_cache.phpt:1.5 php-src/ext/oci8/tests/statement_cache.phpt:1.6 --- php-src/ext/oci8/tests/statement_cache.phpt:1.5 Tue Aug 22 11:08:28 2006 +++ php-src/ext/oci8/tests/statement_cache.phpt Fri Nov 10 16:56:19 2006 @@ -36,14 +36,14 @@ --UEXPECTF-- array(2) { [0]=> - string(1) "4" + unicode(1) "4" [u"1+3"]=> - string(1) "4" + unicode(1) "4" } array(2) { [0]=> - string(1) "4" + unicode(1) "4" [u"1+3"]=> - string(1) "4" + unicode(1) "4" } Done