php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #60748
Patch mysqlnd-sock.patch revision 2012-01-13 17:27 UTC by fedora at famillecollet dot com
revision 2012-01-13 16:56 UTC by fedora at famillecollet dot com

Patch mysqlnd-sock.patch for MySQL related Bug #60748

Patch version 2012-01-13 16:56 UTC

Return to Bug #60748 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: fedora@famillecollet.com

diff -up php-5.4.0RC5/ext/mysqlnd/mysqlnd.c.sock php-5.4.0RC5/ext/mysqlnd/mysqlnd.c
--- php-5.4.0RC5/ext/mysqlnd/mysqlnd.c.sock	2012-01-01 14:15:04.000000000 +0100
+++ php-5.4.0RC5/ext/mysqlnd/mysqlnd.c	2012-01-13 17:27:58.808947693 +0100
@@ -695,7 +695,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, connec
 		if (host_len == sizeof("localhost") - 1 && !strncasecmp(host, "localhost", host_len)) {
 			DBG_INF_FMT("socket=%s", socket_or_pipe? socket_or_pipe:"n/a");
 			if (!socket_or_pipe) {
-				socket_or_pipe = "/tmp/mysql.sock";
+#ifdef PHP_MYSQL_UNIX_SOCK_ADDR
+				socket_or_pipe = PHP_MYSQL_UNIX_SOCK_ADDR;
+#else
+				socket_or_pipe = "/var/lib/mysql/mysql.sock";
+#endif
 			}
 			transport_len = mnd_sprintf(&transport, 0, "unix://%s", socket_or_pipe);
 			unix_socket = TRUE;
diff -up ext/pdo_mysql/pdo_mysql.c.sock ext/pdo_mysql/pdo_mysql.c
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 07:01:28 2024 UTC