From 1e15ad06867c558715471aa89c823acecb90c416 Mon Sep 17 00:00:00 2001 From: Eli Yukelzon Date: Thu, 26 Nov 2020 10:41:29 +0200 Subject: [PATCH] MM-30917 Fix invalid reply count calculation during thread migration (#16395) --- store/sqlstore/post_store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/sqlstore/post_store.go b/store/sqlstore/post_store.go index 88410b69d7..20334d085b 100644 --- a/store/sqlstore/post_store.go +++ b/store/sqlstore/post_store.go @@ -1980,7 +1980,7 @@ func (s *SqlPostStore) updateThreadsFromPosts(transaction *gorp.Transaction, pos return err } // calculate reply count - count, err := transaction.SelectInt("SELECT COUNT(Id) FROM Posts WHERE RootId=:RootId", map[string]interface{}{"RootId": rootId}) + count, err := transaction.SelectInt("SELECT COUNT(Id) FROM Posts WHERE RootId=:RootId And DeleteAt=0", map[string]interface{}{"RootId": rootId}) if err != nil { return err }