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
+2
-2
@@ -77,7 +77,7 @@ func TestMySQLConfig(t *testing.T) {
|
||||
}
|
||||
mc := mysqlConfig(cfg)
|
||||
if mc.User != "coredns_webui" || mc.Passwd != "s3cret-Pa55word" || mc.Net != "tcp" || mc.Addr != "db.example.org:3307" ||
|
||||
mc.DBName != "coredns" || !mc.ParseTime || mc.Loc != time.UTC || mc.Collation != "utf8mb4_0900_ai_ci" ||
|
||||
mc.DBName != "coredns" || !mc.ParseTime || mc.Loc != time.UTC || mc.Collation != "" || !strings.Contains(mc.FormatDSN(), "charset=utf8mb4") ||
|
||||
mc.Timeout != 5*time.Second || mc.ReadTimeout != 30*time.Second || mc.WriteTimeout != 30*time.Second ||
|
||||
mc.MultiStatements || mc.InterpolateParams || mc.TLSConfig != "preferred" {
|
||||
t.Fatalf("unexpected %+v", mc)
|
||||
@@ -596,7 +596,7 @@ func TestTraceConnector(t *testing.T) {
|
||||
out := logs.String()
|
||||
for _, want := range []string{
|
||||
"level=TRACE", `msg="sql statement"`, "caller=\"userStore.queryUser < userStore.UserByUsername\"",
|
||||
"caller=\"userStore.exec < userStore.SetPassword\"", "caller=\"sessionStore.CreateSession", "WHERE u.`username` = ?",
|
||||
"caller=\"userStore.exec < userStore.SetPassword\"", "caller=\"sessionStore.CreateSession", "WHERE u.`username` = CAST(? AS BINARY)",
|
||||
"args=[alice]", "[redacted] 2026-11-18 12:00:00 +0000 UTC 7]", "args=\"[[redacted] 7 2026-11-18",
|
||||
`msg="function entry" func=userStore.UserByUsername`, `msg="function exit" func=userStore.UserByUsername`,
|
||||
`msg="function entry" func=recordStore.UpdateRecord`, `msg="function exit" func=recordStore.UpdateRecord`,
|
||||
|
||||
Reference in new issue
Block a user