From d8d99f37d2686e882d62fc4c453ed735cd0291c8 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 2 May 2022 13:32:43 +0200 Subject: [PATCH 1/3] Fix GH-8478: PHP 8.0 tests must be compatible /w MySQL 8.0 As of MySQL 8.0.28, the `utf8mb3` charset is deprecated, so we should avoid trying to use it. --- ext/mysqli/tests/mysqli_character_set.phpt | 2 +- ext/mysqli/tests/mysqli_options.phpt | 2 +- ext/mysqli/tests/mysqli_set_charset.phpt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/mysqli/tests/mysqli_character_set.phpt b/ext/mysqli/tests/mysqli_character_set.phpt index 65be8a0408afd..fc5d31ca16203 100644 --- a/ext/mysqli/tests/mysqli_character_set.phpt +++ b/ext/mysqli/tests/mysqli_character_set.phpt @@ -44,7 +44,7 @@ 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']) { + 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 ad129a41bbf6f..064b071698b3a 100644 --- a/ext/mysqli/tests/mysqli_options.phpt +++ b/ext/mysqli/tests/mysqli_options.phpt @@ -68,7 +68,7 @@ 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') { + 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 e9373a44dbdfe..29401d0f59469 100644 --- a/ext/mysqli/tests/mysqli_set_charset.phpt +++ b/ext/mysqli/tests/mysqli_set_charset.phpt @@ -85,7 +85,7 @@ 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']) + 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(); */ From dacd085e3bf8d3acf669374fae6e3c5c8db591ab Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 2 May 2022 14:20:00 +0200 Subject: [PATCH 2/3] Add comment --- ext/mysqli/tests/mysqli_character_set.phpt | 1 + ext/mysqli/tests/mysqli_options.phpt | 1 + ext/mysqli/tests/mysqli_set_charset.phpt | 1 + 3 files changed, 3 insertions(+) diff --git a/ext/mysqli/tests/mysqli_character_set.phpt b/ext/mysqli/tests/mysqli_character_set.phpt index fc5d31ca16203..767c1dd93a792 100644 --- a/ext/mysqli/tests/mysqli_character_set.phpt +++ b/ext/mysqli/tests/mysqli_character_set.phpt @@ -44,6 +44,7 @@ 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 */ + /* As of MySQL 8.0.28, utf8mb3 is deprecated, although still reported by `SHOW CHARACTER SET` */ 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 064b071698b3a..fb48a50bb66f5 100644 --- a/ext/mysqli/tests/mysqli_options.phpt +++ b/ext/mysqli/tests/mysqli_options.phpt @@ -68,6 +68,7 @@ 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 */ + /* As of MySQL 8.0.28, utf8mb3 is deprecated, although still reported by `SHOW CHARACTER SET` */ if ($charset['Charset'] == 'ucs2' || $charset['Charset'] == 'utf16' || $charset['Charset'] == 'utf32' || $charset['Charset'] == 'utf8mb3') { continue; } diff --git a/ext/mysqli/tests/mysqli_set_charset.phpt b/ext/mysqli/tests/mysqli_set_charset.phpt index 29401d0f59469..84e17c790ede3 100644 --- a/ext/mysqli/tests/mysqli_set_charset.phpt +++ b/ext/mysqli/tests/mysqli_set_charset.phpt @@ -85,6 +85,7 @@ 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)) { + /* As of MySQL 8.0.28, utf8mb3 is deprecated, although still reported by `SHOW CHARACTER SET` */ if ('ucs2' == $tmp['Charset'] || 'utf16' == $tmp['Charset'] || 'utf32' == $tmp['Charset'] || 'utf16le' == $tmp['Charset'] || 'utf8mb3' == $tmp['Charset']) continue; From 0b4a3dfa74ce252fe4ae667e07e46bc93e4ec236 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 6 May 2022 18:02:42 +0200 Subject: [PATCH 3/3] Fix comment --- ext/mysqli/tests/mysqli_character_set.phpt | 2 +- ext/mysqli/tests/mysqli_options.phpt | 2 +- ext/mysqli/tests/mysqli_set_charset.phpt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/mysqli/tests/mysqli_character_set.phpt b/ext/mysqli/tests/mysqli_character_set.phpt index 767c1dd93a792..7caf3cde9f3e2 100644 --- a/ext/mysqli/tests/mysqli_character_set.phpt +++ b/ext/mysqli/tests/mysqli_character_set.phpt @@ -44,7 +44,7 @@ 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 */ - /* As of MySQL 8.0.28, utf8mb3 is deprecated, although still reported by `SHOW CHARACTER SET` */ + /* 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 fb48a50bb66f5..2061cce1d2c50 100644 --- a/ext/mysqli/tests/mysqli_options.phpt +++ b/ext/mysqli/tests/mysqli_options.phpt @@ -68,7 +68,7 @@ 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 */ - /* As of MySQL 8.0.28, utf8mb3 is deprecated, although still reported by `SHOW CHARACTER SET` */ + /* 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; } diff --git a/ext/mysqli/tests/mysqli_set_charset.phpt b/ext/mysqli/tests/mysqli_set_charset.phpt index 84e17c790ede3..7d2bd076a4dba 100644 --- a/ext/mysqli/tests/mysqli_set_charset.phpt +++ b/ext/mysqli/tests/mysqli_set_charset.phpt @@ -85,7 +85,7 @@ 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)) { - /* As of MySQL 8.0.28, utf8mb3 is deprecated, although still reported by `SHOW CHARACTER SET` */ + /* 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;