2009-07-27 5 views
0

Je me demande simplement si quelqu'un d'autre a rencontré ce problème. SubSonic génère un code SQL incorrect lors de l'utilisation de Group By ou Distinct with Paging. Est-ce une erreur connue?SubSonic génère un code SQL incorrect lors de l'utilisation de Group By ou Distinct with Paging

Notez que le groupe est dans le mauvais endroit lors de l'utilisation de la radiomessagerie.

SubSonic sortie SQL Sans Paging:

exec sp_executesql N'SELECT [dbo].[vwMapProject].[Id], [dbo].[vwMapProject].[Name] 
FROM [dbo].[vwMapProject] 
INNER JOIN [dbo].[Product_ProductComponent] ON [dbo].[vwMapProject].[ProductId] = [dbo].[Product_ProductComponent].[ProductId] 
INNER JOIN [dbo].[ProductComponent] ON [dbo].[Product_ProductComponent].[ProductComponentId] = [dbo].[ProductComponent].[Id] 
WHERE [dbo].[ProductComponent].[ExternalId] LIKE @ExternalId0 
GROUP BY [dbo].[vwMapProject].[Id], [dbo].[vwMapProject].[Name] 
',N'@ExternalId0 nvarchar(8)',@ExternalId0=N'GC767AV%' 

SubSonic sortie SQL avec Paging:

exec sp_executesql N' 
SELECT * 
FROM  (SELECT ROW_NUMBER() OVER (ORDER BY Id) AS Row, 
[dbo].[vwMapProject].[Id], [dbo].[vwMapProject].[Name] 
FROM [dbo].[vwMapProject] 
INNER JOIN [dbo].[Product_ProductComponent] ON [dbo].[vwMapProject].[ProductId] = [dbo].[Product_ProductComponent].[ProductId] 
INNER JOIN [dbo].[ProductComponent] ON [dbo].[Product_ProductComponent].[ProductComponentId] = [dbo].[ProductComponent].[Id] 
GROUP BY [dbo].[vwMapProject].[Id], [dbo].[vwMapProject].[Name] 
WHERE [dbo].[ProductComponent].[ExternalId] LIKE @ExternalId0 
) AS PagedResults 
WHERE Row >= 1 AND Row <= 20',N'@ExternalId0 nvarchar(8)',@ExternalId0=N'GC767AV%' 
+0

Selon son [blog] (http: // blog .wekeroad.com /) vous devriez signaler des problèmes à son [github repo] (http://github.com/subsonic/SubSonic-3.0/issues). – redsquare

Répondre

2

cela devrait être fixé dans la version actuelle - 3.0.0.3. Si vous ne l'avez pas, allez sur notre site de projet car il s'agit d'un bug qui a été signalé au début et j'ai passé du temps à essayer de le clouer :)

+0

C'est super, merci Rob –