void CLogDuplicate::DoRunL() { RLogDynBuf expr; TLogFilterExprBuilder exprBuilder(iDatabase); exprBuilder.BuildExprLC(expr, *iFilterList, KLogAnd); TheSql.Format(KLogSqlSelectDuplicateString, iRecentList, &expr.DesC(), iId); CleanupStack::PopAndDestroy(&expr); RLogDbView view; view.PrepareLC(iDatabase.DTIDatabase(), TheSql); if(view.FirstL()) { // Begin a transaction TBool inTransaction = iDatabase.DTIInTransaction(); if(!inTransaction) { iDatabase.DTIBeginWithRollBackProtectionLC(); } // Get column ids static TDbColNo idColNo = 0; static TDbColNo duplicateColNo = 0; if(idColNo == 0) { CDbColSet* cs = view.ColSetL(); idColNo = cs->ColNo(KLogFieldIdString); duplicateColNo = cs->ColNo(KLogFieldEventDuplicateString); delete cs; } // Iterate through the events do { // Get current event id view.GetL(); const TLogId id = view.ColInt32(idColNo); // Set the latest recent? if(iId < 0) { iId = id; } // Make the change view.UpdateL(); iId == id ? view.SetColNullL(duplicateColNo) : view.SetColL(duplicateColNo, iId); view.PutL(); // This is a "hidden" change. It may affect the contents of a view, but the actual event hasn't changed iDatabase.DTIChangeInterface().DCISubmitChangedEventContextL(ELogChangeTypeEventChangedHidden, id); } while(view.NextL()); // Commit changes if(!inTransaction) { iDatabase.DTICommitAndCancelRollbackProtectionL(); } } CleanupStack::PopAndDestroy(&view); }
void FormulaScorer::beginQuery(const FeatureProviderPtr& pProvider, const QueryFeature& queryFeature) { IndexReaderPtr pIndexReader = pProvider->getIndexFeature().getIndexReader(); ExprParser parser(pIndexReader); FeatureContext featureCtx(pProvider.get(), &queryFeature); DefaultExprEvaluatorBuilder exprBuilder(parser, pIndexReader, &featureCtx); // parser.parse(); }