Bug #74432 [Asn->Csd]: mysqli_connect adding ":3306" to $host if $port parameter not given
| From: | ab@php.net | Date: | Thu, 27 Apr 2017 10:39:10 +0000 |
| Subject: | Bug #74432 [Asn->Csd]: mysqli_connect adding ":3306" to $host if $port parameter not given | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208819@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74432&edit=1
ID: 74432
Updated by: ab@php.net
Reported by: php dot bugs at harry dot lu
Summary: mysqli_connect adding ":3306" to $host if $port
parameter not given
-Status: Assigned
+Status: Closed
Type: Bug
Package: MySQLi related
Operating System: Linux x86_64
PHP Version: 7.0.18
Assigned To: pollita
Block user comment: N
Private report: N
New Comment:
Patch for bug #74432 reverted, thereby this issue is fixed.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2017-04-27 10:39:07] ab@php.net
Patch for bug #74432 reverted, thereby this issue is fixed.
Thanks.
------------------------------------------------------------------------
[2017-04-20 17:08:05] pollita@php.net
dig dig dig...
So, this may only be happening to mysqli_connect() if mysqlnd is enabled (which is typical), though
in the mysqlnd enabled case it looks like you can't actually use an IPv6 address unless you
explicitly wrap it in square brackets.
This rabbit hole keeps getting deeper. :(
------------------------------------------------------------------------
[2017-04-20 15:32:27] pollita@php.net
Oh, and as to predis, that's a bug in predis appending ":$port" when $port
doesn't actually contain any value. Someone should send a pull request regarding these lines:
https://github.com/nrk/predis/blob/6ab10b2b705ea5121f2c1ea87a290f6871c32ebd/src/Connection/StreamConnection.php#L156-L160
------------------------------------------------------------------------
[2017-04-20 15:20:13] pollita@php.net
OMG. Why is every use of streams wrong?
Yeah, I'll clean mysqli_connect() up for the "port parameter not used" case.
------------------------------------------------------------------------
[2017-04-19 09:06:26] premavansmuuf at gmail dot com
I _think_ I am having somehow similar problem when using Predis, where I have port defined inside
$host variable instead of having it separately in $port.
Failed to parse address "localhost:6379:" [tcp://localhost:6379:]
Predis is using stream_socket_client() function.
It works in 5.6 but I think it stopped working in new PHP 7 version.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=74432
--
Edit this bug report at https://bugs.php.net/bug.php?id=74432&edit=1