fix: ensure non-nil rows upon success in simpleQuery#1230
fix: ensure non-nil rows upon success in simpleQuery#1230Yowgf wants to merge 2 commits intolib:masterfrom
Conversation
|
My worry is that there's a real bug in the logic/protocol flow, and that merely setting this to non-nil merely sweeps that under the carpet (possibly returning wrong results). |
|
Hmm that makes sense. Maybe some fuzzing tests or other types of tests would capture the error or at least increase our confidence that the current implementation is ok. I would be willing to try to add tests sometime this week. |
|
The Ping() command is just an empty query ( Can reproduce with: master...1059 : So the question is why this happens. |
|
At the time I got that bug I was using this driver against AWS RDS, AWS Redshift and Denodo, because they are all postgres-compatible. I tried out AWS RDS and Redshift today and it didn't trigger an error. I can't try Denodo right now but maybe that's the one that triggered an error... My understanding is that if a server responds to the ';' query with no In any case, it might be a good idea to make the client implementation defensive -> even if the server decides to return only |
Previously it would panic if a ReadyForQuery was sent without a CommandComplete or EmptyQueryResponse. Not sure when/how this happens because as I understand the protocol technically this Shouldn't Happen™. I had a bit of a look at how libpq handles this, and it doesn't require this either: it just handles any response (if any) And prepares for a new query. So probably okay to do the same here. Also add pqtest.Fake() to more easily test this sort of thing. Closes #1230 Fixes #1059 Fixes #1173 Co-authored-by: yowgf <alexthomasmol@gmail.com>
Previously it would panic if a ReadyForQuery was sent without a CommandComplete or EmptyQueryResponse. Not sure when/how this happens because as I understand the protocol technically this Shouldn't Happen™. I had a bit of a look at how libpq handles this, and it doesn't require this either: it just handles any response (if any) And prepares for a new query. So probably okay to do the same here. Also add pqtest.Fake() to more easily test this sort of thing. Closes #1230 Fixes #1059 Fixes #1173 Co-authored-by: yowgf <alexthomasmol@gmail.com>
Previously it would panic if a ReadyForQuery was sent without a CommandComplete or EmptyQueryResponse. Not sure when/how this happens because as I understand the protocol technically this Shouldn't Happen™. I had a bit of a look at how libpq handles this, and it doesn't require this either: it just handles any response (if any) And prepares for a new query. So probably okay to do the same here. Also add pqtest.Fake() to more easily test this sort of thing. Closes #1230 Fixes #1059 Fixes #1173 Co-authored-by: yowgf <alexthomasmol@gmail.com>
Previously it would panic if a ReadyForQuery was sent without a CommandComplete or EmptyQueryResponse. Not sure when/how this happens because as I understand the protocol technically this Shouldn't Happen™. I had a bit of a look at how libpq handles this, and it doesn't require this either: it just handles any response (if any) And prepares for a new query. So probably okay to do the same here. Also add pqtest.Fake() to more easily test this sort of thing. Closes #1230 Fixes #1059 Fixes #1173 Co-authored-by: yowgf <alexthomasmol@gmail.com>
|
Fixed via #1234. |
Fixes #1059
Fixes #1173