From 16d43cb10add51f50dddee83cd0d05a0fdd2a248 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 18 Mar 2024 09:53:59 +0100 Subject: [PATCH] MySQL/MariaDB: Use strict SQL mode For MySQL (and MariaDB, etc.), in addition to `ANSI_QUOTES` SQL mode, we now also set `TRADITIONAL`, which enables strict mode. --- pkg/config/database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/database.go b/pkg/config/database.go index b42ff8e1c..1137b555e 100644 --- a/pkg/config/database.go +++ b/pkg/config/database.go @@ -61,7 +61,7 @@ func (d *Database) Open(logger *logging.Logger) (*icingadb.DB, error) { config.DBName = d.Database config.Timeout = time.Minute - config.Params = map[string]string{"sql_mode": "ANSI_QUOTES"} + config.Params = map[string]string{"sql_mode": "'TRADITIONAL,ANSI_QUOTES'"} tlsConfig, err := d.TlsOptions.MakeConfig(d.Host) if err != nil {