-
Notifications
You must be signed in to change notification settings - Fork 66
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
Connection not closed when database name is incorrect #173 fix #224
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #224 +/- ##
==========================================
+ Coverage 74.62% 74.83% +0.20%
==========================================
Files 32 32
Lines 6396 6397 +1
==========================================
+ Hits 4773 4787 +14
+ Misses 1335 1327 -8
+ Partials 288 283 -5 ☔ View full report in Codecov by Sentry. |
thx for the PR Please add a test that fails without your change. |
You're right. |
@microsoft-github-policy-service agree company="Amoniac OÜ" |
#173 describes a bug when a database name is provided that does not exist, but the connections remain open and db.Close() doesn't help to close them.
This PR is supposed to fix this issue by closing connection before returning error. The connection is unusable despite the message from the server like
Cannot open database "shmaster" that was requested by the login. Using the user default database "master" instead
- db.PingContext returns an error, but connections remain open