Skip to content
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

Send TDS version 8 in Login7 when in strict mode #1870

Merged
merged 3 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ final class TDS {
// TDS protocol versions
static final String VER_TDS80 = "tds/8.0"; // TLS-first connections

static final int VER_SQL2022 = 0x8000005; // TDS 8.0
static final int VER_DENALI = 0x74000004; // TDS 7.4
static final int VER_KATMAI = 0x730B0003; // TDS 7.3B(includes null bit compression)
static final int VER_YUKON = 0x72090002; // TDS 7.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6038,7 +6038,10 @@ final boolean complete(LogonCommand logonCommand, TDSReader tdsReader) throws SQ
int dataLen = 0;

// Denali --> TDS 7.4, Katmai (10.0) & later 7.3B, Prelogin disconnects anything older
if (serverMajorVersion >= 11) {
// TDS version 8 if strict mode
if (serverMajorVersion >= 17 && encryptOption.compareToIgnoreCase(EncryptOption.Strict.toString()) == 0) {
lilgreenbird marked this conversation as resolved.
Show resolved Hide resolved
tdsVersion = TDS.VER_SQL2022;
} else if (serverMajorVersion >= 11) {
tdsVersion = TDS.VER_DENALI;
} else if (serverMajorVersion >= 10) {
tdsVersion = TDS.VER_KATMAI;
Expand Down