Fixes
This commit is contained in:
parent
3ded4e3a44
commit
0c3a5d02ca
@ -724,10 +724,10 @@ loop:
|
|||||||
newExpr := &areaExpression{negate: negate, op: NOOP}
|
newExpr := &areaExpression{negate: negate, op: NOOP}
|
||||||
negate = false
|
negate = false
|
||||||
if ae != nil {
|
if ae != nil {
|
||||||
ps.push(ae)
|
|
||||||
ae.children = append(ae.children, newExpr)
|
ae.children = append(ae.children, newExpr)
|
||||||
}
|
}
|
||||||
ae = newExpr
|
ae = newExpr
|
||||||
|
ps.push(ae)
|
||||||
vsout = nvs
|
vsout = nvs
|
||||||
case tokenRParen:
|
case tokenRParen:
|
||||||
if negate {
|
if negate {
|
||||||
@ -788,14 +788,7 @@ loop:
|
|||||||
err = errInvalidNumberOfArguments
|
err = errInvalidNumberOfArguments
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
parent, empty := ps.pop()
|
ae = &areaExpression{op: OR, children: []*areaExpression{ae}}
|
||||||
if empty {
|
|
||||||
parent = ae
|
|
||||||
}
|
|
||||||
parent.children = append(
|
|
||||||
parent.children,
|
|
||||||
&areaExpression{op: OR})
|
|
||||||
ps.push(parent)
|
|
||||||
}
|
}
|
||||||
case NOOP:
|
case NOOP:
|
||||||
ae.op = OR
|
ae.op = OR
|
||||||
@ -826,8 +819,5 @@ loop:
|
|||||||
break loop
|
break loop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if prevExpr, empty := ps.pop(); !empty {
|
|
||||||
ae = prevExpr
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -149,6 +149,15 @@ func testcmd_expression_test(mc *mockServer) error {
|
|||||||
{"TEST", "OBJECT", poly9, "INTERSECTS", "GET", "mykey", "poly8", "AND",
|
{"TEST", "OBJECT", poly9, "INTERSECTS", "GET", "mykey", "poly8", "AND",
|
||||||
"(", "OBJECT", poly, "AND", "NOT", "GET", "mykey", "line3", ")"}, {"1"},
|
"(", "OBJECT", poly, "AND", "NOT", "GET", "mykey", "line3", ")"}, {"1"},
|
||||||
{"TEST", "OBJECT", poly9, "INTERSECTS", "NOT", "GET", "mykey", "line3"}, {"1"},
|
{"TEST", "OBJECT", poly9, "INTERSECTS", "NOT", "GET", "mykey", "line3"}, {"1"},
|
||||||
|
{"TEST", "NOT", "OBJECT", poly9, "INTERSECTS", "GET", "mykey", "line3"}, {"1"},
|
||||||
|
{"TEST", "OBJECT", poly9, "INTERSECTS", "GET", "mykey", "line3",
|
||||||
|
"OR", "OBJECT", poly8, "AND", "OBJECT", poly}, {"1"},
|
||||||
|
{"TEST", "OBJECT", poly9, "INTERSECTS", "OBJECT", poly8, "AND", "OBJECT", poly,
|
||||||
|
"OR", "GET", "mykey", "line3"}, {"1"},
|
||||||
|
{"TEST", "OBJECT", poly9, "INTERSECTS", "GET", "mykey", "line3", "OR",
|
||||||
|
"(", "OBJECT", poly8, "AND", "OBJECT", poly, ")"}, {"1"},
|
||||||
|
{"TEST", "OBJECT", poly9, "INTERSECTS",
|
||||||
|
"(", "GET", "mykey", "line3", "OR", "OBJECT", poly8, ")", "AND", "OBJECT", poly}, {"1"},
|
||||||
|
|
||||||
{"TEST", "OBJECT", poly9, "WITHIN", "OBJECT", poly8, "OR", "OBJECT", poly}, {"1"},
|
{"TEST", "OBJECT", poly9, "WITHIN", "OBJECT", poly8, "OR", "OBJECT", poly}, {"1"},
|
||||||
{"TEST", "OBJECT", poly9, "WITHIN", "OBJECT", poly8, "AND", "OBJECT", poly}, {"1"},
|
{"TEST", "OBJECT", poly9, "WITHIN", "OBJECT", poly8, "AND", "OBJECT", poly}, {"1"},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user