Skip to content

Port used for MSSQL databases #11633

Closed
@jeffest

Description

@jeffest
  • Gitea version (or commit ref): 1.12
  • Git version: 2.22
  • Operating system: Windows 10
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

The installation process assumes that the MSSQL server instance provided by the user will listen on the default port 1433. This is defined in function ParseMSSQLHostPort.
By doing so, it prevents the mssql driver from actually detecting the port automatically. This has a major impact if the db server is hosting multiple instances of SQL Server. The port 1433 is being used by the default instance and all other instances will use dynamic ports. In order to determine the correct port for a particular instance (the one supplied by the end user), the driver is querying the SQL Server's Browser service (here). But it only does that if the port is not specified ( p.port == 0 ) which never happens considering the default value of 1433.

IMHO, there should not be a default port for mssql driver if not provided by the user and the driver should be responsible for finding it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions