-
Notifications
You must be signed in to change notification settings - Fork 34
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
SELECT incorrectly returning no data #24
Comments
Seems I'm running into the same issue too, I was using SwiftKuery Postgresql in a Server app, but now the select queries return no results |
I am seeing the same issue with 1.0.3. I am having trouble trying to test the From what I can tell at the moment, the issue appears to be related to the ConnectionPool. If I make my poolOptions |
@bridger thanks for point out the
@irar2 your changes for issue #23 also appear to fix issue #24. I will do some more testing and submit a PR, unless @irar2 you are planning on doing the same in #23. |
Thanks for the info guys. @djones6 are you familiar with this issue? |
@ianpartridge I am not, but FWIW, the fix that @irar2 developed looks reasonable to me. @dsperling thanks for the rebasing - please go ahead and submit a PR if you're satisfied the fix addresses your issue. |
I have figured out the issue I was having. This was not a bug in Swift-Kuery-PostgreSQL. The culprit was a count function that grabbed a value without letting the
Here is the buggy function, which for some reason, the fix for #23 seemed to workaround:
With the fix below, I no longer see SELECT functions return
Questions:
No code changes are required from my perspective. I am not sure if this information might help the original author of this issue. |
@EnriqueL8 could you take a look at this please? |
Hey @dsperling , I think this could be a robust strategy to handle data with one row:
You could merge the guards together if you find it painful. |
@EnriqueL8 thanks for the hints above using
|
Hey @dsperling , I don't think |
@EnriqueL8 ok that makes sense. What is an example of a SQL query that would return a single value? |
I think for example when running a |
i shutdown the server that was running the project since, it was a side project. Can always start it back up and let you guys know. |
I've been running a fork of this repo with the |
@bridger I also confirmed that
We were just wondering if your original bug report had a similar root cause. |
Thanks @bridger, @t3ndai, @dsperling ! I'll look into merging |
Hey @dsperling , I have seen that you have merged issue_23 into your fork! Could you create a Pull Request so we can add it to |
The fix has been merged in #45 and tagged |
I noticed that every once in a while my authentication code would find no data, even though it should have. It was reproing sporadically.
This is the query which is was running:
SELECT Devices.id, Devices.name, Devices.created, Devices.type, Users.id, Users.name, Users.created FROM Devices JOIN Users ON Devices.authedUser = Users.id WHERE (Devices.secretHash = '7aa5e492231b9c7fc32e13f1') AND (Devices.salt = 'ZR6E');
The result was sometimes incorrectly
successNoData
even though the row in the database existed for a while and running the exact same query immediately afterwards in psql would return the correct data.I am now using the branch
issue_23
and it isn't reproing for me now that I've switched. I was hopeful that branch had a race condition fix in it and it is promising so far.The text was updated successfully, but these errors were encountered: