From:             oliver at realtsp dot com
Operating system: FreeBSD 5.3-RELEASE
PHP version:      5.0.2
PHP Bug Type:     MySQLi related
Bug description:  mysqli_connect() does not accept socket=false

Description:
------------
mysqli_connect() no longer accepts false/null for the socket parameter. It
interprets it as an empty string and as a result fails to find the socket
and therefore connect.

Previous versions used to ignore false/null and just use the hostname etc
to connect.

The reason I am not just changing the call to

$db = mysqli_connect($host, $username, $password, $database);

is because this code is from PEAR::DB and this change would be quite
major. See my bug: 
http://pear.php.net/bugs/bug.php?id=2960

as danielc points out: "most PHP functions gladly
accept false/null for optional string arguments without causing problems"



Reproduce code:
---------------
<?php

$db = mysqli_connect($host, $username, $password, $database, null, null);

?>
same result with 

<?php

$db = mysqli_connect($host, $username, $password, $database, false,
false);

?>


Expected result:
----------------
a valid connection

Actual result:
--------------
following error:
Can't connect to local MySQL server through socket '' (2)

-- 
Edit bug report at http://bugs.php.net/?id=31094&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31094&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31094&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31094&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31094&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31094&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31094&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31094&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31094&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31094&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31094&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31094&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31094&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31094&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31094&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31094&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31094&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31094&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31094&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31094&r=mysqlcfg

Reply via email to