Skip to content

Attempt to update CI to MySQL 8.4 #17582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
services:
mysql:
image: mysql:8.3
image: mysql:8.4
ports:
- 3306:3306
env:
Expand Down Expand Up @@ -115,6 +115,9 @@ jobs:
--${{ matrix.zts && 'enable' || 'disable' }}-zts
${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function" CC=clang CXX=clang++' || '' }}
skipSlow: ${{ matrix.asan }}
- name: MySQL
run: |
sudo mysql -h127.0.0.1 -P3306 -proot -e "SELECT user, host, plugin from mysql.user;"
- name: make
run: make -j$(/usr/bin/nproc) >/dev/null
- name: make install
Expand Down Expand Up @@ -193,7 +196,7 @@ jobs:
-d zend_extension=opcache.so
-d opcache.enable_cli=1
MACOS_DEBUG_NTS:
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
if: false
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -234,7 +237,7 @@ jobs:
- name: Verify generated files are up to date
uses: ./.github/actions/verify-generated-files
WINDOWS:
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
if: false
name: WINDOWS_X64_ZTS
runs-on: windows-2022
timeout-minutes: 50
Expand Down Expand Up @@ -262,7 +265,7 @@ jobs:
run: .github/scripts/windows/test.bat
BENCHMARKING:
name: BENCHMARKING
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
if: false
runs-on: ubuntu-24.04
timeout-minutes: 50
steps:
Expand Down Expand Up @@ -369,6 +372,7 @@ jobs:
retention-days: 30
FREEBSD:
name: FREEBSD
if: false
runs-on: ubuntu-latest
steps:
- name: git checkout
Expand Down
3 changes: 1 addition & 2 deletions ext/mysqli/tests/mysqli_connect.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ require_once 'skipifconnectfailure.inc';

mysqli_close($link);

if ($link = mysqli_connect($host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket))
if ($link = @mysqli_connect($host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket))
printf("[009] Can connect to the server using host=%s, user=%s, passwd=***non_empty, dbname=%s, port=%s, socket=%s\n",
$host, $user . 'unknown_really', $db, $port, $socket);

Expand Down Expand Up @@ -141,7 +141,6 @@ require_once 'skipifconnectfailure.inc';
print "done!";
?>
--EXPECTF--
Warning: mysqli_connect(): (%s/%d): Access denied for user '%s'@'%s'%r( \(using password: \w+\)){0,1}%r in %s on line %d
array(1) {
["testing"]=>
string(21) "mysqli.default_socket"
Expand Down
10 changes: 3 additions & 7 deletions ext/mysqli/tests/mysqli_connect_oo.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require_once 'skipifconnectfailure.inc';
<?php
require_once 'connect.inc';

if ($mysqli = new mysqli($host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket) && !mysqli_connect_errno())
if ($mysqli = @new mysqli($host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket) && !mysqli_connect_errno())
Copy link
Member

Choose a reason for hiding this comment

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

Can this at least not be in the condition? It's a bit confusing what we are actually checking here.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is basically the same test as in mysqli_connect.phpt above; we try to connect as unknown user, which should not succeed. If it does, an error message is printed.

I don't understand what you are suggesting, though. Can you please clarify?

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if ($mysqli = @new mysqli($host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket) && !mysqli_connect_errno())
$mysqli = @new mysqli($host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket);
if (!mysqli_connect_errno())

printf("[003] Can connect to the server using host=%s, user=%s, passwd=***non_empty, dbname=%s, port=%s, socket=%s\n",
$host, $user . 'unknown_really', $db, $port, $socket);

Expand Down Expand Up @@ -83,13 +83,11 @@ require_once 'skipifconnectfailure.inc';
mysqli_report(MYSQLI_REPORT_STRICT);

try {
$mysqli = new mysqli($host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket);
$mysqli = @new mysqli($host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket);
printf("[016] Can connect to the server using host=%s, user=%s, passwd=***non_empty, dbname=%s, port=%s, socket=%s\n",
$host, $user . 'unknown_really', $db, $port, $socket);
$mysqli->close();
} catch (mysqli_sql_exception $e) {
printf("%s\n", $e->getMessage());
}
} catch (mysqli_sql_exception $e) {}

ini_set('mysqli.default_socket', $socket);
try {
Expand Down Expand Up @@ -143,9 +141,7 @@ require_once 'skipifconnectfailure.inc';
print "done!";
?>
--EXPECTF--
Warning: mysqli::__construct(): (%s/%d): Access denied for user '%sunknown%s'@'%s' %r(\(using password: \w+\) ){0,1}%rin %s on line %d
mysqli object is not fully initialized
mysqli object is not fully initialized
... and now Exceptions
Access denied for user '%s'@'%s'%r( \(using password: \w+\)){0,1}%r
done!
3 changes: 1 addition & 2 deletions ext/mysqli/tests/mysqli_real_connect.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mysqli.allow_local_infile=1
if (!$link = mysqli_init())
printf("[004] mysqli_init() failed\n");

if (false !== ($tmp = mysqli_real_connect($link, $host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket)))
if (false !== ($tmp = @mysqli_real_connect($link, $host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket)))
printf("[005] Expecting boolean/false got %s/%s. Can connect to the server using host=%s, user=%s, passwd=***non_empty, dbname=%s, port=%s, socket=%s\n", gettype($tmp), $tmp, $host, $user . 'unknown_really', $db, $port, $socket);

// Run the following tests without an anoynmous MySQL user and use a password for the test user!
Expand Down Expand Up @@ -147,7 +147,6 @@ mysqli.allow_local_infile=1
print "done!";
?>
--EXPECTF--
Warning: mysqli_real_connect(): (%s/%d): Access denied for user '%s'@'%s' %r(\(using password: \w+\) ){0,1}%rin %s on line %d
object(mysqli)#%d (%d) {
["client_info"]=>
string(%d) "%s"
Expand Down
3 changes: 1 addition & 2 deletions ext/mysqli/tests/mysqli_real_connect_pconn.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mysqli.max_persistent=10
if (!$link = mysqli_init())
printf("[004] mysqli_init() failed\n");

if (false !== ($tmp = mysqli_real_connect($link, $host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket)))
if (false !== ($tmp = @mysqli_real_connect($link, $host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket)))
printf("[005] Expecting boolean/false got %s/%s. Can connect to the server using host=%s, user=%s, passwd=***non_empty, dbname=%s, port=%s, socket=%s\n", gettype($tmp), $tmp, $host, $user . 'unknown_really', $db, $port, $socket);

// Run the following tests without an anoynmous MySQL user and use a password for the test user!
Expand Down Expand Up @@ -147,5 +147,4 @@ mysqli.max_persistent=10
require_once 'clean_table.inc';
?>
--EXPECTF--
Warning: mysqli_real_connect(): (%s/%d): Access denied for user '%s'@'%s' %r(\(using password: \w+\) ){0,1}%rin %s on line %d
done!
14 changes: 4 additions & 10 deletions ext/mysqli/tests/mysqli_report.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -168,26 +168,22 @@ require_once 'skipifconnectfailure.inc';

try {

if ($link = my_mysqli_connect($host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket))
if ($link = @my_mysqli_connect($host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket))
printf("[012] Can connect to the server using host=%s, user=%s, passwd=***non_empty, dbname=%s, port=%s, socket=%s\n",
$host, $user . 'unknown_really', $db, $port, $socket);
mysqli_close($link);

} catch (mysqli_sql_exception $e) {
printf("[013] %s\n", $e->getMessage());
}
} catch (mysqli_sql_exception $e) {}

try {
if (!$link = mysqli_init())
printf("[014] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());

if ($link = my_mysqli_real_connect($link, $host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket))
if ($link = @my_mysqli_real_connect($link, $host, $user . 'unknown_really', $passwd . 'non_empty', $db, $port, $socket))
printf("[015] Can connect to the server using host=%s, user=%s, passwd=***non_empty, dbname=%s, port=%s, socket=%s\n",
$host, $user . 'unknown_really', $db, $port, $socket);
mysqli_close($link);
} catch (mysqli_sql_exception $e) {
printf("[016] %s\n", $e->getMessage());
}
} catch (mysqli_sql_exception $e) {}

/*
MYSQLI_REPORT_INDEX --->
Expand Down Expand Up @@ -334,6 +330,4 @@ Deprecated: Function mysqli_kill() is deprecated since 8.4, use KILL CONNECTION/
Deprecated: Function mysqli_kill() is deprecated since 8.4, use KILL CONNECTION/QUERY SQL statement instead in %s

Deprecated: Function mysqli_kill() is deprecated since 8.4, use KILL CONNECTION/QUERY SQL statement instead in %s
[013] Access denied for user '%s'@'%s'%r( \(using password: \w+\)){0,1}%r
[016] Access denied for user '%s'@'%s'%r( \(using password: \w+\)){0,1}%r
done!
Loading