Bug #74432 [Csd]: mysqli_connect adding ":3306" to $host if $port parameter not given
| From: | ab@php.net | Date: | Thu, 27 Apr 2017 10:41:23 +0000 |
| Subject: | Bug #74432 [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-208820@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: 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:
Oops, wrong bug number, bug #74216.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2017-04-27 10:39:10] ab@php.net
Related To: Bug #74432
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
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