Skip to content

Commit b5053d1

Browse files
docs: document parseInstances behavior change for missing InstanceName
1 parent e915b54 commit b5053d1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pkg/sqlcmd/serverlist.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ func parseInstances(msg []byte) msdsn.BrowserData {
107107
if len(instanceDict) == 0 {
108108
break
109109
}
110-
// Only add if InstanceName key exists and is non-empty
110+
// Deliberate behavior change from go-mssqldb's parseInstances:
111+
// skip entries with missing or empty InstanceName (e.g. malformed
112+
// registry data) instead of adding them under an empty key.
111113
if instName, ok := instanceDict["InstanceName"]; ok && instName != "" {
112114
results[strings.ToUpper(instName)] = instanceDict
113115
}

0 commit comments

Comments
 (0)