Skip to content

Commit 9cc5f1c

Browse files
execution: add forgotten subquery guards (#369)
Signed-off-by: Michael Hoffmann <[email protected]>
1 parent 03fbe39 commit 9cc5f1c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

execution/execution.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ func newCall(e *parser.Call, storage *engstore.SelectorPool, opts *query.Options
168168
for i := range e.Args {
169169
switch t := e.Args[i].(type) {
170170
case *parser.SubqueryExpr:
171+
if !opts.IsInstantQuery() {
172+
return nil, parse.ErrNotImplemented
173+
}
171174
if !opts.EnableSubqueries {
172175
return nil, parse.ErrNotImplemented
173176
}
@@ -182,6 +185,12 @@ func newCall(e *parser.Call, storage *engstore.SelectorPool, opts *query.Options
182185
func newAbsentOverTimeOperator(call *parser.Call, storage *engstore.SelectorPool, opts *query.Options, hints storage.SelectHints) (model.VectorOperator, error) {
183186
switch arg := call.Args[0].(type) {
184187
case *parser.SubqueryExpr:
188+
if !opts.IsInstantQuery() {
189+
return nil, parse.ErrNotImplemented
190+
}
191+
if !opts.EnableSubqueries {
192+
return nil, parse.ErrNotImplemented
193+
}
185194
matrixCall := &parser.Call{
186195
Func: &parser.Function{Name: "last_over_time"},
187196
}

0 commit comments

Comments
 (0)