andrey          Tue Jul 22 16:05:28 2008 UTC

  Modified files:              
    /php-src/ext/mysqlnd        mysqlnd_ps_codec.c mysqlnd_wireprotocol.c 
  Log:
  More debugging info
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_ps_codec.c?r1=1.10&r2=1.11&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_ps_codec.c
diff -u php-src/ext/mysqlnd/mysqlnd_ps_codec.c:1.10 
php-src/ext/mysqlnd/mysqlnd_ps_codec.c:1.11
--- php-src/ext/mysqlnd/mysqlnd_ps_codec.c:1.10 Thu Apr 24 14:04:58 2008
+++ php-src/ext/mysqlnd/mysqlnd_ps_codec.c      Tue Jul 22 16:05:28 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd_ps_codec.c,v 1.10 2008/04/24 14:04:58 andrey Exp $ */
+/* $Id: mysqlnd_ps_codec.c,v 1.11 2008/07/22 16:05:28 andrey Exp $ */
 #include "php.h"
 #include "mysqlnd.h"
 #include "mysqlnd_wireprotocol.h"
@@ -72,6 +72,8 @@
        char tmp[22];
        size_t tmp_len = 0;
        zend_bool is_bit = field->type == MYSQL_TYPE_BIT;
+       DBG_ENTER("ps_fetch_from_1_to_8_bytes");
+       DBG_INF_FMT("zv=%p byte_count=%d", zv, byte_count);
        if (field->flags & UNSIGNED_FLAG) {
                uint64 uval = 0;
 
@@ -88,6 +90,7 @@
 
 #if SIZEOF_LONG==4
                if (uval > INT_MAX) {
+                       DBG_INF("stringify");
                        tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval);
                } else 
 #endif /* #if SIZEOF_LONG==4 */
@@ -95,6 +98,7 @@
                        if (byte_count < 8 || uval <= L64(9223372036854775807)) 
{
                                ZVAL_LONG(zv, uval);
                        } else {
+                               DBG_INF("stringify");
                                tmp_len = sprintf((char *)&tmp, 
MYSQLND_LLU_SPEC, uval);
                        }
                }
@@ -115,6 +119,7 @@
 
 #if SIZEOF_LONG==4
            if ((L64(2147483647) < (int64) lval) || (L64(-2147483648) > (int64) 
lval)) {
+                       DBG_INF("stringify");
                        tmp_len = sprintf((char *)&tmp, MYSQLND_LL_SPEC, lval);
                } else 
 #endif /* SIZEOF */
@@ -126,14 +131,17 @@
        if (tmp_len) {
 #if PHP_MAJOR_VERSION >= 6
                if (as_unicode) {
+                       DBG_INF("stringify");
                        ZVAL_UTF8_STRINGL(zv, tmp, tmp_len, ZSTR_DUPLICATE);
                } else
 #endif
                {
+                       DBG_INF("stringify");
                        ZVAL_STRINGL(zv, tmp, tmp_len, 1);
                }                       
        }
        (*row)+= byte_count;
+       DBG_VOID_RETURN;
 }
 /* }}} */
 
@@ -200,9 +208,12 @@
                                        zend_bool as_unicode TSRMLS_DC)
 {
        float value;
+       DBG_ENTER("ps_fetch_float");
        float4get(value, *row);
        ZVAL_DOUBLE(zv, value);
        (*row)+= 4;
+       DBG_INF_FMT("value=%f", value);
+       DBG_VOID_RETURN;
 }
 /* }}} */
 
@@ -214,9 +225,12 @@
                                        zend_bool as_unicode TSRMLS_DC)
 {
        double value;
+       DBG_ENTER("ps_fetch_double");
        float8get(value, *row);
        ZVAL_DOUBLE(zv, value);
        (*row)+= 8;
+       DBG_INF_FMT("value=%f", value);
+       DBG_VOID_RETURN;
 }
 /* }}} */
 
@@ -230,6 +244,7 @@
        struct st_mysqlnd_time t;
        unsigned int length; /* First byte encodes the length*/
        char *to;
+       DBG_ENTER("ps_fetch_time");
 
        if ((length = php_mysqlnd_net_field_length(row))) {
                zend_uchar *to= *row;
@@ -262,6 +277,7 @@
        length = spprintf(&to, 0, "%s%02u:%02u:%02u",
                                         (t.neg ? "-" : ""), t.hour, t.minute, 
t.second);
 
+       DBG_INF_FMT("%s", to);
 #if PHP_MAJOR_VERSION >= 6
        if (!as_unicode) {
 #endif
@@ -272,6 +288,7 @@
                ZVAL_UTF8_STRINGL(zv, to, length, ZSTR_AUTOFREE);       
        }
 #endif
+       DBG_VOID_RETURN;
 }
 /* }}} */
 
@@ -285,6 +302,7 @@
        struct st_mysqlnd_time t = {0};
        unsigned int length; /* First byte encodes the length*/
        char *to;
+       DBG_ENTER("ps_fetch_date");
 
        if ((length = php_mysqlnd_net_field_length(row))) {
                zend_uchar *to= *row;
@@ -310,6 +328,7 @@
        */
        length = spprintf(&to, 0, "%04u-%02u-%02u", t.year, t.month, t.day);
 
+       DBG_INF_FMT("%s", to);
 #if PHP_MAJOR_VERSION >= 6
        if (!as_unicode) {
 #endif
@@ -320,6 +339,7 @@
                ZVAL_UTF8_STRINGL(zv, to, length, ZSTR_AUTOFREE);       
        }
 #endif
+       DBG_VOID_RETURN;
 }
 /* }}} */
 
@@ -333,6 +353,7 @@
        struct st_mysqlnd_time t;
        unsigned int length; /* First byte encodes the length*/
        char *to;
+       DBG_ENTER("ps_fetch_datetime");
 
        if ((length = php_mysqlnd_net_field_length(row))) {
                zend_uchar *to= *row;
@@ -366,6 +387,7 @@
        length = spprintf(&to, 0, "%04u-%02u-%02u %02u:%02u:%02u",
                                          t.year, t.month, t.day, t.hour, 
t.minute, t.second);
 
+       DBG_INF_FMT("%s", to);
 #if PHP_MAJOR_VERSION >= 6
        if (!as_unicode) {
 #endif
@@ -376,6 +398,7 @@
                ZVAL_UTF8_STRINGL(zv, to, length, ZSTR_AUTOFREE);       
        }
 #endif
+       DBG_VOID_RETURN;
 }
 /* }}} */
 
@@ -390,12 +413,14 @@
          For now just copy, before we make it possible
          to write \0 to the row buffer
        */
-       unsigned long length= php_mysqlnd_net_field_length(row);
-
+       unsigned long length = php_mysqlnd_net_field_length(row);
+       DBG_ENTER("ps_fetch_string");
+       DBG_INF_FMT("len = %lu", length);
 #if PHP_MAJOR_VERSION < 6
        ZVAL_STRINGL(zv, (char *)*row, length, 1);      
 #else
        if (field->charsetnr == MYSQLND_BINARY_CHARSET_NR) {
+               DBG_INF("Binary charset");
                ZVAL_STRINGL(zv, (char *)*row, length, 1);
        } else {
                ZVAL_UTF8_STRINGL(zv, (char*)*row, length, ZSTR_DUPLICATE);
@@ -403,6 +428,7 @@
 #endif
 
        (*row) += length;
+       DBG_VOID_RETURN;
 }
 /* }}} */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.c?r1=1.17&r2=1.18&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c
diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.17 
php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.18
--- php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.17     Tue Jul 15 13:12:27 2008
+++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.c  Tue Jul 22 16:05:28 2008
@@ -462,10 +462,9 @@
                DBG_RETURN(PASS);
        }
 
-#if !MYSQLND_SILENT
        DBG_ERR_FMT("Packets out of order. Expected %d received %d. Packet 
size=%d",
                                net->packet_no, header->packet_no, 
header->size);
-#endif
+
        php_error(E_WARNING, "Packets out of order. Expected %d received %d. 
Packet size=%d. PID=%d",
                          net->packet_no, header->packet_no, header->size, 
getpid());
        DBG_RETURN(FAIL);
@@ -1216,10 +1215,10 @@
                *(root_ptr +=len) = '\0';
                root_ptr++;
        }
-/*
+
        DBG_INF_FMT("FIELD=[%s.%s.%s]", meta->db? meta->db:"*NA*", meta->table? 
meta->table:"*NA*",
                                meta->name? meta->name:"*NA*");
-*/
+
        DBG_RETURN(PASS);
 
 faulty_or_fake:
@@ -1346,6 +1345,7 @@
 
        for (i = 0; current_field < end_field; current_field++, i++) {
 #if 1
+               DBG_INF("Trying to use the zval cache");
                obj = mysqlnd_palloc_get_zval(conn->zval_cache, &allocated 
TSRMLS_CC);
                if (allocated) {
                        *current_field = (zval *) obj;
@@ -1355,9 +1355,16 @@
                        ((mysqlnd_zval *) obj)->point_type = 
MYSQLND_POINTS_EXT_BUFFER;
                }
 #else
+               DBG_INF("Directly creating zval");
                MAKE_STD_ZVAL(*current_field);
 #endif
+
+               DBG_INF_FMT("Into zval=%p decoding column %d [%s.%s.%s] type=%d 
field->flags&unsigned=%d flags=%u is_bit=%d as_unicode=%d",
+                       *current_field, i,
+                       fields_metadata[i].db, fields_metadata[i].table, 
fields_metadata[i].name, fields_metadata[i].type,
+                       fields_metadata[i].flags & UNSIGNED_FLAG, 
fields_metadata[i].flags, fields_metadata[i].type == MYSQL_TYPE_BIT, 
as_unicode);
                if (*null_ptr & bit) {
+                       DBG_INF("It's null");
                        ZVAL_NULL(*current_field);
                } else {
                        enum_mysqlnd_field_types type = fields_metadata[i].type;



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

Reply via email to