#50231 [Opn->Csd]: Socket path passed using --with-mysql-sock is ignored when mysqlnd is enabled

From: Date: Mon, 30 Nov 2009 15:13:42 +0000
Subject: #50231 [Opn->Csd]: Socket path passed using --with-mysql-sock is ignored when mysqlnd is enabled
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-145225@lists.php.net to get a copy of this message
 ID:               50231
 Updated by:       jani@php.net
 Reported By:      foutrelis at gmail dot com
-Status:           Open
+Status:           Closed
 Bug Type:         MySQL related
 Operating System: Arch Linux
 PHP Version:      5.3.1
 New Comment:

Fixed both ext/pdo_mysql and ext/mysql, hopefully it works now. :)


Previous Comments:
------------------------------------------------------------------------

[2009-11-30 15:11:30] svn@php.net

Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=291501
Log: - Fixed bug #50231 (Socket path passed using --with-mysql-sock is
ignored when mysqlnd is enabled)

------------------------------------------------------------------------

[2009-11-19 22:15:26] foutrelis at gmail dot com

The pdo_mysql extension is affected as well. When mysqlnd is enabled,
PDO_MYSQL_UNIX_ADDR doesn't get defined and it uses /tmp/mysql.sock
instead of the path retrieved using `mysql_config --socket'.

In this case, the code in ext/pdo_mysql/config.m4 is a bit more
involved, so I won't attempt to come up with a patch. :>

------------------------------------------------------------------------

[2009-11-19 15:45:26] foutrelis at gmail dot com

Tried with the snapshot; same problem.

 [foutrelis@foutboxd php]$ php -r 'mysql_connect();'
 PHP Warning:  mysql_connect(): [2002] No such file or directory
(trying to connect via unix:///tmp/mysql.sock) in Command line code on
line 1
 PHP Warning:  mysql_connect(): No such file or directory in Command
line code on line 1


`php -i' output: http://omploader.org/vMnQxNQ/phpinfo.txt

------------------------------------------------------------------------

[2009-11-19 14:55:14] foutrelis at gmail dot com

Description:
------------
Looking at ext/mysql/config.m4, it seems to me that the path specified
during the ./configure step using the --with-mysql-sock option gets
ignored and PHP_MYSQL_UNIX_SOCK_ADDR isn't defined accordingly. This
causes mysqlnd to always use its default socket path (/tmp/mysql.sock).

I wrote a patch [1] to move the related code in its own if clause so
that it gets executed regardless of whether mysqlnd or libmysqlclient is
used. However, I was unable to test it because I'm not sure how to
regenerate the configure script (I tried with autoreconf but the
produced configure script freaked out; something about confdefs.h
missing).

Let me know if you need any more information from me.

----
[1] http://bugs.archlinux.org/task/17179?getfile=4423



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50231&edit=1



Thread (6 messages)

« previous php.bugs (#145225) next »