forked from microsoft/go-mssqldb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add driver name and version to TDS packets (microsoft#77)
feat: add driver name and version to TDS packets
- Loading branch information
1 parent
86ecefd
commit 12048ef
Showing
5 changed files
with
127 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Changelog | ||
|
||
## 0.20.0 | ||
|
||
### Features | ||
|
||
* Add driver version and name to TDS login packets | ||
|
||
### Bug fixes | ||
|
||
* Added checks while reading prelogin for invalid data ([#64](https://github.com/microsoft/go-mssqldb/issues/64))([86ecefd8b](https://github.com/microsoft/go-mssqldb/commit/86ecefd8b57683aeb5ad9328066ee73fbccd62f5)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package mssql | ||
|
||
import "fmt" | ||
|
||
// Update this variable with the release tag before pushing the tag | ||
// This value is written to the prelogin and login7 packets during a new connection | ||
const driverVersion = "v0.20.0" | ||
|
||
func getDriverVersion(ver string) uint32 { | ||
var majorVersion uint32 | ||
var minorVersion uint32 | ||
var rev uint32 | ||
_, _ = fmt.Sscanf(ver, "v%d.%d.%d", &majorVersion, &minorVersion, &rev) | ||
return (majorVersion << 24) | (minorVersion << 16) | rev | ||
} |