Fixes to ext/oci8

This commit is contained in:
Christopher Jones authored and Anatol Belski committed 2014-01-23 00:25:55 +01:00
1 parent 2741cf56a4
commit ab5405e800
4 files changed
+14 -14

No files matched your search

+4 -4
View File
@@ -1379,9 +1379,9 @@ PHP_MINFO_FUNCTION(oci)
php_info_print_table_start();
php_info_print_table_header(2, "Statistics", "");
snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent));
snprintf(buf, sizeof(buf), ZEND_INT_FMT, OCI_G(num_persistent));
php_info_print_table_row(2, "Active Persistent Connections", buf);
snprintf(buf, sizeof(buf), "%ld", OCI_G(num_links));
snprintf(buf, sizeof(buf), ZEND_INT_FMT, OCI_G(num_links));
php_info_print_table_row(2, "Active Connections", buf);
php_info_print_table_end();
}
@@ -1807,7 +1807,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, php_size_t username_le
ub2 charsetid_nls_lang = 0;
if (session_mode & ~(OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid session mode specified (%ld)", session_mode);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid session mode specified (" ZEND_INT_FMT ")", session_mode);
return NULL;
}
if (session_mode & (OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) {
@@ -2070,7 +2070,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, php_size_t username_le
if (OCI_G(max_persistent) != -1 && OCI_G(num_persistent) >= OCI_G(max_persistent)) {
/* all persistent connactions are in use, fallback to non-persistent connection creation */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Too many open persistent connections (%ld)", OCI_G(num_persistent));
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Too many open persistent connections (" ZEND_INT_FMT ")", OCI_G(num_persistent));
alloc_non_persistent = 1;
}
}
+3 -3
View File
@@ -529,7 +529,7 @@ PHP_FUNCTION(oci_lob_write)
}
if (ZEND_NUM_ARGS() == 2) {
data_len = MIN(data_len, write_len);
data_len = write_len <= 0 ? 0 : MIN(data_len, (php_size_t)write_len);
}
}
else {
@@ -538,7 +538,7 @@ PHP_FUNCTION(oci_lob_write)
}
if (ZEND_NUM_ARGS() == 3) {
data_len = MIN(data_len, write_len);
data_len = write_len <= 0 ? 0 : MIN(data_len, (php_size_t)write_len);
}
}
@@ -549,7 +549,7 @@ PHP_FUNCTION(oci_lob_write)
PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
if (data_len <= 0) {
if (data_len == 0) {
RETURN_INT(0);
}
+3 -3
View File
@@ -63,7 +63,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, php_int_
/* these three are allowed */
break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown descriptor type %ld", type);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown descriptor type " ZEND_INT_FMT, type);
return NULL;
break;
}
@@ -634,7 +634,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, php_int_t flush_flag TSRML
/* only these two are allowed */
break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid flag value: %ld", flush_flag);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid flag value: " ZEND_INT_FMT, flush_flag);
return 1;
break;
}
@@ -918,7 +918,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, php_int_t type, char
/* only these two are allowed */
break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid temporary lob type: %ld", type);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid temporary lob type: " ZEND_INT_FMT, type);
return 1;
break;
}
+4 -4
View File
@@ -1454,7 +1454,7 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
convert_to_int(&tmp);
column = php_oci_statement_get_column(statement, Z_IVAL(tmp), NULL, 0 TSRMLS_CC);
if (!column) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%pd\"", Z_IVAL(tmp));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"" ZEND_INT_FMT "\"", Z_IVAL(tmp));
zval_dtor(&tmp);
return NULL;
}
@@ -1520,7 +1520,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, php_siz
convert_to_array(var);
if (maxlength < -1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid max length value (%pu)", maxlength);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid max length value (" ZEND_INT_FMT ")", maxlength);
return 1;
}
@@ -1551,7 +1551,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, php_siz
bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection TSRMLS_CC);
break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %ld", type);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: " ZEND_INT_FMT, type);
return 1;
break;
}
@@ -1627,7 +1627,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, php_int_t max_table_le
zend_hash_internal_pointer_reset(hash);
while (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) {
convert_to_string_ex(entry);
if (Z_STRSIZE_PP(entry) > maxlength) {
if (maxlength < 0 || (maxlength >= 0 && Z_STRSIZE_PP(entry) > maxlength)) {
maxlength = Z_STRSIZE_PP(entry) + 1;
}
zend_hash_move_forward(hash);