andrey          Mon Jun  8 10:20:27 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/mysqlnd        mysqlnd_palloc.c mysqlnd_wireprotocol.c 
  Log:
  Merge with HEAD. Someone committed changes to HEAD and did not merge back to
  the branch.
  Also switch off the zval cache, for now.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_palloc.c?r1=1.2.2.16&r2=1.2.2.17&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_palloc.c
diff -u php-src/ext/mysqlnd/mysqlnd_palloc.c:1.2.2.16 
php-src/ext/mysqlnd/mysqlnd_palloc.c:1.2.2.17
--- php-src/ext/mysqlnd/mysqlnd_palloc.c:1.2.2.16       Thu May 28 16:35:41 2009
+++ php-src/ext/mysqlnd/mysqlnd_palloc.c        Mon Jun  8 10:20:27 2009
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd_palloc.c,v 1.2.2.16 2009/05/28 16:35:41 andrey Exp $ */
+/* $Id: mysqlnd_palloc.c,v 1.2.2.17 2009/06/08 10:20:27 andrey Exp $ */
 #include "php.h"
 #include "mysqlnd.h"
 #include "mysqlnd_priv.h"
@@ -549,48 +549,45 @@
 {
        if (cache) {
 #if PHP_MAJOR_VERSION >= 6
+               UChar *ustr;
+               int ulen;
+                       
                TSRMLS_FETCH();
 #endif
 
                LOCK_PCACHE(cache);
                array_init(return_value);
 #if PHP_MAJOR_VERSION >= 6
-               if (UG(unicode)) {
-                       UChar *ustr;
-                       int ulen;
-
-                       zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, 
"put_hits", sizeof("put_hits") TSRMLS_CC);
-                       add_u_assoc_long_ex(return_value, IS_UNICODE, 
ZSTR(ustr), ulen + 1, cache->put_hits);
-                       efree(ustr);
-                       zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, 
"put_misses", sizeof("put_misses") TSRMLS_CC);
-                       add_u_assoc_long_ex(return_value, IS_UNICODE, 
ZSTR(ustr), ulen + 1, cache->put_hits);
-                       efree(ustr);
-                       zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, 
"get_hits", sizeof("get_hits") TSRMLS_CC);
-                       add_u_assoc_long_ex(return_value, IS_UNICODE, 
ZSTR(ustr), ulen + 1, cache->put_hits);
-                       efree(ustr);
-                       zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, 
"get_misses", sizeof("get_misses") TSRMLS_CC);
-                       add_u_assoc_long_ex(return_value, IS_UNICODE, 
ZSTR(ustr), ulen + 1, cache->put_hits);
-                       efree(ustr);
-                       zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, 
"size", sizeof("size") TSRMLS_CC);
-                       add_u_assoc_long_ex(return_value, IS_UNICODE, 
ZSTR(ustr), ulen + 1, cache->put_hits);
-                       efree(ustr);
-                       zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, 
"free_items", sizeof("free_items") TSRMLS_CC);
-                       add_u_assoc_long_ex(return_value, IS_UNICODE, 
ZSTR(ustr), ulen + 1, cache->put_hits);
-                       efree(ustr);
-                       zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, 
"references", sizeof("references") TSRMLS_CC);
-                       add_u_assoc_long_ex(return_value, IS_UNICODE, 
ZSTR(ustr), ulen + 1, cache->put_hits);
-                       efree(ustr);
-               } else
+               zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "put_hits", 
sizeof("put_hits") TSRMLS_CC);
+               add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen 
+ 1, cache->put_hits);
+               efree(ustr);
+               zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, 
"put_misses", sizeof("put_misses") TSRMLS_CC);
+               add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen 
+ 1, cache->put_hits);
+               efree(ustr);
+               zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "get_hits", 
sizeof("get_hits") TSRMLS_CC);
+               add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen 
+ 1, cache->put_hits);
+               efree(ustr);
+               zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, 
"get_misses", sizeof("get_misses") TSRMLS_CC);
+               add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen 
+ 1, cache->put_hits);
+               efree(ustr);
+               zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "size", 
sizeof("size") TSRMLS_CC);
+               add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen 
+ 1, cache->put_hits);
+               efree(ustr);
+               zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, 
"free_items", sizeof("free_items") TSRMLS_CC);
+               add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen 
+ 1, cache->put_hits);
+               efree(ustr);
+               zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, 
"references", sizeof("references") TSRMLS_CC);
+               add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen 
+ 1, cache->put_hits);
+               efree(ustr);
+#else
+               add_assoc_long_ex(return_value, "put_hits",             
sizeof("put_hits"),             cache->put_hits);
+               add_assoc_long_ex(return_value, "put_misses",   
sizeof("put_misses"),   cache->put_misses);
+               add_assoc_long_ex(return_value, "get_hits",             
sizeof("get_hits"),             cache->get_hits);
+               add_assoc_long_ex(return_value, "get_misses",   
sizeof("get_misses"),   cache->get_misses);
+               add_assoc_long_ex(return_value, "size",                 
sizeof("size"),                 cache->max_items);
+               add_assoc_long_ex(return_value, "free_items",   
sizeof("free_items"),   cache->free_items);
+               add_assoc_long_ex(return_value, "references",   
sizeof("references"),   cache->references);
 #endif
-               {
-                       add_assoc_long_ex(return_value, "put_hits",             
sizeof("put_hits"),             cache->put_hits);
-                       add_assoc_long_ex(return_value, "put_misses",   
sizeof("put_misses"),   cache->put_misses);
-                       add_assoc_long_ex(return_value, "get_hits",             
sizeof("get_hits"),             cache->get_hits);
-                       add_assoc_long_ex(return_value, "get_misses",   
sizeof("get_misses"),   cache->get_misses);
-                       add_assoc_long_ex(return_value, "size",                 
sizeof("size"),                 cache->max_items);
-                       add_assoc_long_ex(return_value, "free_items",   
sizeof("free_items"),   cache->free_items);
-                       add_assoc_long_ex(return_value, "references",   
sizeof("references"),   cache->references);
-               }
                UNLOCK_PCACHE(cache);
        } else {
                ZVAL_NULL(return_value);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.c?r1=1.4.2.24&r2=1.4.2.25&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c
diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.4.2.24 
php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.4.2.25
--- php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.4.2.24 Wed Dec 31 11:15:39 2008
+++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.c  Mon Jun  8 10:20:27 2009
@@ -1378,7 +1378,7 @@
        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 @@
        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 @@
                        *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) {
                        /*



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to