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 dsn for mssql named instances #1600

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

adi1
Copy link

@adi1 adi1 commented May 1, 2024

Description

Remove port from an mssql dsn when using named instances.

Motivation and Context

MSSQL named instances use dynamic port numbers. You can either connect directly to the port, or to the named instance.
Providing a DB URL like mssql://user:pass@host\instance/db?driver=FreeTDS will result in a DSN which looks like DRIVER=FreeTDS;SERVER=host\instance,1433;UID=user;PWD=pass; because the default port is added. This fails to connect, because the instance is not listening on port 1443.

#1566

How Has This Been Tested?

I have only tested locally with and without named instances.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added the changelog accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@abondar
Copy link
Member

abondar commented May 7, 2024

Hello!

Please try to write test for it
You can limit test to only mssql the same way we do it for postgres/mysql tests in tests/backends as example

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