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

Return io.EOF for empty Query statements #1285

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ganigeorgiev
Copy link

This small PR is supposed to fix #950.

@rittneje
Copy link
Collaborator

I don't think we should return io.EOF. An empty query is likely a bug, and doing this would mask it.

@ganigeorgiev
Copy link
Author

It is an empty statement. I don't see why it would be considered bug.

I have no strong opinion on this but note that https://pkg.go.dev/modernc.org/sqlite also seems to behave this way and doesn't hang.

@ganigeorgiev
Copy link
Author

ganigeorgiev commented Oct 11, 2024

It is also similar to the behavior of the already merged #973 for Exec.

For me it doesn't make sense db.Query("") to fail and db.Exec("") not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty query causes loop
2 participants