1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-16 20:28:28 +01:00

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
This commit is contained in:
Nick Liu 2022-11-30 17:57:48 -06:00
parent 83d29f3114
commit ae3c57a5b4
No known key found for this signature in database
GPG Key ID: 1167C5F9C9897637

View File

@ -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);