diff --git a/pkg/config/database.go b/pkg/config/database.go index b42ff8e1c..9f886ebef 100644 --- a/pkg/config/database.go +++ b/pkg/config/database.go @@ -61,7 +61,8 @@ 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"} + // Set strict SQL mode, i.e. trigger an error if an incorrect value is inserted into a column. + config.Params = map[string]string{"sql_mode": "TRADITIONAL"} tlsConfig, err := d.TlsOptions.MakeConfig(d.Host) if err != nil { diff --git a/pkg/icingadb/quoter.go b/pkg/icingadb/quoter.go index b3cae860c..3726695dc 100644 --- a/pkg/icingadb/quoter.go +++ b/pkg/icingadb/quoter.go @@ -20,7 +20,7 @@ func NewQuoter(db *sqlx.DB) *Quoter { switch db.DriverName() { case driver.MySQL: - qc = `"` + qc = "`" case driver.PostgreSQL: qc = `"` default: