andrey          Thu Feb 14 15:20:08 2008 UTC

  Modified files:              
    /php-src/ext/mysqlnd        mysqlnd.h mysqlnd_debug.c php_mysqlnd.c 
  Log:
  Another fix
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.12&r2=1.13&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd.h
diff -u php-src/ext/mysqlnd/mysqlnd.h:1.12 php-src/ext/mysqlnd/mysqlnd.h:1.13
--- php-src/ext/mysqlnd/mysqlnd.h:1.12  Thu Feb 14 12:51:00 2008
+++ php-src/ext/mysqlnd/mysqlnd.h       Thu Feb 14 15:20:08 2008
@@ -18,12 +18,12 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd.h,v 1.12 2008/02/14 12:51:00 andrey Exp $ */
+/* $Id: mysqlnd.h,v 1.13 2008/02/14 15:20:08 andrey Exp $ */
 
 #ifndef MYSQLND_H
 #define MYSQLND_H
 
-#define MYSQLND_VERSION "mysqlnd 5.0.3-dev - 080129 - $Revision: 1.12 $"
+#define MYSQLND_VERSION "mysqlnd 5.0.3-dev - 080129 - $Revision: 1.13 $"
 #define MYSQLND_VERSION_ID 50002
 
 /* This forces inlining of some accessor functions */
@@ -346,7 +346,7 @@
        MYSQLND_DEBUG   *dbg;   /* The DBG object */
        long                    net_cmd_buffer_size;
        long                    net_read_buffer_size;
-#ifdef ZTS
+#ifdef MYSQLND_THREADED
        THREAD_T                thread_id;
 #endif
 ZEND_END_MODULE_GLOBALS(mysqlnd)
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.c?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_debug.c
diff -u php-src/ext/mysqlnd/mysqlnd_debug.c:1.5 
php-src/ext/mysqlnd/mysqlnd_debug.c:1.6
--- php-src/ext/mysqlnd/mysqlnd_debug.c:1.5     Thu Feb 14 12:51:00 2008
+++ php-src/ext/mysqlnd/mysqlnd_debug.c Thu Feb 14 15:20:08 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd_debug.c,v 1.5 2008/02/14 12:51:00 andrey Exp $ */
+/* $Id: mysqlnd_debug.c,v 1.6 2008/02/14 15:20:08 andrey Exp $ */
 
 #include "php.h"
 #include "mysqlnd.h"
@@ -95,7 +95,7 @@
                 line_buffer[6], level_buffer[7];
        MYSQLND_ZTS(self);
 
-#ifdef ZTS
+#ifdef MYSQLND_THREADED
        if (MYSQLND_G(thread_id) != tsrm_thread_id()) {
                return PASS; /* don't trace background threads */
        }
@@ -201,7 +201,7 @@
                 line_buffer[6], level_buffer[7];
        MYSQLND_ZTS(self);
 
-#ifdef ZTS
+#ifdef MYSQLND_THREADED
        if (MYSQLND_G(thread_id) != tsrm_thread_id()) {
                return PASS; /* don't trace background threads */
        }
@@ -303,11 +303,13 @@
                                                                                
  unsigned int line, const char * const file,
                                                                                
  char * func_name, uint func_name_len)
 {
+#ifdef MYSQLND_THREADED
        MYSQLND_ZTS(self);
+#endif
        if ((self->flags & MYSQLND_DEBUG_DUMP_TRACE) == 0 || self->file_name == 
NULL) {
                return FALSE;
        }
-#ifdef ZTS
+#ifdef MYSQLND_THREADED
        if (MYSQLND_G(thread_id) != tsrm_thread_id()) {
                return FALSE; /* don't trace background threads */
        }
@@ -349,12 +351,13 @@
                                                                                
  const char * const file)
 {
        char *func_name;
+#ifdef MYSQLND_THREADED
        MYSQLND_ZTS(self);
-
+#endif
        if ((self->flags & MYSQLND_DEBUG_DUMP_TRACE) == 0 || self->file_name == 
NULL) {
                return PASS;
        }
-#ifdef ZTS
+#ifdef MYSQLND_THREADED
        if (MYSQLND_G(thread_id) != tsrm_thread_id()) {
                return PASS; /* don't trace background threads */
        }
@@ -667,7 +670,7 @@
 {
        void *ret;
        DBG_ENTER(mysqlnd_emalloc_name);
-#ifdef ZTS
+#ifdef MYSQLND_THREADED
        if (MYSQLND_G(thread_id) != tsrm_thread_id()) {
                DBG_RETURN(_mysqlnd_pemalloc(size, 1 TSRMLS_CC 
ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC));
        }
@@ -720,7 +723,7 @@
 {
        void *ret;
        DBG_ENTER(mysqlnd_ecalloc_name);
-#ifdef ZTS
+#ifdef MYSQLND_THREADED
        if (MYSQLND_G(thread_id) != tsrm_thread_id()) {
                DBG_RETURN(_mysqlnd_pecalloc(nmemb, size, 1 TSRMLS_CC 
ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC));
        }
@@ -773,7 +776,7 @@
 {
        void *ret;
        DBG_ENTER(mysqlnd_erealloc_name);
-#ifdef ZTS
+#ifdef MYSQLND_THREADED
        if (MYSQLND_G(thread_id) != tsrm_thread_id()) {
                DBG_RETURN(_mysqlnd_perealloc(ptr, new_size, 1 TSRMLS_CC 
ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC));
        }
@@ -827,7 +830,7 @@
 void _mysqlnd_efree(void *ptr MYSQLND_MEM_D)
 {
        DBG_ENTER(mysqlnd_efree_name);
-#ifdef ZTS
+#ifdef MYSQLND_THREADED
        if (MYSQLND_G(thread_id) != tsrm_thread_id()) {
                DBG_RETURN(_mysqlnd_pefree(ptr, 1 TSRMLS_CC ZEND_FILE_LINE_CC 
ZEND_FILE_LINE_EMPTY_CC));
        }
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/php_mysqlnd.c?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/mysqlnd/php_mysqlnd.c
diff -u php-src/ext/mysqlnd/php_mysqlnd.c:1.3 
php-src/ext/mysqlnd/php_mysqlnd.c:1.4
--- php-src/ext/mysqlnd/php_mysqlnd.c:1.3       Thu Feb 14 12:51:00 2008
+++ php-src/ext/mysqlnd/php_mysqlnd.c   Thu Feb 14 15:20:08 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_mysqlnd.c,v 1.3 2008/02/14 12:51:00 andrey Exp $ */
+/* $Id: php_mysqlnd.c,v 1.4 2008/02/14 15:20:08 andrey Exp $ */
 #include "php.h"
 #include "php_ini.h"
 #include "mysqlnd.h"
@@ -178,11 +178,12 @@
 /* }}} */
 
 
-#ifdef PHP_DEBUG
+#if defined(PHP_DEBUG) || defined(MYSQLND_THREADED)
 /* {{{ PHP_RINIT_FUNCTION
  */
 static PHP_RINIT_FUNCTION(mysqlnd)
 {
+#if defined(PHP_DEBUG)
        if (MYSQLND_G(debug)) {
                MYSQLND_DEBUG *dbg = mysqlnd_debug_init(TSRMLS_C);
                if (!dbg) {
@@ -190,8 +191,11 @@
                }
                dbg->m->set_mode(dbg, MYSQLND_G(debug));
                MYSQLND_G(dbg) = dbg;
-               MYSQLND_G(thread_id) = tsrm_thread_id();
        }
+#endif
+#ifdef MYSQLND_THREADED
+       MYSQLND_G(thread_id) = tsrm_thread_id();
+#endif
        return SUCCESS;
 }
 /* }}} */
@@ -222,11 +226,14 @@
        mysqlnd_functions,
        PHP_MINIT(mysqlnd),
        PHP_MSHUTDOWN(mysqlnd),
-#ifdef PHP_DEBUG
+#ifdef PHP_DEBUG || defined(MYSQLND_THREADED)
        PHP_RINIT(mysqlnd),
-       PHP_RSHUTDOWN(mysqlnd),
 #else
        NULL,
+#endif
+#ifdef PHP_DEBUG
+       PHP_RSHUTDOWN(mysqlnd),
+#else
        NULL,
 #endif
        PHP_MINFO(mysqlnd),

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

Reply via email to