Просмотр исходного кода

fixed issue with high cpu with search full text selected when only a few items are returend

scott brogden 5 лет назад
Родитель
Сommit
1ca99b0022
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      QPasteWnd.cpp

+ 1 - 1
QPasteWnd.cpp

@@ -1496,7 +1496,7 @@ BOOL CQPasteWnd::FillList(CString csSQLSearch /*=""*/)
 		ATL::CCritSecLock csLock(m_CritSection.m_sect);
 		ATL::CCritSecLock csLock(m_CritSection.m_sect);
 
 
 		//Format the count and select sql queries for the thread
 		//Format the count and select sql queries for the thread
-		m_CountSQL.Format(_T("SELECT COUNT(Main.lID) FROM Main %s where %s"), dataJoin, strFilter);
+		m_CountSQL.Format(_T("SELECT COUNT(%s Main.lID) FROM Main %s where %s"), IsDistinct, dataJoin, strFilter);
 
 
 		m_SQL.Format(_T("SELECT %s Main.lID, Main.mText, Main.lParentID, Main.lDontAutoDelete, ")
 		m_SQL.Format(_T("SELECT %s Main.lID, Main.mText, Main.lParentID, Main.lDontAutoDelete, ")
 			_T("Main.lShortCut, Main.bIsGroup, Main.QuickPasteText, Main.clipOrder, Main.clipGroupOrder, ")
 			_T("Main.lShortCut, Main.bIsGroup, Main.QuickPasteText, Main.clipOrder, Main.clipGroupOrder, ")