Skip to content

Commit

Permalink
Merge pull request denisenkom#131 from srdan-bozovic-msft/srbozovi/tds8
Browse files Browse the repository at this point in the history
fix: protocol version
  • Loading branch information
apoorvdeshmukh authored Jul 17, 2023
2 parents 386a3fc + c789659 commit ff5b16d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tds.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const (
verTDS73 = verTDS73A
verTDS73B = 0x730B0003
verTDS74 = 0x74000004
verTDS80 = 0x08000000
)

// packet types
Expand Down Expand Up @@ -1026,6 +1027,12 @@ func interpretPreloginResponse(p msdsn.Config, fe *featureExtFedAuth, fields map
}

func prepareLogin(ctx context.Context, c *Connector, p msdsn.Config, logger ContextLogger, auth integratedauth.IntegratedAuthenticator, fe *featureExtFedAuth, packetSize uint32) (l *login, err error) {
var TDSVersion uint32
if(p.Encryption == msdsn.EncryptionStrict) {
TDSVersion = verTDS80
} else {
TDSVersion = verTDS74
}
var typeFlags uint8
if p.ReadOnlyIntent {
typeFlags |= fReadOnlyIntent
Expand All @@ -1038,7 +1045,7 @@ func prepareLogin(ctx context.Context, c *Connector, p msdsn.Config, logger Cont
serverName = p.Host
}
l = &login{
TDSVersion: verTDS74,
TDSVersion: TDSVersion,
PacketSize: packetSize,
Database: p.Database,
OptionFlags2: fODBC, // to get unlimited TEXTSIZE
Expand Down

0 comments on commit ff5b16d

Please sign in to comment.