fix: support utf8mb4 across MySQL and MariaDB
This commit is contained in:
1 parent
cce17c5fa4
commit
d34894c9cd
28 files changed
+224
-121
No files matched your search
@@ -1065,13 +1065,13 @@ func (f *zoneAPITestDB) query(query string, args []any) fdbResponse {
|
||||
return fdbResponse{rows: fdbRow(int64(1))}
|
||||
case has("RELEASE_LOCK"):
|
||||
return fdbResponse{rows: fdbRow(int64(1))}
|
||||
case has("SELECT u.") && has("FOR SHARE"):
|
||||
case has("SELECT u.") && has("LOCK IN SHARE MODE"):
|
||||
if !f.hasActor {
|
||||
return fdbResponse{}
|
||||
}
|
||||
deleted, _ := f.actor.DeletedAt.Value()
|
||||
return fdbResponse{rows: fdbRow(f.actor.ID, f.actor.Username, f.actor.Role, "hash", modelNow, modelNow, nil, deleted)}
|
||||
case has("SELECT 1 FROM") && has("zone_delegations") && has("FOR SHARE"):
|
||||
case has("SELECT 1 FROM") && has("zone_delegations") && has("LOCK IN SHARE MODE"):
|
||||
if f.delegated {
|
||||
return fdbResponse{rows: fdbRow(int64(1))}
|
||||
}
|
||||
@@ -1088,7 +1088,7 @@ func (f *zoneAPITestDB) query(query string, args []any) fdbResponse {
|
||||
rows = append(rows, []driver.Value{f.foreign.Zone, int64(1), nil})
|
||||
}
|
||||
return fdbResponse{rows: rows}
|
||||
case has("SELECT d.") && has("FOR UPDATE OF d"):
|
||||
case has("SELECT d.") && has("ORDER BY username FOR UPDATE"):
|
||||
if f.stale {
|
||||
return fdbResponse{rows: fdbRow(args[0], int64(18), "bob", modelNow, f.actor.ID)}
|
||||
}
|
||||
@@ -1291,7 +1291,7 @@ func TestZoneAPIWriteHandlers(t *testing.T) {
|
||||
t.Fatalf("delegations in the after snapshot: %s", c.Entry.After)
|
||||
}
|
||||
calls := state.Queries()
|
||||
if !strings.Contains(calls[0], "GET_LOCK") || !strings.HasSuffix(calls[1], "FOR SHARE") ||
|
||||
if !strings.Contains(calls[0], "GET_LOCK") || !strings.HasSuffix(calls[1], "LOCK IN SHARE MODE") ||
|
||||
!strings.HasSuffix(calls[2], "FOR UPDATE") || !strings.Contains(calls[len(calls)-2], "INSERT INTO `coredns_webui_audit`") ||
|
||||
!strings.Contains(calls[len(calls)-1], "RELEASE_LOCK") {
|
||||
t.Fatalf("write query order: %v", calls)
|
||||
@@ -1438,7 +1438,7 @@ func TestZoneAPIWarningsAndSerialModes(t *testing.T) {
|
||||
resp := zoneAPITestStatus(t, t.Context(), c, 201)
|
||||
if !strings.Contains(zoneAPITestJSON(t, resp.Body), "target_no_address") ||
|
||||
len(zoneAPITestingSQL(state, "UPDATE `coredns_records`")) != 0 ||
|
||||
len(zoneAPITestingSQL(state, "zone_delegations` WHERE `zone` = ? AND `user_id` = ? FOR SHARE")) != 1 {
|
||||
len(zoneAPITestingSQL(state, "zone_delegations` WHERE `zone` = CAST(? AS BINARY) AND `user_id` = ? LOCK IN SHARE MODE")) != 1 {
|
||||
t.Fatalf("response = %+v, SQL = %v", resp, state.Queries())
|
||||
}
|
||||
c = zoneAPITestRequest(server, f.actor, "soa_update", zoneAPITestName, "", recordETag(rows[0]), zoneAPITestSOA)
|
||||
|
||||
Reference in new issue
Block a user