From: Andrey Hristov Date: Mon, 8 Jun 2009 10:19:29 +0000 (+0000) Subject: Merge with the branch, someone made changes in PHP5_3 and did not merge. X-Git-Tag: php-5.4.0alpha1~191^2~3384 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=efc752375e7afff287d4ed651d87644f9a082894;p=php Merge with the branch, someone made changes in PHP5_3 and did not merge. Also switch off the zval cache for now. --- diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 0f7c30bfb2..b46b273f89 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -664,7 +664,7 @@ PHPAPI MYSQLND *mysqlnd_connect(MYSQLND *conn, { auth_packet->charset_no = charset->nr; } else { -#if PHP_MAJOR_VERSION >= 6 +#if PHP_MAJOR_VERSION >= 6 auth_packet->charset_no = 200;/* utf8 - swedish collation, check mysqlnd_charset.c */ #else auth_packet->charset_no = greet_packet.charset_no; @@ -991,7 +991,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND **conn_array, fd_set *fds TS #endif /* {{{ _mysqlnd_poll */ -enum_func_status +PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, uint * desc_num TSRMLS_DC) { diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 0d928ce336..2924827e9c 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1378,7 +1378,7 @@ void php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffe bit = 4; /* first 2 bits are reserved */ for (i = 0; current_field < end_field; current_field++, i++) { -#if 1 +#ifdef USE_ZVAL_CACHE DBG_INF("Trying to use the zval cache"); obj = mysqlnd_palloc_get_zval(conn->zval_cache, &allocated TSRMLS_CC); if (allocated) { @@ -1474,11 +1474,12 @@ void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, for (i = 0; current_field < end_field; current_field++, i++) { /* Don't reverse the order. It is significant!*/ void *obj; - zend_bool allocated; + zend_bool allocated = TRUE; zend_uchar *this_field_len_pos = p; /* php_mysqlnd_net_field_length() call should be after *this_field_len_pos = p; */ unsigned long len = php_mysqlnd_net_field_length(&p); +#ifdef USE_ZVAL_CACHE obj = mysqlnd_palloc_get_zval(conn->zval_cache, &allocated TSRMLS_CC); if (allocated) { *current_field = (zval *) obj; @@ -1487,6 +1488,10 @@ void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, *current_field = &((mysqlnd_zval *) obj)->zv; ((mysqlnd_zval *) obj)->point_type = MYSQLND_POINTS_FREE; } +#else + DBG_INF("Directly creating zval"); + MAKE_STD_ZVAL(*current_field); +#endif if (current_field > start_field && last_field_was_string) { /* diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c index e08f0e47b4..7ebb748024 100644 --- a/ext/mysqlnd/php_mysqlnd.c +++ b/ext/mysqlnd/php_mysqlnd.c @@ -47,12 +47,12 @@ PHPAPI void mysqlnd_minfo_print_hash(zval *values) zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(values), &pos_values); while (zend_hash_get_current_data_ex(Z_ARRVAL_P(values), (void **)&values_entry, &pos_values) == SUCCESS) { + TSRMLS_FETCH(); zstr string_key; uint string_key_len; ulong num_key; int s_len; char *s = NULL; - TSRMLS_FETCH(); zend_hash_get_current_key_ex(Z_ARRVAL_P(values), &string_key, &string_key_len, &num_key, 0, &pos_values);