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

fix: include instance name in Login7 message and traceID in prelogin #1668

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

TPVallancourt
Copy link

@TPVallancourt TPVallancourt commented Oct 29, 2024

Fix for #1563

  1. Write FeatureExtensions to the end of the Login7 Packet matching the behavior of the go-mssqldb library. The header must still be written in the same place as it was previously. The value in the header is adjusted to reflect that FeatureExtensions now appear at the end of the packet
  2. When receiving routing data from the server, save a new string, instance. Previously we just saved server which removes the instance name from the redirect URL. This is the proper string for TLS negotiation, but Login7 needs the server and the instance together.
  3. On the prelogin payload, include a randomly generated traceID, Starting with TDS37.0 it seems that traceID is no longer optional for Fabric.

@TPVallancourt TPVallancourt changed the title Move FeatureExtensions to end of Login7 Packet + use full server name for Login7 fix: Move FeatureExtensions to end of Login7 Packet + use full server name for Login7 Oct 29, 2024
@TPVallancourt
Copy link
Author

Hi @arthurschreiber , are there any other things I need to do get this incorporated into the library?

@arthurschreiber arthurschreiber changed the title fix: Move FeatureExtensions to end of Login7 Packet + use full server name for Login7 fix: include instance name in Login7 message Nov 10, 2024
@arthurschreiber
Copy link
Collaborator

@TPVallancourt This seems to break the appveyor build on Windows 🤔

@@ -2484,7 +2485,7 @@ class Connection extends EventEmitter {
}

payload.hostname = this.config.options.workstationId || os.hostname();
payload.serverName = this.routingData ? this.routingData.server : this.config.server;
payload.serverName = this.routingData ? `${this.routingData.server}\\${this.routingData.instance}` : this.config.server;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is instance here guaranteed to always be a non-empty string? What happens if it's empty?

@TPVallancourt TPVallancourt changed the title fix: include instance name in Login7 message fix: include instance name in Login7 message and traceID in prelogin Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants