denisenkom / go-mssqldb

Microsoft SQL server driver written in go language
BSD 3-Clause "New" or "Revised" License
1.81k stars 493 forks source link

Fix bug where SQL Server Browser is required if using named instances #731

Closed jasonodonnell closed 2 years ago

jasonodonnell commented 2 years ago

Hi from the HashiCorp Vault team πŸ‘‹!

We ran into an issue where named instances are used on a non-standard port, with SQL Server Browser disabled, which caused connection failures. The driver attempts to discover the instance by connecting via UDP to <hostname>:1433.

This PR lifts the requirement of SQL Server Browser if named instances are used in the connection URL, and honors any configured non-standard ports.

Fixes #714.

codecov[bot] commented 2 years ago

Codecov Report

Merging #731 (2cc6c2b) into master (e538731) will decrease coverage by 0.15%. The diff coverage is 59.09%.

@@            Coverage Diff             @@
##           master     #731      +/-   ##
==========================================
- Coverage   71.29%   71.14%   -0.16%     
==========================================
  Files          24       24              
  Lines        5386     5413      +27     
==========================================
+ Hits         3840     3851      +11     
- Misses       1301     1315      +14     
- Partials      245      247       +2     
Impacted Files Coverage Ξ”
tds.go 65.05% <0.00%> (-0.81%) :arrow_down:
mssql.go 86.82% <53.57%> (-0.93%) :arrow_down:
token.go 64.67% <84.61%> (+0.45%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update e538731...2cc6c2b. Read the comment docs.