Add ability to define NAMESPACE without DATABASE

Once somebody had specified USE NAMESPACE to select a namespace, it was not possible to DEFINE a DATABASE underneath the NAMESPACE, as an error that ‘no database is selected’ would be returned. Not it is possible to DEFINE DATABASE having selected only a NAMESPACE.
This commit is contained in:
Tobie Morgan Hitchcock 2017-02-10 09:49:08 +00:00
parent 7d88c389e1
commit b724d864f8

View file

@ -54,7 +54,12 @@ func (o *options) get(kind int) (kv, ns, db string, err error) {
return
}
if ns == "" || db == "" {
if kind >= AuthNS && ns == "" {
err = &BlankError{}
return
}
if kind >= AuthDB && db == "" {
err = &BlankError{}
return
}