From ae3c57a5b4402cf813f461eb767f51afb48e5d5f Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Wed, 30 Nov 2022 17:57:48 -0600 Subject: [PATCH] Tests: MDEV-29446 workaround: Ignore COLLATE clause in SHOW CREATE TABLE https://jira.mariadb.org/browse/MDEV-29446 changes the output of `SHOW CREATE TABLE`, which MySQL and MariaDB 10.2 and older do not do. To tolerate the new behavior, this change strips the `COLLATE` clause from the `SHOW CREATE TABLE` output to ignore it. Fixes: https://github.com/e107inc/e107/issues/4912 --- e107_tests/tests/unit/db_table_adminTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/e107_tests/tests/unit/db_table_adminTest.php b/e107_tests/tests/unit/db_table_adminTest.php index 387c0e5ca..a529edffc 100644 --- a/e107_tests/tests/unit/db_table_adminTest.php +++ b/e107_tests/tests/unit/db_table_adminTest.php @@ -346,10 +346,14 @@ $result = $this->dta->get_current_table('core'); - // MySQL 8.0+: Alias CHARSET=utf8mb3 to CHARSET=utf8 array_walk_recursive($result, function(&$element) { + // MySQL 8.0+ + // Alias CHARSET=utf8mb3 to CHARSET=utf8 $element = str_replace("CHARSET=utf8mb3", "CHARSET=utf8", $element); + // MariaDB 10.3.37, 10.4.27, 10.5.18, 10.6.11, 10.7.7, 10.8.6, 10.9.4, 10.10.2, 10.11.0 + // Ignore COLLATE clause (https://jira.mariadb.org/browse/MDEV-29446) + $element = preg_replace("/ COLLATE=[^\s;]+/", "", $element); }); $this->assertSame($expected, $result);