Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

403 lines
9.8 KiB

  1. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_ClearPoolCorruption]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  2. drop procedure [dbo].[DBGPortal_ClearPoolCorruption]
  3. GO
  4. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_GetBucketComments]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  5. drop procedure [dbo].[DBGPortal_GetBucketComments]
  6. GO
  7. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_GetBucketCrashes]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  8. drop procedure [dbo].[DBGPortal_GetBucketCrashes]
  9. GO
  10. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_GetBucketData]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  11. drop procedure [dbo].[DBGPortal_GetBucketData]
  12. GO
  13. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_GetBucketStatsByAlias]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  14. drop procedure [dbo].[DBGPortal_GetBucketStatsByAlias]
  15. GO
  16. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_GetBucketStatus]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  17. drop procedure [dbo].[DBGPortal_GetBucketStatus]
  18. GO
  19. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_GetBucketsByAlias]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  20. drop procedure [dbo].[DBGPortal_GetBucketsByAlias]
  21. GO
  22. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_GetCommentActions]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  23. drop procedure [dbo].[DBGPortal_GetCommentActions]
  24. GO
  25. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_GetDeliveryTypes]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  26. drop procedure [dbo].[DBGPortal_GetDeliveryTypes]
  27. GO
  28. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_GetFollowUpIDs]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  29. drop procedure [dbo].[DBGPortal_GetFollowUpIDs]
  30. GO
  31. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_GetSolutionTypes]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  32. drop procedure [dbo].[DBGPortal_GetSolutionTypes]
  33. GO
  34. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_SetBucketBugNumber]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  35. drop procedure [dbo].[DBGPortal_SetBucketBugNumber]
  36. GO
  37. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_SetComment]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  38. drop procedure [dbo].[DBGPortal_SetComment]
  39. GO
  40. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_SetPoolCorruption]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  41. drop procedure [dbo].[DBGPortal_SetPoolCorruption]
  42. GO
  43. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBGPortal_UpdateStaticDataBugID]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  44. drop procedure [dbo].[DBGPortal_UpdateStaticDataBugID]
  45. GO
  46. SET QUOTED_IDENTIFIER OFF
  47. GO
  48. SET ANSI_NULLS OFF
  49. GO
  50. CREATE PROCEDURE DBGPortal_ClearPoolCorruption (
  51. @BucketID varchar(100)
  52. ) AS
  53. UPDATE BucketToInt SET PoolCorruption = NULL WHERE BucketID = @BucketID
  54. GO
  55. SET QUOTED_IDENTIFIER OFF
  56. GO
  57. SET ANSI_NULLS ON
  58. GO
  59. SET QUOTED_IDENTIFIER OFF
  60. GO
  61. SET ANSI_NULLS OFF
  62. GO
  63. CREATE PROCEDURE DBGPortal_GetBucketComments(
  64. @BucketID varchar(100)
  65. ) AS
  66. select EntryDate, CommentBy, Action, Comment from comments where BucketID = @BucketID order by entrydate desc
  67. GO
  68. SET QUOTED_IDENTIFIER OFF
  69. GO
  70. SET ANSI_NULLS ON
  71. GO
  72. SET QUOTED_IDENTIFIER ON
  73. GO
  74. SET ANSI_NULLS OFF
  75. GO
  76. CREATE PROCEDURE DBGPortal_GetBucketCrashes(
  77. @BucketID varchar(100)
  78. ) AS
  79. select top 300 bFullDump, SKU, BuildNo, Source, EntryDate, FilePath, Email from dbgportal_crashdatav3 where BucketID = @BucketID order by bFullDump desc, Source desc, Email desc, entrydate desc
  80. GO
  81. SET QUOTED_IDENTIFIER OFF
  82. GO
  83. SET ANSI_NULLS ON
  84. GO
  85. SET QUOTED_IDENTIFIER ON
  86. GO
  87. SET ANSI_NULLS OFF
  88. GO
  89. CREATE PROCEDURE DBGPortal_GetBucketData(
  90. @BucketID varchar(100)
  91. ) AS
  92. --select iBucket, FollowUp, BTI.iDriverName, DriverName, PoolCorruption, Platform, MoreData from BucketToInt as BTI
  93. --left join FollowUpids as F on f.iFollowUp = BTI.iFollowUp
  94. --left join DrNames as D on D.iDriverName = BTI.iDriverName
  95. --where BTI.BucketID = @BucketID
  96. select BTI.iBucket, FollowUp, BTI.iDriverName, DriverName, PoolCorruption, Platform, MoreData, CrashCount, SolutionID, R.BugID, [Area] from BucketToInt as BTI
  97. left join DrNames as D on D.iDriverName = BTI.iDriverName
  98. left join RaidBugs as R on BTI.BucketID = R.BucketID
  99. inner join dbgportal_BucketDatav3 as BD on BD.BucketID = BTI.BucketID
  100. where BTI.BucketID = @BucketID
  101. GO
  102. SET QUOTED_IDENTIFIER OFF
  103. GO
  104. SET ANSI_NULLS ON
  105. GO
  106. SET QUOTED_IDENTIFIER ON
  107. GO
  108. SET ANSI_NULLS OFF
  109. GO
  110. CREATE PROCEDURE DBGPortal_GetBucketStatsByAlias (
  111. @Alias varchar(50)
  112. ) as
  113. declare @TotalCrashes int
  114. declare @AliasTotal int
  115. declare @SolvedCrashes int
  116. declare @RaidedCrashes int
  117. select @TotalCrashes = sum(crashCount) from dbgportal_bucketdatav3
  118. select @AliasTotal = sum(crashCount) from dbgportal_bucketdatav3 where FollowUp = @alias
  119. select @SolvedCrashes = sum(crashCount) from dbgportal_bucketdatav3 where FollowUp = @Alias and SolutionId is not null
  120. select @RaidedCrashes = sum(crashCount) from dbgportal_bucketdatav3 where FollowUp = @Alias and bugID is not null and SolutionID is null
  121. if ( @SolvedCrashes is Null )
  122. set @SolvedCrashes = 0
  123. if( @RaidedCrashes is null )
  124. set @RaidedCrashes = 0
  125. select @TotalCrashes as Total, @AliasTotal as AliasTotal, @SolvedCrashes as Solved, @RaidedCrashes as Raided, (@AliasTotal - @RaidedCrashes - @SolvedCrashes) as Untouched
  126. GO
  127. SET QUOTED_IDENTIFIER OFF
  128. GO
  129. SET ANSI_NULLS ON
  130. GO
  131. SET QUOTED_IDENTIFIER ON
  132. GO
  133. SET ANSI_NULLS ON
  134. GO
  135. CREATE PROCEDURE DBGPortal_GetBucketStatus (
  136. @BucketID varchar(100)
  137. ) AS
  138. --select TOP 1 MAX(ActionID) as BiggestComment, [Action], CommentBy from Comments WHERE BucketID = @BucketID and ActionID != 7 and ActionID != 11
  139. --group by [Action], CommentBy ORDER BY BiggestComment DESC
  140. if exists ( select * from comments where bucketID= @BucketID and ActionID = 8 )
  141. select top 1 ActionID as BiggestComment, [Action], CommentBy from comments where BucketID = @BucketID and ActionID= 8 order by entrydate desc
  142. else
  143. select top 1 ActionID as BiggestComment, [Action], CommentBy from comments where BucketID = @BucketID order by entrydate desc
  144. GO
  145. SET QUOTED_IDENTIFIER OFF
  146. GO
  147. SET ANSI_NULLS ON
  148. GO
  149. SET QUOTED_IDENTIFIER ON
  150. GO
  151. SET ANSI_NULLS OFF
  152. GO
  153. CREATE PROCEDURE DBGPortal_GetBucketsByAlias (
  154. @Alias varchar(50)
  155. ) AS
  156. select top 25 BucketID, CrashCount, BugID from dbgportal_bucketDatav3 where FollowUp = @Alias and SolutionID is null order by CrashCount desc
  157. GO
  158. SET QUOTED_IDENTIFIER OFF
  159. GO
  160. SET ANSI_NULLS ON
  161. GO
  162. SET QUOTED_IDENTIFIER OFF
  163. GO
  164. SET ANSI_NULLS ON
  165. GO
  166. CREATE PROCEDURE DBGPortal_GetCommentActions AS
  167. SELECT * FROM CommentActions WHERE ActionID <= 5
  168. GO
  169. SET QUOTED_IDENTIFIER OFF
  170. GO
  171. SET ANSI_NULLS ON
  172. GO
  173. SET QUOTED_IDENTIFIER ON
  174. GO
  175. SET ANSI_NULLS OFF
  176. GO
  177. CREATE PROCEDURE DBGPortal_GetDeliveryTypes AS
  178. SELECT DeliveryType FROM Solutions3.DBO.DeliveryTypes
  179. GO
  180. SET QUOTED_IDENTIFIER OFF
  181. GO
  182. SET ANSI_NULLS ON
  183. GO
  184. SET QUOTED_IDENTIFIER OFF
  185. GO
  186. SET ANSI_NULLS OFF
  187. GO
  188. CREATE PROCEDURE DBGPortal_GetFollowUpIDs AS
  189. select FollowUp, iFollowUP from FollowUpids
  190. GO
  191. SET QUOTED_IDENTIFIER OFF
  192. GO
  193. SET ANSI_NULLS ON
  194. GO
  195. SET QUOTED_IDENTIFIER OFF
  196. GO
  197. SET ANSI_NULLS OFF
  198. GO
  199. CREATE PROCEDURE DBGPortal_GetSolutionTypes AS
  200. SELECT SolutionTypeName from Solutions3.DBO.SolutionTypes
  201. GO
  202. SET QUOTED_IDENTIFIER OFF
  203. GO
  204. SET ANSI_NULLS ON
  205. GO
  206. SET QUOTED_IDENTIFIER OFF
  207. GO
  208. SET ANSI_NULLS ON
  209. GO
  210. CREATE PROCEDURE DBGPortal_SetBucketBugNumber (
  211. @BucketID varchar(100),
  212. @BugID int,
  213. @iBucket int,
  214. @Area varchar(30)
  215. ) AS
  216. IF EXISTS( SELECT iBucket FROM RaidBugs WHERE BucketID = @BucketID )
  217. UPDATE RaidBugs SET BugID=@BugID, Area=@Area WHERE BucketID = @BucketID
  218. ELSE
  219. INSERT INTO RaidBugs (iBucket, BugID, BucketID, Area ) VALUES ( @iBucket, @BugID, @BucketID, @Area )
  220. GO
  221. SET QUOTED_IDENTIFIER OFF
  222. GO
  223. SET ANSI_NULLS ON
  224. GO
  225. SET QUOTED_IDENTIFIER ON
  226. GO
  227. SET ANSI_NULLS OFF
  228. GO
  229. CREATE PROCEDURE DBGPortal_SetComment(
  230. @By varchar(20),
  231. -- @Action nvarchar(50),
  232. @Action int,
  233. @Comment nvarchar(1000),
  234. @BucketID varchar(100),
  235. @iBucket int
  236. ) AS
  237. DECLARE @ActionString nvarchar(50)
  238. IF ( @Action = 7 )
  239. UPDATE Comments SET ActionID = 6, Action=(SELECT [Action] FROM CommentActions WHERE ActionID = 6) WHERE BucketID=@BucketID and ActionID = 8
  240. if ( @Action = 9 )
  241. UPDATE Comments SET ActionID = 10, Action=(SELECT [Action] FROM CommentActions WHERE ActionID = 10) WHERE BucketID=@BucketID and ActionID = 8
  242. SELECT @ActionString = [Action] from CommentActions where ActionID = @Action
  243. INSERT INTO Comments ( EntryDate, CommentBy, [Action], Comment, BucketID, ActionID, iBucket ) VALUES ( GETDATE(), @By, @ActionString, @Comment, @BucketID, @Action, @iBucket )
  244. GO
  245. SET QUOTED_IDENTIFIER OFF
  246. GO
  247. SET ANSI_NULLS ON
  248. GO
  249. SET QUOTED_IDENTIFIER OFF
  250. GO
  251. SET ANSI_NULLS OFF
  252. GO
  253. CREATE PROCEDURE DBGPortal_SetPoolCorruption(
  254. @BucketID varchar(100)
  255. ) AS
  256. UPDATE BucketToInt SET PoolCorruption = 1 WHERE BucketID = @BucketID
  257. GO
  258. SET QUOTED_IDENTIFIER OFF
  259. GO
  260. SET ANSI_NULLS ON
  261. GO
  262. SET QUOTED_IDENTIFIER ON
  263. GO
  264. SET ANSI_NULLS OFF
  265. GO
  266. CREATE PROCEDURE DBGPortal_UpdateStaticDataBugID (
  267. @BucketID varchar(100),
  268. @BugID int
  269. ) AS
  270. UPDATE DBGPortal_BucketDataV3 SET BugID = @BugID WHERE BucketID = @BucketID
  271. GO
  272. SET QUOTED_IDENTIFIER OFF
  273. GO
  274. SET ANSI_NULLS ON
  275. GO