edgedb icon indicating copy to clipboard operation
edgedb copied to clipboard

GROUP - Can't compile ref to visible binding

Open jhwz opened this issue 2 years ago • 3 comments

  • EdgeDB Version: 2.1.0-dev.827+ea32987
  • OS Version: 20.04.1-Ubuntu

Using example database, the query:

with grouped := (group Movie by .release_year)
for item in grouped union (select item.elements { title } )

gives

InternalServerError: Can't compile ref to visible binding ns~1@@(__derived__::g~1)
Hint: This is most likely a bug in EdgeDB. Please consider opening an issue ticket at https://github.com/edgedb/edgedb/issues/new?template=bug_report.md

note that if you simply remove the reference to title, it works.

with grouped := (group Movie by .release_year)
for item in grouped union (select item.elements )

jhwz avatar Aug 09 '22 22:08 jhwz

Thanks for the report!

As a workaround, don't bind the group result to a variable, just stick it into the select.

msullivan avatar Aug 09 '22 22:08 msullivan

That's what I ended up doing! I wanted to create a free object with some other properties but will omit that for now :)

jhwz avatar Aug 09 '22 22:08 jhwz

with grouped := (for x in Movie union { multi elements := x })
for item in grouped union (select item.elements { title } );

fails in a similar way that hopefully shares the root cause.

msullivan avatar Aug 10 '22 01:08 msullivan