Skip to content

Commit a7a5902

Browse files
committed
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.
1 parent 95f5f9d commit a7a5902

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

ext/mysqli/tests/mysqli_character_set.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ if (!function_exists('mysqli_set_charset')) {
4444
/* The server currently 17.07.2007 can't handle data sent in ucs2 */
4545
/* The server currently 16.08.2010 can't handle data sent in utf16 and utf32 */
4646
/* The server currently 02.09.2011 can't handle data sent in utf16le */
47-
if ($charset['Charset'] == 'ucs2' || $charset['Charset'] == 'utf16' || $charset['Charset'] == 'utf32' || 'utf16le' == $charset['Charset']) {
47+
/* As of MySQL 8.0.28, `SHOW CHARACTER SET` contains utf8mb3, but that is not yet supported by mysqlnd */
48+
if ($charset['Charset'] == 'ucs2' || $charset['Charset'] == 'utf16' || $charset['Charset'] == 'utf32' || 'utf16le' == $charset['Charset'] || 'utf8mb3' == $charset['Charset']) {
4849
continue;
4950
}
5051

ext/mysqli/tests/mysqli_options.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ require_once('skipifconnectfailure.inc');
6868
$k = $charset['Charset'];
6969
/* The server currently 17.07.2007 can't handle data sent in ucs2 */
7070
/* The server currently 16.08.2010 can't handle data sent in utf16 and utf32 */
71-
if ($charset['Charset'] == 'ucs2' || $charset['Charset'] == 'utf16' || $charset['Charset'] == 'utf32') {
71+
/* As of MySQL 8.0.28, `SHOW CHARACTER SET` contains utf8mb3, but that is not yet supported by mysqlnd */
72+
if ($charset['Charset'] == 'ucs2' || $charset['Charset'] == 'utf16' || $charset['Charset'] == 'utf32' || $charset['Charset'] == 'utf8mb3') {
7273
continue;
7374
}
7475
if (true !== mysqli_options($link, MYSQLI_SET_CHARSET_NAME, $charset['Charset'])) {

ext/mysqli/tests/mysqli_set_charset.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ if ((($res = mysqli_query($link, 'SHOW CHARACTER SET LIKE "latin1"', MYSQLI_STOR
8585
printf("[016] Cannot get list of character sets\n");
8686

8787
while ($tmp = mysqli_fetch_assoc($res)) {
88-
if ('ucs2' == $tmp['Charset'] || 'utf16' == $tmp['Charset'] || 'utf32' == $tmp['Charset'] || 'utf16le' == $tmp['Charset'])
88+
/* As of MySQL 8.0.28, `SHOW CHARACTER SET` contains utf8mb3, but that is not yet supported by mysqlnd */
89+
if ('ucs2' == $tmp['Charset'] || 'utf16' == $tmp['Charset'] || 'utf32' == $tmp['Charset'] || 'utf16le' == $tmp['Charset'] || 'utf8mb3' == $tmp['Charset'])
8990
continue;
9091

9192
/* Uncomment to see where it hangs - var_dump($tmp); flush(); */

0 commit comments

Comments
 (0)