diff --git a/tds_test.go b/tds_test.go index 497f7a12..3fd102fa 100644 --- a/tds_test.go +++ b/tds_test.go @@ -709,11 +709,14 @@ func TestLeakedConnections(t *testing.T) { t.Fatal("Ping with good credentials should not fail, but got error:", err.Error()) } - var localNetAddr string + var localNetAddr sql.NullString err = goodConn.QueryRow("SELECT local_net_address FROM sys.dm_exec_connections WHERE session_id=@@SPID").Scan(&localNetAddr) if err != nil { t.Fatal("cannot scan local_net_address value", err) } + if !localNetAddr.Valid { + t.Fatal("local_net_address should not be NULL") + } // Remember the number of open connections from local_net_address, excluding the current one var openConnections int