Skip to content

Commit ad268ca

Browse files
committed
fixes sql for sqlce for data integrity controller
1 parent 49eb1d4 commit ad268ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Umbraco.Web/WebServices/XmlDataIntegrityController.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ public bool FixMembersXmlTable()
3535
public bool CheckContentXmlTable()
3636
{
3737
var totalPublished = Services.ContentService.CountPublished();
38+
3839
var subQuery = new Sql()
39-
.Select("Count(DISTINCT cmsContentXml.nodeId)")
40+
.Select("DISTINCT cmsContentXml.nodeId")
4041
.From<ContentXmlDto>()
4142
.InnerJoin<DocumentDto>()
4243
.On<DocumentDto, ContentXmlDto>(left => left.NodeId, right => right.NodeId);
43-
var totalXml = ApplicationContext.DatabaseContext.Database.ExecuteScalar<int>(subQuery);
44+
45+
var totalXml = ApplicationContext.DatabaseContext.Database.ExecuteScalar<int>("SELECT COUNT(*) FROM (" + subQuery.SQL + ") as tmp");
4446

4547
return totalXml == totalPublished;
4648
}

0 commit comments

Comments
 (0)