From a7a590211ef70116ab922a8398f4c296ddd8f6ab Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 6 May 2022 18:02:42 +0200 Subject: [PATCH] Fix mysqli tests wrt. MySQL 8.0.28 As of MySQL 8.0.28, `utf8mb3` charset is reported by the server, but mysqlnd doesn't support it yet. As a stop-gap measure, we ignore that charset for now. Closes GH-8480. --- ext/mysqli/tests/mysqli_character_set.phpt | 3 ++- ext/mysqli/tests/mysqli_options.phpt | 3 ++- ext/mysqli/tests/mysqli_set_charset.phpt | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ext/mysqli/tests/mysqli_character_set.phpt b/ext/mysqli/tests/mysqli_character_set.phpt index 65be8a0408a..7caf3cde9f3 100644 --- a/ext/mysqli/tests/mysqli_character_set.phpt +++ b/ext/mysqli/tests/mysqli_character_set.phpt @@ -44,7 +44,8 @@ if (!function_exists('mysqli_set_charset')) { /* The server currently 17.07.2007 can't handle data sent in ucs2 */ /* The server currently 16.08.2010 can't handle data sent in utf16 and utf32 */ /* The server currently 02.09.2011 can't handle data sent in utf16le */ - if ($charset['Charset'] == 'ucs2' || $charset['Charset'] == 'utf16' || $charset['Charset'] == 'utf32' || 'utf16le' == $charset['Charset']) { + /* As of MySQL 8.0.28, `SHOW CHARACTER SET` contains utf8mb3, but that is not yet supported by mysqlnd */ + if ($charset['Charset'] == 'ucs2' || $charset['Charset'] == 'utf16' || $charset['Charset'] == 'utf32' || 'utf16le' == $charset['Charset'] || 'utf8mb3' == $charset['Charset']) { continue; } diff --git a/ext/mysqli/tests/mysqli_options.phpt b/ext/mysqli/tests/mysqli_options.phpt index ad129a41bbf..2061cce1d2c 100644 --- a/ext/mysqli/tests/mysqli_options.phpt +++ b/ext/mysqli/tests/mysqli_options.phpt @@ -68,7 +68,8 @@ require_once('skipifconnectfailure.inc'); $k = $charset['Charset']; /* The server currently 17.07.2007 can't handle data sent in ucs2 */ /* The server currently 16.08.2010 can't handle data sent in utf16 and utf32 */ - if ($charset['Charset'] == 'ucs2' || $charset['Charset'] == 'utf16' || $charset['Charset'] == 'utf32') { + /* As of MySQL 8.0.28, `SHOW CHARACTER SET` contains utf8mb3, but that is not yet supported by mysqlnd */ + if ($charset['Charset'] == 'ucs2' || $charset['Charset'] == 'utf16' || $charset['Charset'] == 'utf32' || $charset['Charset'] == 'utf8mb3') { continue; } if (true !== mysqli_options($link, MYSQLI_SET_CHARSET_NAME, $charset['Charset'])) { diff --git a/ext/mysqli/tests/mysqli_set_charset.phpt b/ext/mysqli/tests/mysqli_set_charset.phpt index e9373a44dbd..7d2bd076a4d 100644 --- a/ext/mysqli/tests/mysqli_set_charset.phpt +++ b/ext/mysqli/tests/mysqli_set_charset.phpt @@ -85,7 +85,8 @@ if ((($res = mysqli_query($link, 'SHOW CHARACTER SET LIKE "latin1"', MYSQLI_STOR printf("[016] Cannot get list of character sets\n"); while ($tmp = mysqli_fetch_assoc($res)) { - if ('ucs2' == $tmp['Charset'] || 'utf16' == $tmp['Charset'] || 'utf32' == $tmp['Charset'] || 'utf16le' == $tmp['Charset']) + /* As of MySQL 8.0.28, `SHOW CHARACTER SET` contains utf8mb3, but that is not yet supported by mysqlnd */ + if ('ucs2' == $tmp['Charset'] || 'utf16' == $tmp['Charset'] || 'utf32' == $tmp['Charset'] || 'utf16le' == $tmp['Charset'] || 'utf8mb3' == $tmp['Charset']) continue; /* Uncomment to see where it hangs - var_dump($tmp); flush(); */