diff --git a/integration_db_test.go b/integration_db_test.go index 3e82e9a..12c1587 100644 --- a/integration_db_test.go +++ b/integration_db_test.go @@ -143,9 +143,11 @@ func TestIntegrationMigrations(t *testing.T) { if err != nil || version != 2 { t.Fatal(version, err) } + // MariaDB can report a charset-prefixed collation alias in TABLES + // even when its COLLATIONS view only lists the unprefixed name. for _, table := range []string{"coredns_webui_schema", "coredns_webui_users", "coredns_webui_sessions", "coredns_webui_zone_delegations", "coredns_webui_audit"} { - if d.count(t, "SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = ? AND TABLE_COLLATION IN (SELECT COLLATION_NAME FROM information_schema.COLLATIONS WHERE CHARACTER_SET_NAME = 'utf8mb4') AND ENGINE = 'InnoDB'", table) != 1 { - t.Fatalf("%s missing", table) + if d.count(t, "SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = ? AND LEFT(TABLE_COLLATION, 8) = 'utf8mb4_' AND ENGINE = 'InnoDB'", table) != 1 { + t.Fatalf("%s missing or has a different character set or engine", table) } } if n := d.count(t, "SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND DATA_TYPE = 'datetime' AND DATETIME_PRECISION = 6"); n != 9 {