Skip to content

Commit c710cf6

Browse files
authored
[core][fix] Fix nested with statements (#2145)
1 parent 4f4d80e commit c710cf6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fixcore/fixcore/db/arango_query.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,13 +791,13 @@ def with_clause(in_crsr: str, clause: WithClause, limit: Optional[Limit]) -> str
791791
# LET regions = (
792792
# FOR region IN 1..1 OUTBOUND account `fix_test` OPTIONS { bfs: true, uniqueVertices: 'global' }
793793
# FILTER "region" IN region.kinds
794-
# LIMIT 1
795794
# LET resources = (
796795
# FOR resource IN 1..1 OUTBOUND region `fix_test` OPTIONS {bfs:true,uniqueVertices:'global'}
797796
# LIMIT 1
798797
# RETURN resource
799798
# )
800799
# FILTER LENGTH(resources)>0
800+
# LIMIT 1
801801
# RETURN region
802802
# )
803803
# FILTER LENGTH(regions)==0
@@ -829,8 +829,7 @@ def traversal_filter(cl: WithClause, in_crs: str, depth: int) -> str:
829829
# empty: if we find one element, it is not empty
830830
# any: if we find one element, it is any
831831
# count op x: if we find x+1 elements, we can always answer the predicate
832-
f"LIMIT {cl.with_filter.num + 1} "
833-
f"{inner} RETURN {for_crsr})"
832+
f"{inner} LIMIT {cl.with_filter.num + 1} RETURN {for_crsr})"
834833
f"FILTER LENGTH({let_crs}){cl.with_filter.op}{cl.with_filter.num} "
835834
)
836835

0 commit comments

Comments
 (0)