iliaa                                    Sun, 31 Jan 2010 19:18:56 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=294274

Log:
Fixed crash in ZTS mode due to ini values not being initialized

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c
    U   php/php-src/branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h
    U   php/php-src/trunk/ext/pdo_mysql/pdo_mysql.c
    U   php/php-src/trunk/ext/pdo_mysql/php_pdo_mysql_int.h

Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c      2010-01-31 
19:11:27 UTC (rev 294273)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c      2010-01-31 
19:18:56 UTC (rev 294274)
@@ -115,12 +115,11 @@
 /* }}} */


-#if PDO_USE_MYSQLND
+#if PDO_USE_MYSQLND && PDO_DBG_ENABLED
 /* {{{ PHP_RINIT_FUNCTION
  */
 static PHP_RINIT_FUNCTION(pdo_mysql)
 {
-#if PDO_DBG_ENABLED
        if (PDO_MYSQL_G(debug)) {
                MYSQLND_DEBUG *dbg = 
mysqlnd_debug_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
                if (!dbg) {
@@ -129,18 +128,15 @@
                dbg->m->set_mode(dbg, PDO_MYSQL_G(debug));
                PDO_MYSQL_G(dbg) = dbg;
        }
-#endif

        return SUCCESS;
 }
 /* }}} */

-
 /* {{{ PHP_RSHUTDOWN_FUNCTION
  */
 static PHP_RSHUTDOWN_FUNCTION(pdo_mysql)
 {
-#if PDO_DBG_ENABLED
        MYSQLND_DEBUG *dbg = PDO_MYSQL_G(dbg);
        PDO_DBG_ENTER("RSHUTDOWN");
        if (dbg) {
@@ -148,12 +144,12 @@
                dbg->m->free_handle(dbg);
                PDO_MYSQL_G(dbg) = NULL;
        }
-#endif
+
        return SUCCESS;
 }
 /* }}} */
+#endif

-
 /* {{{ PHP_GINIT_FUNCTION
  */
 static PHP_GINIT_FUNCTION(pdo_mysql)
@@ -167,9 +163,7 @@
 #endif
 }
 /* }}} */
-#endif

-
 /* {{{ pdo_mysql_functions[] */
 const zend_function_entry pdo_mysql_functions[] = {
        {NULL, NULL, NULL}
@@ -205,15 +199,11 @@
 #endif
        PHP_MINFO(pdo_mysql),
        "1.0.2",
-#if PDO_USE_MYSQLND
        PHP_MODULE_GLOBALS(pdo_mysql),
        PHP_GINIT(pdo_mysql),
        NULL,
        NULL,
        STANDARD_MODULE_PROPERTIES_EX
-#else
-       STANDARD_MODULE_PROPERTIES
-#endif
 };
 /* }}} */


Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h
===================================================================
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h      
2010-01-31 19:11:27 UTC (rev 294273)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h      
2010-01-31 19:18:56 UTC (rev 294274)
@@ -77,8 +77,6 @@
 #endif
 ZEND_END_MODULE_GLOBALS(pdo_mysql)

-ZEND_EXTERN_MODULE_GLOBALS(pdo_mysql);
-
 #ifdef ZTS
 #define PDO_MYSQL_G(v) TSRMG(pdo_mysql_globals_id, zend_pdo_mysql_globals *, v)
 #else

Modified: php/php-src/trunk/ext/pdo_mysql/pdo_mysql.c
===================================================================
--- php/php-src/trunk/ext/pdo_mysql/pdo_mysql.c 2010-01-31 19:11:27 UTC (rev 
294273)
+++ php/php-src/trunk/ext/pdo_mysql/pdo_mysql.c 2010-01-31 19:18:56 UTC (rev 
294274)
@@ -115,12 +115,11 @@
 /* }}} */


-#if PDO_USE_MYSQLND
+#if PDO_USE_MYSQLND && PDO_DBG_ENABLED
 /* {{{ PHP_RINIT_FUNCTION
  */
 static PHP_RINIT_FUNCTION(pdo_mysql)
 {
-#if PDO_DBG_ENABLED
        if (PDO_MYSQL_G(debug)) {
                MYSQLND_DEBUG *dbg = 
mysqlnd_debug_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
                if (!dbg) {
@@ -129,18 +128,15 @@
                dbg->m->set_mode(dbg, PDO_MYSQL_G(debug));
                PDO_MYSQL_G(dbg) = dbg;
        }
-#endif

        return SUCCESS;
 }
 /* }}} */

-
 /* {{{ PHP_RSHUTDOWN_FUNCTION
  */
 static PHP_RSHUTDOWN_FUNCTION(pdo_mysql)
 {
-#if PDO_DBG_ENABLED
        MYSQLND_DEBUG *dbg = PDO_MYSQL_G(dbg);
        PDO_DBG_ENTER("RSHUTDOWN");
        if (dbg) {
@@ -148,12 +144,12 @@
                dbg->m->free_handle(dbg);
                PDO_MYSQL_G(dbg) = NULL;
        }
-#endif
+
        return SUCCESS;
 }
 /* }}} */
+#endif

-
 /* {{{ PHP_GINIT_FUNCTION
  */
 static PHP_GINIT_FUNCTION(pdo_mysql)
@@ -167,9 +163,7 @@
 #endif
 }
 /* }}} */
-#endif

-
 /* {{{ pdo_mysql_functions[] */
 const zend_function_entry pdo_mysql_functions[] = {
        {NULL, NULL, NULL}
@@ -205,15 +199,11 @@
 #endif
        PHP_MINFO(pdo_mysql),
        "1.0.2",
-#if PDO_USE_MYSQLND
        PHP_MODULE_GLOBALS(pdo_mysql),
        PHP_GINIT(pdo_mysql),
        NULL,
        NULL,
        STANDARD_MODULE_PROPERTIES_EX
-#else
-       STANDARD_MODULE_PROPERTIES
-#endif
 };
 /* }}} */


Modified: php/php-src/trunk/ext/pdo_mysql/php_pdo_mysql_int.h
===================================================================
--- php/php-src/trunk/ext/pdo_mysql/php_pdo_mysql_int.h 2010-01-31 19:11:27 UTC 
(rev 294273)
+++ php/php-src/trunk/ext/pdo_mysql/php_pdo_mysql_int.h 2010-01-31 19:18:56 UTC 
(rev 294274)
@@ -77,8 +77,6 @@
 #endif
 ZEND_END_MODULE_GLOBALS(pdo_mysql)

-ZEND_EXTERN_MODULE_GLOBALS(pdo_mysql);
-
 #ifdef ZTS
 #define PDO_MYSQL_G(v) TSRMG(pdo_mysql_globals_id, zend_pdo_mysql_globals *, v)
 #else

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

Reply via email to