andrey          Mon Jul 21 13:01:41 2008 UTC

  Modified files:              
    /php-src/ext/mysql  config.m4 php_mysql.c php_mysql_structs.h 
    /php-src/ext/mysqli mysqli.c php_mysqli_structs.h 
    /php-src/ext/pdo_mysql      config.m4 mysql_driver.c pdo_mysql.c 
                                php_pdo_mysql_int.h 
  Log:
  MFB :
  
  Fix for bug#45179 --with-mysql-sock fails to compile & work
  Now --with-mysql-sock controls all mysql extensions. If provided it will be
  the default value as it was set in php.ini . php.ini will override it for
  ext/mysql and ext/mysqli but not for pdo_mysql
  
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/config.m4?r1=1.74&r2=1.75&diff_format=u
Index: php-src/ext/mysql/config.m4
diff -u php-src/ext/mysql/config.m4:1.74 php-src/ext/mysql/config.m4:1.75
--- php-src/ext/mysql/config.m4:1.74    Mon Mar 10 20:27:15 2008
+++ php-src/ext/mysql/config.m4 Mon Jul 21 13:01:41 2008
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.74 2008/03/10 20:27:15 andrey Exp $
+dnl $Id: config.m4,v 1.75 2008/07/21 13:01:41 andrey Exp $
 dnl
 
 AC_DEFUN([MYSQL_LIB_CHK], [
@@ -31,7 +31,7 @@
   done
 
   if test -n "$MYSQL_SOCK"; then
-    AC_DEFINE_UNQUOTED(MYSQL_UNIX_ADDR, "$MYSQL_SOCK", [ ])
+    AC_DEFINE_UNQUOTED(PHP_MYSQL_UNIX_SOCK_ADDR, "$MYSQL_SOCK", [ ])
     AC_MSG_RESULT([$MYSQL_SOCK])
   else
     AC_MSG_RESULT([no])
@@ -45,7 +45,7 @@
                           the MySQL native driver will be used [/usr/local]])
 
 PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket,
-[  --with-mysql-sock[=DIR]   MySQL: Location of the MySQL unix socket pointer.
+[  --with-mysql-sock[=DIR]   MySQL/MySQLi/PDO_MYSQL: Location of the MySQL 
unix socket pointer.
                             If unspecified, the default locations are 
searched], no, no)
 
 if test -z "$PHP_ZLIB_DIR"; then
@@ -62,7 +62,7 @@
   AC_MSG_CHECKING([for MySQL UNIX socket location])
   if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then
     MYSQL_SOCK=$PHP_MYSQL_SOCK
-    AC_DEFINE_UNQUOTED(MYSQL_UNIX_ADDR, "$MYSQL_SOCK", [ ])
+    AC_DEFINE_UNQUOTED(PHP_MYSQL_UNIX_SOCK_ADDR, "$MYSQL_SOCK", [ ])
     AC_MSG_RESULT([$MYSQL_SOCK])
   elif test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL_SOCK" = "yes"; then
     PHP_MYSQL_SOCKET_SEARCH
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.260&r2=1.261&diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.260 php-src/ext/mysql/php_mysql.c:1.261
--- php-src/ext/mysql/php_mysql.c:1.260 Tue Jul 15 13:12:27 2008
+++ php-src/ext/mysql/php_mysql.c       Mon Jul 21 13:01:41 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
  
-/* $Id: php_mysql.c,v 1.260 2008/07/15 13:12:27 andrey Exp $ */
+/* $Id: php_mysql.c,v 1.261 2008/07/21 13:01:41 andrey Exp $ */
 
 /* TODO:
  *
@@ -394,7 +394,11 @@
        STD_PHP_INI_ENTRY("mysql.default_user",                 NULL,   
PHP_INI_ALL,            OnUpdateString,         default_user,           
zend_mysql_globals,             mysql_globals)
        STD_PHP_INI_ENTRY("mysql.default_password",             NULL,   
PHP_INI_ALL,            OnUpdateString,         default_password,       
zend_mysql_globals,             mysql_globals)
        PHP_INI_ENTRY("mysql.default_port",                             NULL,   
PHP_INI_ALL,            OnMySQLPort)
+#ifdef MYSQL_UNIX_ADDR
+       STD_PHP_INI_ENTRY("mysql.default_socket",               
MYSQL_UNIX_ADDR,PHP_INI_ALL,OnUpdateStringUnempty,      default_socket, 
zend_mysql_globals,             mysql_globals)
+#else
        STD_PHP_INI_ENTRY("mysql.default_socket",               NULL,   
PHP_INI_ALL,            OnUpdateStringUnempty,  default_socket, 
zend_mysql_globals,             mysql_globals)
+#endif
        STD_PHP_INI_ENTRY("mysql.connect_timeout",              "60",   
PHP_INI_ALL,            OnUpdateLong,           connect_timeout,        
zend_mysql_globals,             mysql_globals)
        STD_PHP_INI_BOOLEAN("mysql.trace_mode",                 "0",    
PHP_INI_ALL,            OnUpdateLong,           trace_mode,             
zend_mysql_globals,             mysql_globals)
        STD_PHP_INI_BOOLEAN("mysql.allow_local_infile", "1",    PHP_INI_SYSTEM, 
        OnUpdateLong,           allow_local_infile, zend_mysql_globals,         
mysql_globals)
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql_structs.h?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/mysql/php_mysql_structs.h
diff -u php-src/ext/mysql/php_mysql_structs.h:1.5 
php-src/ext/mysql/php_mysql_structs.h:1.6
--- php-src/ext/mysql/php_mysql_structs.h:1.5   Mon Mar 10 20:27:15 2008
+++ php-src/ext/mysql/php_mysql_structs.h       Mon Jul 21 13:01:41 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_mysql_structs.h,v 1.5 2008/03/10 20:27:15 andrey Exp $ */
+/* $Id: php_mysql_structs.h,v 1.6 2008/07/21 13:01:41 andrey Exp $ */
 
 #ifndef PHP_MYSQL_STRUCTS_H
 #define PHP_MYSQL_STRUCTS_H
@@ -43,6 +43,13 @@
 #include <mysql.h>
 #endif
 
+#ifdef PHP_MYSQL_UNIX_SOCK_ADDR
+#ifdef MYSQL_UNIX_ADDR
+#undef MYSQL_UNIX_ADDR
+#endif
+#define MYSQL_UNIX_ADDR PHP_MYSQL_UNIX_SOCK_ADDR
+#endif
+
 #if (MYSQL_VERSION_ID >= 40113 && MYSQL_VERSION_ID < 50000) || 
MYSQL_VERSION_ID >= 50007 || MYSQL_USE_MYSQLND
 #define MYSQL_HAS_SET_CHARSET
 #endif
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli.c?r1=1.130&r2=1.131&diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.130 php-src/ext/mysqli/mysqli.c:1.131
--- php-src/ext/mysqli/mysqli.c:1.130   Tue Jul 15 13:12:27 2008
+++ php-src/ext/mysqli/mysqli.c Mon Jul 21 13:01:41 2008
@@ -17,7 +17,7 @@
   |          Ulf Wendel <[EMAIL PROTECTED]>                                    
 |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli.c,v 1.130 2008/07/15 13:12:27 andrey Exp $ 
+  $Id: mysqli.c,v 1.131 2008/07/21 13:01:41 andrey Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -644,7 +644,11 @@
        STD_PHP_INI_ENTRY("mysqli.default_user",                        NULL,   
PHP_INI_ALL,            OnUpdateString,         default_user,           
zend_mysqli_globals,            mysqli_globals)
        STD_PHP_INI_ENTRY("mysqli.default_pw",                          NULL,   
PHP_INI_ALL,            OnUpdateString,         default_pw,                     
zend_mysqli_globals,            mysqli_globals)
        STD_PHP_INI_ENTRY("mysqli.default_port",                        "3306", 
PHP_INI_ALL,            OnUpdateLong,           default_port,           
zend_mysqli_globals,            mysqli_globals)
+#ifdef PHP_MYSQL_UNIX_SOCK_ADDR
+       STD_PHP_INI_ENTRY("mysqli.default_socket",                      
MYSQL_UNIX_ADDR,PHP_INI_ALL,OnUpdateStringUnempty,      default_socket, 
zend_mysqli_globals,            mysqli_globals)
+#else
        STD_PHP_INI_ENTRY("mysqli.default_socket",                      NULL,   
PHP_INI_ALL,            OnUpdateStringUnempty,  default_socket, 
zend_mysqli_globals,            mysqli_globals)
+#endif
        STD_PHP_INI_BOOLEAN("mysqli.reconnect",                         "0",    
PHP_INI_SYSTEM,         OnUpdateLong,           reconnect,                      
zend_mysqli_globals,            mysqli_globals)
        STD_PHP_INI_BOOLEAN("mysqli.allow_local_infile",        "1",    
PHP_INI_SYSTEM,         OnUpdateLong,           allow_local_infile,     
zend_mysqli_globals,            mysqli_globals)
 #ifdef MYSQLI_USE_MYSQLND
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/php_mysqli_structs.h?r1=1.16&r2=1.17&diff_format=u
Index: php-src/ext/mysqli/php_mysqli_structs.h
diff -u php-src/ext/mysqli/php_mysqli_structs.h:1.16 
php-src/ext/mysqli/php_mysqli_structs.h:1.17
--- php-src/ext/mysqli/php_mysqli_structs.h:1.16        Thu Apr 24 14:04:58 2008
+++ php-src/ext/mysqli/php_mysqli_structs.h     Mon Jul 21 13:01:41 2008
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: php_mysqli_structs.h,v 1.16 2008/04/24 14:04:58 andrey Exp $ 
+  $Id: php_mysqli_structs.h,v 1.17 2008/07/21 13:01:41 andrey Exp $ 
 */
 
 #ifndef PHP_MYSQLI_STRUCTS_H
@@ -45,6 +45,13 @@
 #include "mysqli_libmysql.h"
 #endif
 
+#ifdef PHP_MYSQL_UNIX_SOCK_ADDR
+#ifdef MYSQL_UNIX_ADDR
+#undef MYSQL_UNIX_ADDR
+#endif
+#define MYSQL_UNIX_ADDR PHP_MYSQL_UNIX_SOCK_ADDR
+#endif
+
 #include "php_mysqli.h"
 
 /* character set support */
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/config.m4?r1=1.26&r2=1.27&diff_format=u
Index: php-src/ext/pdo_mysql/config.m4
diff -u php-src/ext/pdo_mysql/config.m4:1.26 
php-src/ext/pdo_mysql/config.m4:1.27
--- php-src/ext/pdo_mysql/config.m4:1.26        Sat Sep 24 23:22:43 2005
+++ php-src/ext/pdo_mysql/config.m4     Mon Jul 21 13:01:41 2008
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.26 2005/09/24 23:22:43 sniper Exp $
+dnl $Id: config.m4,v 1.27 2008/07/21 13:01:41 andrey Exp $
 dnl
 
 if test "$PHP_PDO" != "no"; then
@@ -47,7 +47,11 @@
        PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket` 
   fi
 
-  AC_DEFINE_UNQUOTED(PDO_MYSQL_UNIX_ADDR, "$PDO_MYSQL_SOCKET", [ ])
+  if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then
+    AC_DEFINE_UNQUOTED(PDO_MYSQL_UNIX_ADDR, "$PHP_MYSQL_SOCK", [ ])  
+  else
+    AC_DEFINE_UNQUOTED(PDO_MYSQL_UNIX_ADDR, "$PDO_MYSQL_SOCKET", [ ])
+  fi
 
   PHP_ADD_LIBRARY_WITH_PATH(mysqlclient, $PDO_MYSQL_LIB_DIR, 
PDO_MYSQL_SHARED_LIBADD)
   PHP_ADD_INCLUDE($PDO_MYSQL_INC_DIR)
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/mysql_driver.c?r1=1.79&r2=1.80&diff_format=u
Index: php-src/ext/pdo_mysql/mysql_driver.c
diff -u php-src/ext/pdo_mysql/mysql_driver.c:1.79 
php-src/ext/pdo_mysql/mysql_driver.c:1.80
--- php-src/ext/pdo_mysql/mysql_driver.c:1.79   Mon Dec 31 07:12:13 2007
+++ php-src/ext/pdo_mysql/mysql_driver.c        Mon Jul 21 13:01:41 2008
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysql_driver.c,v 1.79 2007/12/31 07:12:13 sebastian Exp $ */
+/* $Id: mysql_driver.c,v 1.80 2008/07/21 13:01:41 andrey Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -417,13 +417,6 @@
        pdo_mysql_check_liveness
 };
 
-#ifndef PDO_MYSQL_UNIX_ADDR
-# ifdef PHP_WIN32
-#  define PDO_MYSQL_UNIX_ADDR  "MySQL"
-# else
-#  define PDO_MYSQL_UNIX_ADDR  "/tmp/mysql.sock"
-# endif
-#endif
 
 static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options 
TSRMLS_DC) /* {{{ */
 {
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/pdo_mysql.c?r1=1.18&r2=1.19&diff_format=u
Index: php-src/ext/pdo_mysql/pdo_mysql.c
diff -u php-src/ext/pdo_mysql/pdo_mysql.c:1.18 
php-src/ext/pdo_mysql/pdo_mysql.c:1.19
--- php-src/ext/pdo_mysql/pdo_mysql.c:1.18      Mon Dec 31 07:12:13 2007
+++ php-src/ext/pdo_mysql/pdo_mysql.c   Mon Jul 21 13:01:41 2008
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_mysql.c,v 1.18 2007/12/31 07:12:13 sebastian Exp $ */
+/* $Id: pdo_mysql.c,v 1.19 2008/07/21 13:01:41 andrey Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -101,7 +101,8 @@
 PHP_MINFO_FUNCTION(pdo_mysql)
 {
        php_info_print_table_start();
-       php_info_print_table_header(2, "PDO Driver for MySQL 3.x Client 
Libraries", "enabled");
+       php_info_print_table_header(2, "PDO Driver for MySQL, client library 
version", mysql_get_client_info());
+       php_info_print_table_row(2, "MYSQL_SOCKET", PDO_MYSQL_UNIX_ADDR);
        php_info_print_table_end();
 }
 /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/php_pdo_mysql_int.h?r1=1.22&r2=1.23&diff_format=u
Index: php-src/ext/pdo_mysql/php_pdo_mysql_int.h
diff -u php-src/ext/pdo_mysql/php_pdo_mysql_int.h:1.22 
php-src/ext/pdo_mysql/php_pdo_mysql_int.h:1.23
--- php-src/ext/pdo_mysql/php_pdo_mysql_int.h:1.22      Mon Dec 31 07:12:13 2007
+++ php-src/ext/pdo_mysql/php_pdo_mysql_int.h   Mon Jul 21 13:01:41 2008
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_pdo_mysql_int.h,v 1.22 2007/12/31 07:12:13 sebastian Exp $ */
+/* $Id: php_pdo_mysql_int.h,v 1.23 2008/07/21 13:01:41 andrey Exp $ */
 
 #ifndef PHP_PDO_MYSQL_INT_H
 #define PHP_PDO_MYSQL_INT_H
@@ -87,4 +87,13 @@
        PDO_MYSQL_ATTR_MAX_BUFFER_SIZE,
        PDO_MYSQL_ATTR_DIRECT_QUERY,
 };
+
+#ifndef PDO_MYSQL_UNIX_ADDR
+# ifdef PHP_WIN32
+#  define PDO_MYSQL_UNIX_ADDR  "MySQL"
+# else
+#  define PDO_MYSQL_UNIX_ADDR  "/tmp/mysql.sock"
+# endif
+#endif
+
 #endif

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

Reply via email to