fix: support utf8mb4 across MySQL and MariaDB
Test / test (push) Canceled after 6m35s
Build and publish image / image (push) Successful in 13m42s

This commit is contained in:
bryanpedini committed 2026-11-20 15:14:28 +01:00
1 parent cce17c5fa4
commit d34894c9cd
28 files changed
+224 -121

No files matched your search

+7 -14
View File
@@ -250,7 +250,7 @@ func TestIntegrationZoneAPIHandlers(t *testing.T) {
soaID := view.Body.(zoneAPIView).SOA.ID
zoneAPITestAuditIDs(t, audit.Before, []int64{soaID, record.ID})
zoneAPITestAuditIDs(t, audit.After, []int64{soaID, record.ID})
if !strings.Contains(string(audit.Before), `"ttl": 180`) || !strings.Contains(string(audit.After), `"ttl": 60`) {
if !strings.Contains(string(audit.Before), `"ttl":180`) || !strings.Contains(string(audit.After), `"ttl":60`) {
t.Fatalf("update audit values: %s, %s", audit.Before, audit.After)
}
@@ -313,8 +313,8 @@ func TestIntegrationZoneAPIHandlers(t *testing.T) {
it.call(t, user, "zone_import", "", "", zoneAPITestJSON(t, input), 200)
it.serial(t, serial+8)
imports := it.audit(t, "zone_import", 1)
if !strings.Contains(string(imports[0].Before), `"name": "broken"`) ||
!strings.Contains(string(imports[0].After), `"name": "second"`) ||
if !strings.Contains(string(imports[0].Before), `"name":"broken"`) ||
!strings.Contains(string(imports[0].After), `"name":"second"`) ||
strings.Contains(string(imports[0].After), "backup") {
t.Fatalf("import audit: %s, %s", imports[0].Before, imports[0].After)
}
@@ -332,7 +332,7 @@ func TestIntegrationZoneAPIHandlers(t *testing.T) {
it.call(t, user, "zone_delete", "", "", `{"confirm":"example.org"}`, 403)
it.call(t, admin, "zone_delete", "", "", `{"confirm":"wrong.example.org"}`, 422)
it.call(t, admin, "zone_delete", "", "", `{"confirm":"EXAMPLE.ORG"}`, 204)
if len(it.rows(t)) != 0 || !strings.Contains(string(it.audit(t, "zone_delete", 1)[0].Before), `"username": "bob"`) {
if len(it.rows(t)) != 0 || !strings.Contains(string(it.audit(t, "zone_delete", 1)[0].Before), `"username":"bob"`) {
t.Fatal("zone deletion did not remove and audit the records and delegation")
}
it.call(t, admin, "zone_read", "", "", "", 404)
@@ -385,7 +385,7 @@ func TestIntegrationZoneAPIJSONColumnETags(t *testing.T) {
response := it.call(t, admin, "record_create", "", "", zoneAPITestRecord, 201)
row := response.Body.(map[string]any)["record"].(zoneAPIRecord)
stored, err := it.records.RecordByID(t.Context(), row.ID)
if err != nil || row.ETag != recordETag(stored) || !strings.Contains(stored.Content.String, `": "`) {
if err != nil || row.ETag != recordETag(stored) {
t.Fatalf("record create ETag = %q, stored row %+v, error %v", row.ETag, stored, err)
}
id := strconv.FormatInt(row.ID, 10)
@@ -405,10 +405,6 @@ func TestIntegrationZoneAPIJSONColumnETags(t *testing.T) {
if check := zoneAPITestJSON(t, it.call(t, admin, "zone_check", "", "", "", 200).Body); check != `{"problems":[]}` {
t.Fatalf("JSON column rows reported as not canonical: %s", check)
}
soa := zoneAPIFindSOA(it.rows(t))
if !strings.Contains(soa.Content.String, `"retry": 600, "expire"`) {
t.Fatalf("MySQL did not reformat the SOA content: %s", soa.Content.String)
}
}
func TestIntegrationZoneAPIRepairs(t *testing.T) {
@@ -568,13 +564,10 @@ func TestIntegrationZoneAPIAuditRollback(t *testing.T) {
func (it itZoneAPI) waitForRowLock(t *testing.T, ctx context.Context, suffix string) {
t.Helper()
ticker := time.NewTicker(25 * time.Millisecond)
ticker := time.NewTicker(itLockPollInterval)
defer ticker.Stop()
for {
var waiting bool
err := it.db.root.QueryRowContext(ctx, "SELECT EXISTS (SELECT 1 FROM performance_schema.data_lock_waits w "+
"JOIN performance_schema.data_locks l ON l.ENGINE = w.ENGINE AND l.ENGINE_LOCK_ID = w.REQUESTING_ENGINE_LOCK_ID "+
"WHERE l.OBJECT_SCHEMA = ? AND l.OBJECT_NAME = ?)", it.db.name, it.db.prefix+suffix).Scan(&waiting)
waiting, err := it.db.rowLockWaiting(ctx, suffix)
if err != nil {
t.Fatal(err)
}