]> granicus.if.org Git - php/commitdiff
Merge with the branch, someone made changes in PHP5_3 and did not merge.
authorAndrey Hristov <andrey@php.net>
Mon, 8 Jun 2009 10:19:29 +0000 (10:19 +0000)
committerAndrey Hristov <andrey@php.net>
Mon, 8 Jun 2009 10:19:29 +0000 (10:19 +0000)
Also switch off the zval cache for now.

ext/mysqlnd/mysqlnd.c
ext/mysqlnd/mysqlnd_wireprotocol.c
ext/mysqlnd/php_mysqlnd.c

index 0f7c30bfb284448ffa586ffcf4a0bec4d748c96e..b46b273f892733243396c091436819c1950562e2 100644 (file)
@@ -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)
 {
 
index 0d928ce33618c4b1ae48ee0431acf32f65795ebc..2924827e9c00cdcdc809dbb5dca2f20d040909bd 100644 (file)
@@ -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) {
                        /*
index e08f0e47b45e31f437c898a24453e024cbf0fac9..7ebb748024d0f91f2debd86afab62746b99d353f 100644 (file)
@@ -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);