aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/query
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/query')
-rw-r--r--pkg/query/compiler.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/query/compiler.go b/pkg/query/compiler.go
index dc6f93a..7d24b10 100644
--- a/pkg/query/compiler.go
+++ b/pkg/query/compiler.go
@@ -146,6 +146,8 @@ func (s Statements) buildCompile(b *strings.Builder, delim string) ([]any, error
b.WriteString(") ")
} else if cat.IsSet() && op == OP_AP {
b.WriteString("( ")
+ b.WriteString(catStr)
+ b.WriteString("IS NOT NULL AND ")
idx := 0
for _, stmt := range opStmts {
b.WriteString(catStr)
@@ -188,6 +190,11 @@ func (s Statements) buildCompile(b *strings.Builder, delim string) ([]any, error
}
} else {
idx := 0
+ if op == OP_AP {
+ b.WriteString("( ")
+ b.WriteString(catStr)
+ b.WriteString("IS NOT NULL AND ")
+ }
for _, stmt := range opStmts {
if stmt.Negated {
b.WriteString("NOT ")
@@ -206,6 +213,9 @@ func (s Statements) buildCompile(b *strings.Builder, delim string) ([]any, error
idx++
sCount++
}
+ if op == OP_AP {
+ b.WriteString(") ")
+ }
}
if sCount != len(s) {