diff --git a/frameworks/libs/distributeddb/storage/src/relational/relational_sync_data_inserter.cpp b/frameworks/libs/distributeddb/storage/src/relational/relational_sync_data_inserter.cpp index 617e7dae773713ae6258a77f8d4c5fdec5b7dae8..010ff2db592407cb03eaf53c00493ad9572cc7ae 100644 --- a/frameworks/libs/distributeddb/storage/src/relational/relational_sync_data_inserter.cpp +++ b/frameworks/libs/distributeddb/storage/src/relational/relational_sync_data_inserter.cpp @@ -565,4 +565,17 @@ int RelationalSyncDataInserter::GetQueryLogByFieldStmt(sqlite3 *db, sqlite3_stmt } return errCode; } + +void RelationalSyncDataInserter::IncNonExistDelCnt() +{ + nonExistDelCnt_++; +} + +void RelationalSyncDataInserter::DfxPrintLog() const +{ + if (nonExistDelCnt_ > 0) { + LOGI("[RelationalStorageExecutor][SaveSyncDataItem] Delete non-exist data. Nothing to save, cnt:" PRIu32 ".", + nonExistDelCnt_); + } +} } // namespace DistributedDB \ No newline at end of file diff --git a/frameworks/libs/distributeddb/storage/src/relational/relational_sync_data_inserter.h b/frameworks/libs/distributeddb/storage/src/relational/relational_sync_data_inserter.h index 0efe0c4dd6dd6f7a43710191ca6c676074bf0ee5..51ea3af8190fecb418c7f7eb146503b1626e88b2 100644 --- a/frameworks/libs/distributeddb/storage/src/relational/relational_sync_data_inserter.h +++ b/frameworks/libs/distributeddb/storage/src/relational/relational_sync_data_inserter.h @@ -88,6 +88,9 @@ public: ChangedData &GetChangedData(); std::vector GetRemoteFields() const; + + void IncNonExistDelCnt(); + void DfxPrintLog() const; private: int GetInsertStatement(sqlite3 *db, sqlite3_stmt *&stmt); @@ -109,6 +112,7 @@ private: std::string insertTableName_; // table name to save sync data DistributedTableMode mode_ = DistributedTableMode::SPLIT_BY_DEVICE; ChangedData data_; + uint32_t nonExistDelCnt_ = 0u; }; } #endif // RELATIONAL_SYNC_DATA_INSERTER_H \ No newline at end of file diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_ver_relational_storage_executor.cpp b/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_ver_relational_storage_executor.cpp index 974584a8b569a233ef48369f8718415b1de3418e..8fa74fa878bd7ce713a67618626680ddf31d685d 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_ver_relational_storage_executor.cpp +++ b/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_ver_relational_storage_executor.cpp @@ -923,7 +923,7 @@ int SQLiteSingleVerRelationalStorageExecutor::SaveSyncDataItem(RelationalSyncDat return ProcessMissQueryData(item, inserter, saveStmt.rmDataStmt, saveStmt.rmLogStmt); } if (!isExist && ((item.flag & DataItem::DELETE_FLAG) != 0)) { - LOGI("[RelationalStorageExecutor][SaveSyncDataItem] Delete non-exist data. Nothing to save."); + inserter.IncNonExistDelCnt(); return E_OK; } bool isUpdate = isExist && mode_ == DistributedTableMode::COLLABORATION; @@ -962,6 +962,7 @@ int SQLiteSingleVerRelationalStorageExecutor::SaveSyncDataItems(RelationalSyncDa // Need not reset rmDataStmt and rmLogStmt here. return saveStmt.ResetStatements(false); }); + inserter.DfxPrintLog(); int ret = saveStmt.ResetStatements(true); return errCode != E_OK ? errCode : ret;