gosnowflake
gosnowflake copied to clipboard
Set the result type before calling exec from Ping
Description
If the context has been set to Async Mode, the driver will attempt to inspect the result type. If the result type has not been set, the driver will panic when returning the [partial] result.
We ran into this issue when pinging a connection to test for aliveness when the context had WithAsyncMode
applied. While async mode doesn't make a lot of sense for pings, in this case the same context is used to ping before executing a query.
Happy to write a test, just wasn't clear to me where Ping tests would live.
Checklist
- [ ] Code compiles correctly
- [x] Run
make fmt
to fix inconsistent formats - [x] Run
make lint
to get lint errors and fix all of them - [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the README / documentation, if necessary
Hi @nyergler , yes would you mind writing a test for this? Thank you.
@sfc-gh-jbahk Of course; any chance you can point me to the right place for that to live? Wasn't immediately clear to me how Ping
is currently being tested.
I think connection_test.go should suffice. Its tests are in driver_test.go at the moment, but I think it makes sense to move it under the former.
Hello @nyergler ! Are you planning to rebase and provide a test for your solution? I'd like to merge it when it is ready and tested :)
Thanks for the nudge, @sfc-gh-pfus ; I'll take a look at that this week.
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
I have read the CLA Document and I hereby sign the CLA
@sfc-gh-pfus Updated.
I have read the CLA Document and I hereby sign the CLA
recheck
Hello @nyergler ! I approved your PR, but in the meantime a colleague of mine merged his PR. Since this is cross-repo PR I cannot rebase it myself. Can you rebase?
@sfc-gh-pfus Done.
Thank you very much @nyergler ! I merged your PR.