Skip to content

fixes on mysqli, openssl, readline tests #18991

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fixes on mysqli, openssl, readline tests
  • Loading branch information
hyh19962008 committed Jul 1, 2025
commit ec0678ee6fdf54b07e65949e63000baabe65b2bc
4 changes: 2 additions & 2 deletions ext/mysqli/tests/bug77956.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ if (!$link->query('DROP TABLE IF EXISTS test')) {
$link->close();
unlink('bug77956.data');
?>
--EXPECT--
[006] [2000] LOAD DATA LOCAL INFILE is forbidden, check related settings like mysqli.allow_local_infile|mysqli.local_infile_directory or PDO::MYSQL_ATTR_LOCAL_INFILE|PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY
Copy link
Member

Choose a reason for hiding this comment

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

The number was a part of the test. Removing it doesn't seem wise. Also, if you think the error number is not important then you should adjust the test case rather than using EXPECTF.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a quick fix, since the error message is exactly the same. But I can't found a environment to reproduce the 2000 error number. I tested on MySQL 5.7 and 8.0, both of them return 2068. Do you know which setup can reproduce the 2000 number? If we can identify these different setup, then yes, we can create a new test case.

Copy link
Member

Choose a reason for hiding this comment

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

Which CI is failing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I setup the test environment and ran the tests on my own machine.

Copy link
Member

Choose a reason for hiding this comment

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

Then I would say just leave it as it is now. Maybe it's something only on your local machine. No point in degrading the test if it doesn't cause issues with CI

--EXPECTF--
[006] [%d] LOAD DATA LOCAL INFILE is forbidden, check related settings like mysqli.allow_local_infile|mysqli.local_infile_directory or PDO::MYSQL_ATTR_LOCAL_INFILE|PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY
done
4 changes: 2 additions & 2 deletions ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ mysqli
if (!$link = @mysqli_connect($host, $user, $passwd, $db, $port, $socket))
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));

if (!$res = mysqli_query($link, "SHOW CHARACTER SET LIKE 'UTF8'"))
if (!$res = mysqli_query($link, "SHOW CHARACTER SET LIKE '%UTF8%'"))
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if that's an improvement. Why can it not stay the way it is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because "LIKE 'UTF8'" will not match 'utf8mb3'.

Copy link
Member

Choose a reason for hiding this comment

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

But it will skip the test if UTF8 is not available. I don't see a problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is available, just changed a name on MySQL 8, from 'utf8' to 'utf8mb3'. I have run this test on this environment and passed, It shouldn't be skipped.

die("skip Cannot run SHOW CHARACTER SET to check charsets");

if (!$tmp = mysqli_fetch_assoc($res))
die("skip Looks like UTF8 is not available on the server");

if (strtolower($tmp['Charset']) !== 'utf8')
if (strtolower($tmp['Charset']) !== 'utf8' && strtolower($tmp['Charset']) !== 'utf8mb3')
die("skip Not sure if UTF8 is available, canceling the test");

mysqli_free_result($res);
Expand Down
3 changes: 2 additions & 1 deletion ext/openssl/tests/bug70438.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Request #70438: Add IV parameter for openssl_seal and openssl_open
openssl
--SKIPIF--
<?php
if (!in_array('AES-128-CBC', openssl_get_cipher_methods(true))) {
if (!in_array('AES-128-CBC', openssl_get_cipher_methods(true)) &&
!in_array('aes-128-cbc', openssl_get_cipher_methods(true))) {
print "skip";
}
?>
Expand Down
3 changes: 2 additions & 1 deletion ext/openssl/tests/bug74402.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Bug #74402 (segfault on random_bytes, bin3hex, openssl_seal)
openssl
--SKIPIF--
<?php
if (!in_array('AES256', openssl_get_cipher_methods(true))) print "skip";
if (!in_array('AES256', openssl_get_cipher_methods(true)) &&
!in_array('aes256', openssl_get_cipher_methods(true))) print "skip";
?>
--FILE--
<?php
Expand Down
2 changes: 1 addition & 1 deletion ext/readline/tests/readline_read_history_error_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Pedro Manoel Evangelista <pedro.evangelista at gmail dot com>
--EXTENSIONS--
readline
--SKIPIF--
<?php if (!READLINE_LIB != "libedit") die('skip READLINE_LIB != "libedit"'); ?>
<?php if (READLINE_LIB != "libedit") die('skip READLINE_LIB != "libedit"'); ?>
--FILE--
<?php
var_dump(readline_read_history('nofile'));
Expand Down