diff options
author | Johannes Schlüter <johannes@php.net> | 2011-11-02 15:45:53 +0000 |
---|---|---|
committer | Johannes Schlüter <johannes@php.net> | 2011-11-02 15:45:53 +0000 |
commit | 6781f175753f04e73ec9849cd2d911cf35c85e1e (patch) | |
tree | 3610dd31f5b4a6937d707a4605750c073400643e | |
parent | e3269e029e15127835aeac989b3d528372fd66f9 (diff) | |
download | php-git-6781f175753f04e73ec9849cd2d911cf35c85e1e.tar.gz |
- Fix bug #60155 (pdo_mysql.default_socket ignored).
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | ext/pdo_mysql/mysql_driver.c | 11 | ||||
-rwxr-xr-x | ext/pdo_mysql/pdo_mysql.c | 22 |
3 files changed, 22 insertions, 12 deletions
@@ -70,6 +70,7 @@ PHP NEWS . Fixed bug #55776 (PDORow to session bug). (Johannes) - PDO MySQL driver: + . Fixed bug #60155 (pdo_mysql.default_socket ignored). (Johannes) . Fixed bug #55870 (PDO ignores all SSL parameters when used with mysql native driver) (Pierre) . Fixed bug #54158 (MYSQLND+PDO MySQL requires #define diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 1cb6674e64..6ec60cd06b 100755 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -553,12 +553,11 @@ static struct pdo_dbh_methods mysql_methods = { pdo_mysql_check_liveness }; /* }}} */ -#ifdef PDO_USE_MYSQLND -# ifdef PHP_WIN32 -# define MYSQL_UNIX_ADDR "MySQL" -# else -# define MYSQL_UNIX_ADDR PDO_MYSQL_G(default_socket) -# endif + +#ifdef PHP_WIN32 +# define MYSQL_UNIX_ADDR NULL +#else +# define MYSQL_UNIX_ADDR PDO_MYSQL_G(default_socket) #endif /* {{{ pdo_mysql_handle_factory */ diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c index 97cce4a1de..b5c21fb048 100755 --- a/ext/pdo_mysql/pdo_mysql.c +++ b/ext/pdo_mysql/pdo_mysql.c @@ -37,12 +37,22 @@ ZEND_GET_MODULE(pdo_mysql) ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql); -#ifndef PHP_WIN32 -# ifndef PDO_MYSQL_UNIX_ADDR -# ifdef PHP_MYSQL_UNIX_SOCK_ADDR -# define PDO_MYSQL_UNIX_ADDR PHP_MYSQL_UNIX_SOCK_ADDR -# else +/* + The default socket location is sometimes defined by configure. + With libmysql `mysql_config --socket` will fill PDO_MYSQL_UNIX_ADDR + and the user can use --with-mysql-sock=SOCKET which will fill + PDO_MYSQL_UNIX_ADDR. If both aren't set we're using mysqlnd and use + /tmp/mysql.sock as default on *nix and NULL for Windows (default + named pipe name is set in mysqlnd). +*/ +#ifndef PDO_MYSQL_UNIX_ADDR +# ifdef PHP_MYSQL_UNIX_SOCK_ADDR +# define PDO_MYSQL_UNIX_ADDR PHP_MYSQL_UNIX_SOCK_ADDR +# else +# if !PHP_WIN32 # define PDO_MYSQL_UNIX_ADDR "/tmp/mysql.sock" +# else +# define PDO_MYSQL_UNIX_ADDR NULL # endif # endif #endif @@ -112,7 +122,7 @@ static PHP_MINFO_FUNCTION(pdo_mysql) php_info_print_table_end(); -#ifdef PDO_USE_MYSQLND +#ifndef PHP_WIN32 DISPLAY_INI_ENTRIES(); #endif } |