This PR fixes an issue introduced with a rewrite of the MSSQL logic.
The issue is caused by MSSQL having a concept of "default instance" vs "named instance". Logically, the "default instance" has a name, but it is presented differently throughout.
The code was updated to correctly handle "named instance", but this broke support for "default instance".
The paths look similar to this:
- Default instance: `%MSSQL%\Server\Database`
- Named instance: `%MSSQL%\Server\Instance\Database`
This is slightly problematic because given a path with three parts, you cannot know if it targets "default instance + database" or "named instance".
To account for this the code has been rewritten to explicitly keep track of which case we are in, and were there is ambiguity, both cases are tested. In the odd case where both match, this is treated as an error.
The filters were being applied slightly differently than the regular filters, by applying include, then exclude, and allowing include to add new elements.
This has been standardized so we now apply the filters the same way as for regular filters where "first match wins", and only source paths can introduce a new database.
Verified with both "default instance" and "named instance" on the same machine.
This fixes#6551
This fixes#6969