DependencyWalker.DiscoverDependencies fails with System.ArgumentException: Item has already been added.
還沒有人認領這個 Issue。
評估
研究方向
從 src/Microsoft/SqlServer/Management/Smo/DependencyTree.cs 第 198 行附近開始,追蹤 DependencyWalker.DiscoverDependencies,了解未解析實體是如何作為索引鍵的。使用僅資料庫名稱大小寫不同的參照重現此失敗,然後評估已註解掉的邏輯。當等效的未解析參照使用不同的大小寫時,相依性探索不再擲出例外,即表示完成。
由索引模型根據 Issue 內容生成。
描述
We hit this when we had a few old stored procedures referring to the same dropped table with different casing for database name. I see commented out code at https://github.com/microsoft/sqlmanagementobjects/blob/main/src/Microsoft/SqlServer/Management/Smo/DependencyTree.cs#L198 that might have fixed this issue, not sure why it's been commented out though.
Microsoft.SqlServer.Management.Smo.FailedOperationException: Discover dependencies failed.
---> System.ArgumentException: Item has already been added. Key in dictionary: 'Server[@Name='SERVER']/Database[@Name='database']/UnresolvedEntity[@Name='nonexisting_table' and @Schema='dbo']' Key being added: 'Server[@Name='SERVER']/Database[@Name='DATABASE']/UnresolvedEntity[@Name='nonexisting_table' and @Schema='dbo']'
at Microsoft.SqlServer.Management.Smo.DependencyTree..ctor(Urn[] urns, DependencyChainCollection dependencies, Boolean fParents, Server server)
at Microsoft.SqlServer.Management.Smo.DependencyWalker.DiscoverDependencies(Urn[] urns, Boolean parents)
- 主要語言
- C#
- 星號
- 143
- 分支
- 29
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/sqlmanagementobjects 的其他 Issue
-
Path parsing functions are incorrect when running on Linux可能已有人在做 @shueybubbles 於 4 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 70/100
-
難度 2/5 1-3 小時 新手友好度 62/100
-
難度 3/5 1-2 天 新手友好度 72/100
-
難度 4/5 3-5 天 新手友好度 74/100
-
難度 3/5 1-2 天 新手友好度 78/100
查看 microsoft/sqlmanagementobjects 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
PCL-Community/PCL-CE#3652 ·
維護者通常 1 天內回覆
-
bug effort:S P3
難度 2/5 1-3 小時 新手友好度 72/100
nightscout/nocturne#2012 ·
維護者通常 1 天內回覆
-
area:frontend bug FE P3
難度 2/5 1-3 小時 新手友好度 68/100
klasolsson81/jobbliggaren#2010 ·
維護者通常 1 天內回覆
-
agentic-workflows untriaged
難度 1/5 1 小時以內 新手友好度 65/100
維護者通常 1 天內回覆
-
area: homeblaze type: bug
難度 2/5 1-3 小時 新手友好度 74/100
RicoSuter/Namotion.Interceptor#630 ·
維護者通常 1 天內回覆