Skip to content

Commit

Permalink
MySQL/MariaDB: Use strict SQL mode
Browse files Browse the repository at this point in the history
For MySQL (and MariaDB, etc.), in addition to `ANSI_QUOTES` SQL mode,
we now also set `TRADITIONAL`, which enables strict mode.
  • Loading branch information
lippserd committed Mar 19, 2024
1 parent 6876f57 commit 16d43cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/config/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 16d43cb

Please sign in to comment.