-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Description
- Gitea version (or commit ref): 1.12
- Git version: 2.22
- Operating system: Windows 10
- Database (use
[x]
):- PostgreSQLMySQLMSSQLSQLiteTo pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL)NoNot relevantTo pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
- 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.
Activity
jolheiser commentedon May 26, 2020
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
127.0.0.1:0
then it would parse the port as0
afaikzeripath commentedon May 26, 2020
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)
jeffest commentedon May 27, 2020
Yes @zeripath, this is how it should work.
@jolheiser, your remark is 100% valid but it's neither intuitive or user-friendly (AFAICT)
Default MSSQL port 0 to allow automatic detection by default
Default MSSQL port 0 to allow automatic detection by default (#11642)
Default MSSQL port 0 to allow automatic detection by default (#11642) (…
Default MSSQL port 0 to allow automatic detection by default (go-gite…