Skip to content

Commit

Permalink
Add test for previously fixed implicit limit bug (#8070)
Browse files Browse the repository at this point in the history
FOR loops used in function arguments previously had implicit limits
applied to them incorrectly, even though they weren't going to the
output.

Before #7517, some places suppressed implicit limits by setting
`inhibit_implicit_limit`. But it turns out that not all places checked
both `implicit_limit` and `inhibit_implicit_limit`, so some places
(such as FOR loops) did not have the limit correctly inhibited.

In #7517 we got rid of `inhibit_implicit_limit`, which fixed the issue
by making everything use one mechanism.

This adds a test for the bug that was fixed. We'll backport #7517 and
this.

Closes #8063.
  • Loading branch information
msullivan authored Dec 3, 2024
1 parent e6c5be2 commit d66d41a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_edgeql_for.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ async def test_edgeql_for_limit_01(self):
}
)

async def test_edgeql_for_implicit_limit_01(self):
await self.assert_query_result(
r'''
select sum((
for i in range_unpack(range(0, 10000)) union
1
));
''',
[10000],
implicit_limit=100,
)

async def test_edgeql_for_filter_02(self):
await self.assert_query_result(
r'''
Expand Down

0 comments on commit d66d41a

Please sign in to comment.