-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Port used for MSSQL databases #11633
Comments
This is the install page regarding MSSQL options: And then after installation, when the config is loaded, the host would be parsed like so: gitea/modules/setting/database.go Lines 164 to 177 in 5cb201d
Port 1433 does serve as default, but only if none of the following if-else match. If you set it as |
But if we change the port in line 167 to 0 then they never have to put the port in and, it will still work for those who have it on 1433... (AFAICS) |
Yes @zeripath, this is how it should work. |
Fix go-gitea#11633 Signed-off-by: Andrew Thornton <art27@cantab.net>
Fix #11633 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
…a#11642) Backport go-gitea#11642 Fix go-gitea#11633 Signed-off-by: Andrew Thornton <art27@cantab.net>
…a#11642) Fix go-gitea#11633 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
[x]
):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.
The text was updated successfully, but these errors were encountered: