mirror of https://github.com/tidwall/tile38.git
empty results when key not found, #207
This commit is contained in:
parent
aafae38412
commit
e2357eac3e
|
@ -400,13 +400,11 @@ func (c *Controller) cmdWithinOrIntersects(cmd string, msg *server.Message) (res
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
if sw.col == nil {
|
|
||||||
return "", errKeyNotFound
|
|
||||||
}
|
|
||||||
if msg.OutputType == server.JSON {
|
if msg.OutputType == server.JSON {
|
||||||
wr.WriteString(`{"ok":true`)
|
wr.WriteString(`{"ok":true`)
|
||||||
}
|
}
|
||||||
sw.writeHead()
|
sw.writeHead()
|
||||||
|
if sw.col != nil {
|
||||||
minZ, maxZ := zMinMaxFromWheres(s.wheres)
|
minZ, maxZ := zMinMaxFromWheres(s.wheres)
|
||||||
if cmd == "within" {
|
if cmd == "within" {
|
||||||
sw.col.Within(s.sparse, s.o, s.minLat, s.minLon, s.maxLat, s.maxLon, minZ, maxZ,
|
sw.col.Within(s.sparse, s.o, s.minLat, s.minLon, s.maxLat, s.maxLon, minZ, maxZ,
|
||||||
|
@ -435,6 +433,7 @@ func (c *Controller) cmdWithinOrIntersects(cmd string, msg *server.Message) (res
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
sw.writeFoot()
|
sw.writeFoot()
|
||||||
if msg.OutputType == server.JSON {
|
if msg.OutputType == server.JSON {
|
||||||
wr.WriteString(`,"elapsed":"` + time.Now().Sub(start).String() + "\"}")
|
wr.WriteString(`,"elapsed":"` + time.Now().Sub(start).String() + "\"}")
|
||||||
|
|
Loading…
Reference in New Issue