Skip to content

Conversation

@remicollet
Copy link
Member

… enclosed in square brackets

Notice: this is a minimal fix for the regression GH-20528
So GH-8978 is only partially fixed (missing IPv6 address enclosed in square brackets, ex [::1]:3306)

@remicollet remicollet requested review from ndossche and removed request for SakiTakamachi, bukka and kamil-tekiela November 20, 2025 02:01
remicollet referenced this pull request Nov 20, 2025
If there are 2 ports, only the first is used.
However, then the certificate checking fails. So we drop the second port
if there is one.

Closes GH-20021.
@remicollet remicollet changed the base branch from master to PHP-8.3 November 20, 2025 02:08
@remicollet
Copy link
Member Author

Second commit handles IPv6 address enclosed in square brackets

@remicollet
Copy link
Member Author

remicollet commented Nov 20, 2025

Tested locally with

$ export MYSQL_TEST_HOST=127.0.1
$ make test TESTS="--show-diff ext/mysqli/tests/mysqli_connect_port.phpt"

$ export MYSQL_TEST_HOST=[::1]
$ make test TESTS="--show-diff ext/mysqli/tests/mysqli_connect_port.phpt"

$ export MYSQL_TEST_HOST=name
$ make test TESTS="--show-diff ext/mysqli/tests/mysqli_connect_port.phpt"

Copy link
Member

@ndossche ndossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for handling this. I believe the logic is right. I did some tests and it gives me the expected results.

@remicollet
Copy link
Member Author

Merged in PHP-8.3 as 9d71c1e and 769f319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants