Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No error is thrown if selectExactlyOne selects 0 rows when used in a lateral #129

Open
tetchel opened this issue Sep 28, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@tetchel
Copy link

tetchel commented Sep 28, 2022

I've created a repository with a repro and details here: https://github.com/tetchel/zap-lateral-bug

@jawj
Copy link
Owner

jawj commented Sep 29, 2022

Hmm. I guess the idea of selectExactlyOne is that you use it when you absolutely know that there is one matching row — e.g. because you're joining on a NOT NULL foreign key.

That said, you're right that this is unexpected and inconsistent behaviour, and that qualifies it as a great big bug. I'll see if I can fix it!

@jawj jawj self-assigned this Sep 29, 2022
@jawj jawj added the bug Something isn't working label Sep 29, 2022
@purge
Copy link
Contributor

purge commented Oct 4, 2022

Ha, I just experienced this! you think you absolutely know there's one matching row but RLS makes that uncertain :)

@tetchel
Copy link
Author

tetchel commented Oct 4, 2022

yeah, for us we'd removed a NOT NULL from a FK column and did not think to update all the laterals using that column as a join.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants