----- Original Message ----- 
From: "George Schlossnagle" <[EMAIL PROTECTED]>
> > very quickly. On the other hand I think the focus of people on this 
> > list right now is a bit different from what you're trying to do: Fix 
> > bugs in PHP 4 and get PHP 5 out of the door.

On that note, I'd like to submit a couple patches for review.

I'm tempted to also ask for a CVS account, as I occasionally find/fix bugs in the 
course of working on a new SAPI I'm developing.  Additionally, a later version of my 
SAPI would benefit from zend_llist's with additional support for sorted lists (e.g. 
insert into sorted list, find from a sorted list, etc.), which I plan to add as a 
private patch, unless adopted by the PHP team =).   Pragmatically, my project does not 
depend on adoption, so I might find it simpler to just submit the patches to this list 
and let the winds carry them ..

Problem
=============
MYSQL_UNIX_ADDR is defined in both php_config.h and MySQL's external mysql_version.h.  
If --with-mysql-sock is used with PHP's configure script to specify a location 
different than the location used when compiling MySQL, then these defines are 
inconsistent.

The mysql and mysqli extensions do not default to the socket specified with 
--with-mysql-sock when mysql.default_path is not defined in the phpini file.  Instead, 
the mysql extension defaults to using whatever was compiled into the MySQL library.  
Patches are attached for the mysql extension of php-4.3.7, and both the mysql and 
mysqli extensions in php-5.0.0RC3.

What is accomplished by the patches?
============================
- fixes the compilation warning: "MYSQL_UNIX_ADDR" redefined
- renamed PHP's conflicting use of 'MYSQL_UNIX_ADDR' to 'PHP_MYSQL_UNIX_ADDR'
- corrected the initialization of the global default_socket in mysql/mysqi extension 
to properly support the default supplied via --with-mysql-sock
- provided backwardly-compatible default in the event that neither --with-mysql-sock 
is used when compiling, nor a value is supplied for mysql.default_socket in the phpini 
file.
- selects default socket in the following priority:
a) uses the value supplied to --with-mysql-sock=
b) first socket found in the sequence of paths below:
   /var/run/mysqld/mysqld.sock \
    /var/tmp/mysql.sock \
    /var/run/mysql/mysql.sock \
    /var/lib/mysql/mysql.sock \
    /var/mysql/mysql.sock \
    /usr/local/mysql/var/mysql.sock \
    /Private/tmp/mysql.sock \
    /private/tmp/mysql.sock \
    /tmp/mysql.sock \
c) the default provided when MySQL was compiled (from mysql_version.h)

Cheers,
Gavin,
[EMAIL PROTECTED]
(do not use my trap address above)
-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to