File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,8 @@ func CountOrphanedIssues() (int64, error) {
9595 return db .GetEngine (db .DefaultContext ).Table ("issue" ).
9696 Join ("LEFT" , "repository" , "issue.repo_id=repository.id" ).
9797 Where (builder.IsNull {"repository.id" }).
98- Count ("id" )
98+ Select ("COUNT(`issue`.`id`)" ).
99+ Count ()
99100}
100101
101102// DeleteOrphanedIssues delete issues without a repo
@@ -140,8 +141,9 @@ func DeleteOrphanedIssues() error {
140141func CountOrphanedObjects (subject , refobject , joinCond string ) (int64 , error ) {
141142 return db .GetEngine (db .DefaultContext ).Table ("`" + subject + "`" ).
142143 Join ("LEFT" , "`" + refobject + "`" , joinCond ).
143- Where (builder.IsNull {"`" + refobject + "`.id" }).
144- Count ("id" )
144+ Where (builder.IsNull {"`" + refobject + "`.`id`" }).
145+ Select ("COUNT(`" + subject + "`.`id`)" ).
146+ Count ()
145147}
146148
147149// DeleteOrphanedObjects delete subjects with have no existing refobject anymore
@@ -241,7 +243,6 @@ func FixIssueLabelWithOutsideLabels() (int64, error) {
241243 WHERE
242244 (label.org_id = 0 AND issue.repo_id != label.repo_id) OR (label.repo_id = 0 AND label.org_id != repository.owner_id)
243245 ) AS il_too )` )
244-
245246 if err != nil {
246247 return 0 , err
247248 }
You can’t perform that action at this time.
0 commit comments