Don't allow 0 for max_connections database option

0 stands for deactivate, which makes no sense here.
This commit is contained in:
Eric Lippmann 2021-08-10 08:55:24 +02:00
parent 50473bca70
commit 8232000524

View file

@ -67,6 +67,9 @@ func (o *Options) UnmarshalYAML(unmarshal func(interface{}) error) error {
return internal.CantUnmarshalYAML(err, o)
}
if o.MaxConnections == 0 {
return errors.New("max_connections cannot be 0. Configure a value greater than zero, or use -1 for no connection limit")
}
if o.MaxConnectionsPerTable < 1 {
return errors.New("max_connections_per_table must be at least 1")
}