diff --git a/frameworks/libs/distributeddb/interfaces/src/relational/relational_sync_able_storage.h b/frameworks/libs/distributeddb/interfaces/src/relational/relational_sync_able_storage.h index f05ecfb4ed5d86909842b7cd7d26d8542a0c2347..7c2f5d3ade25e3434eb6a4b7feef80f0a7d5f8fb 100644 --- a/frameworks/libs/distributeddb/interfaces/src/relational/relational_sync_able_storage.h +++ b/frameworks/libs/distributeddb/interfaces/src/relational/relational_sync_able_storage.h @@ -229,6 +229,8 @@ public: int GetCursor(const std::string &tableName, uint64_t &cursor) override; bool IsCurrentLogicDelete() const override; + + int GetLocalDataCount(const std::string &tableName, int &dataCount, int &logicDeleteDataCount) override; protected: int FillReferenceData(CloudSyncData &syncData); diff --git a/frameworks/libs/distributeddb/storage/include/icloud_sync_storage_interface.h b/frameworks/libs/distributeddb/storage/include/icloud_sync_storage_interface.h index c6d6e8e087e9381edc2ae2a99cde9614c543b8c3..b37840ec1564ff2e998964403b1d377576d100d5 100644 --- a/frameworks/libs/distributeddb/storage/include/icloud_sync_storage_interface.h +++ b/frameworks/libs/distributeddb/storage/include/icloud_sync_storage_interface.h @@ -253,6 +253,8 @@ public: { return false; } + + virtual int GetLocalDataCount(const std::string &tableName, int &dataCount, int &logicDeleteDataCount) = 0; }; } diff --git a/frameworks/libs/distributeddb/storage/include/storage_proxy.h b/frameworks/libs/distributeddb/storage/include/storage_proxy.h index 95fce107a0ab70bacaf63510b7c97ec6f5f1b621..64fd735dfb4480369f63d0e6314402e4a428beec 100644 --- a/frameworks/libs/distributeddb/storage/include/storage_proxy.h +++ b/frameworks/libs/distributeddb/storage/include/storage_proxy.h @@ -162,6 +162,8 @@ public: int ReviseLocalModTime(const std::string &tableName, const std::vector &revisedData); bool IsCurrentLogicDelete() const; + + int GetLocalDataCount(const std::string &tableName, int &dataCount, int &logicDeleteDataCount); protected: void Init(); diff --git a/frameworks/libs/distributeddb/storage/src/cloud/cloud_storage_utils.cpp b/frameworks/libs/distributeddb/storage/src/cloud/cloud_storage_utils.cpp index faea822a2545a0029c50941cd7e93c8ee08c3570..78e4dd4f4a409f0ae97a0649a4a9c439cd15028d 100644 --- a/frameworks/libs/distributeddb/storage/src/cloud/cloud_storage_utils.cpp +++ b/frameworks/libs/distributeddb/storage/src/cloud/cloud_storage_utils.cpp @@ -1328,7 +1328,7 @@ int CloudStorageUtils::IdentifyCloudTypeInner(CloudSyncData &cloudSyncData, VBuc int CloudStorageUtils::CheckAbnormalData(CloudSyncData &cloudSyncData, const VBucket &data, bool isInsert) { if (data.empty()) { - LOGE("The cloud data is empty, isInsert:%d", isInsert); + LOGE("The cloud data is empty, isInsert:%d", static_cast(isInsert)); return -E_INVALID_DATA; } bool isDataAbnormal = false; diff --git a/frameworks/libs/distributeddb/storage/src/relational/relational_sync_able_storage.cpp b/frameworks/libs/distributeddb/storage/src/relational/relational_sync_able_storage.cpp index 415b514e4c56e424b3f3eb226ee267a82ea0cbcc..2dce67203fc85e8da04bf3349d9178e80882d34e 100644 --- a/frameworks/libs/distributeddb/storage/src/relational/relational_sync_able_storage.cpp +++ b/frameworks/libs/distributeddb/storage/src/relational/relational_sync_able_storage.cpp @@ -2189,14 +2189,24 @@ int RelationalSyncAbleStorage::ReviseLocalModTime(const std::string &tableName, } int RelationalSyncAbleStorage::GetCursor(const std::string &tableName, uint64_t &cursor) +{ + if (transactionHandle_ == nullptr) { + LOGE("[RelationalSyncAbleStorage] the transaction has not been started"); + return -E_INVALID_DB; + } + return transactionHandle_->GetCursor(tableName, cursor); +} + +int RelationalSyncAbleStorage::GetLocalDataCount(const std::string &tableName, int &dataCount, + int &logicDeleteDataCount) { int errCode = E_OK; auto *handle = GetHandle(false, errCode); if (errCode != E_OK) { - LOGE("[RelationalSyncAbleStorage] Get handle failed when get cursor"); + LOGE("[RelationalSyncAbleStorage] Get handle failed when get local data count: %d", errCode); return errCode; } - errCode = handle->GetCursor(tableName, cursor); + errCode = handle->GetLocalDataCount(tableName, dataCount, logicDeleteDataCount); ReleaseHandle(handle); return errCode; } diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_relational_database_upgrader.cpp b/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_relational_database_upgrader.cpp index 2d130f925252952c082fa840dcf134879d053e05..4b3ab21722a52c3adbb4dda1e7946033d0f8b321 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_relational_database_upgrader.cpp +++ b/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_relational_database_upgrader.cpp @@ -174,9 +174,9 @@ int SqliteRelationalDatabaseUpgrader::UpgradeCursor(const std::string &logTableV std::vector sqlVec; uint64_t cursor = DBConstant::INVALID_CURSOR; for (const auto &table : schemaObj.GetTables()) { - LOGI("[Relational][UpgradeCursor] cursor of table[%s length[%u]] before upgrade is [%lld]", - DBCommon::StringMiddleMasking(table.first).c_str(), table.first.length(), - SQLiteRelationalUtils::GetCursor(db_, table.first, cursor)); + SQLiteRelationalUtils::GetCursor(db_, table.first, cursor); + LOGI("[Relational][UpgradeCursor] cursor of table[%s length[%" PRIu32 "]] before upgrade is [%" PRIu64 "]", + DBCommon::StringMiddleMasking(table.first).c_str(), table.first.length(), cursor); sqlVec.push_back(CloudStorageUtils::GetCursorHeightenInLogSql(table.first)); sqlVec.push_back(CloudStorageUtils::GetCursorHeightenInMetaSql(table.first)); } diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_ver_relational_storage_executor.h b/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_ver_relational_storage_executor.h index 52d35dcf241edae6fb9c505a2dcfedb7634e3ac5..5e03b5dd2ad2124c8a07ad90018f149da4915305 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_ver_relational_storage_executor.h +++ b/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_ver_relational_storage_executor.h @@ -213,6 +213,8 @@ public: void SetTableSchema(const TableSchema &tableSchema); int ReviseLocalModTime(const std::string &tableName, const std::vector &revisedData); + + int GetLocalDataCount(const std::string &tableName, int &dataCount, int &logicDeleteDataCount); private: int DoCleanLogs(const std::vector &tableNameList, const RelationalSchemaObject &localSchema); diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_ver_relational_storage_executor_extend.cpp b/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_ver_relational_storage_executor_extend.cpp index 4af16f048e99663dd137e3bd5727c891003650dc..ba6e5fd5e563039745e6376f81994c33bd624f72 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_ver_relational_storage_executor_extend.cpp +++ b/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_ver_relational_storage_executor_extend.cpp @@ -1571,5 +1571,24 @@ int SQLiteSingleVerRelationalStorageExecutor::GetAssetInfoOnTable(sqlite3_stmt * } return errCode; } + +int SQLiteSingleVerRelationalStorageExecutor::GetLocalDataCount(const std::string &tableName, int &dataCount, + int &logicDeleteDataCount) +{ + std::string dataCountSql = "select count(*) from " + DBCommon::GetLogTableName(tableName) + " where data_key != -1"; + int errCode = SQLiteUtils::GetCountBySql(dbHandle_, dataCountSql, dataCount); + if (errCode != E_OK) { + LOGE("[RDBExecutor] Query local data count failed: %d", errCode); + return errCode; + } + + std::string logicDeleteDataCountSql = "select count(*) from " + DBCommon::GetLogTableName(tableName) + + " where flag&0x08!=0 and data_key != -1"; + errCode = SQLiteUtils::GetCountBySql(dbHandle_, logicDeleteDataCountSql, logicDeleteDataCount); + if (errCode != E_OK) { + LOGE("[RDBExecutor] Query local logic delete data count failed: %d", errCode); + } + return errCode; +} } // namespace DistributedDB #endif diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_cloud_kv_store.cpp b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_cloud_kv_store.cpp index a74da1a479c9333ffca2f24239e07c1290c36dc4..d0f9899f85aa4b624c4edbef584f4498b23dfc94 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_cloud_kv_store.cpp +++ b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_cloud_kv_store.cpp @@ -693,4 +693,31 @@ int SqliteCloudKvStore::ReviseLocalModTime(const std::string &tableName, storageHandle_->RecycleStorageExecutor(handle); return errCode; } -} \ No newline at end of file + +int SqliteCloudKvStore::GetLocalDataCount(const std::string &tableName, int &dataCount, int &logicDeleteDataCount) +{ + auto [errCode, handle] = storageHandle_->GetStorageExecutor(true); + if (errCode != E_OK) { + LOGE("[SqliteCloudKvStore][GetLocalDataCount] Get handle failed: %d", errCode); + return errCode; + } + sqlite3 *db = nullptr; + (void)handle->GetDbHandle(db); + + std::string dataCountSql = "select count(*) from " + tableName; + errCode = SQLiteUtils::GetCountBySql(db, dataCountSql, dataCount); + if (errCode != E_OK) { + LOGE("[SqliteCloudKvStore][GetLocalDataCount] Query local data count failed: %d", errCode); + storageHandle_->RecycleStorageExecutor(handle); + return errCode; + } + + std::string logicDeleteDataCountSql = "select count(*) from " + tableName + " where flag&0x01 != 0"; + errCode = SQLiteUtils::GetCountBySql(db, logicDeleteDataCountSql, logicDeleteDataCount); + if (errCode != E_OK) { + LOGE("[SqliteCloudKvStore][GetLocalDataCount] Query local logic delete data count failed: %d", errCode); + } + storageHandle_->RecycleStorageExecutor(handle); + return errCode; +} +} diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_cloud_kv_store.h b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_cloud_kv_store.h index 9fcbe0e5ecf496cca08e320367baf566b93a2e5c..d5533b9de15b687c9093994360ae52d1b74c7682 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_cloud_kv_store.h +++ b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_cloud_kv_store.h @@ -106,6 +106,8 @@ public: int ReviseLocalModTime(const std::string &tableName, const std::vector &revisedData) override; + + int GetLocalDataCount(const std::string &tableName, int &dataCount, int &logicDeleteDataCount) override; private: std::pair GetTransactionDbHandleAndMemoryStatus(); diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_utils.h b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_utils.h index 99629c6fb7c893f93cc84f6e31f36cfea7bd571e..13b3b4677560f09cc157f07d32236af97aa71cf0 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_utils.h +++ b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_utils.h @@ -202,6 +202,8 @@ public: static int AnalysisSchemaFieldDefine(sqlite3 *db, const std::string &tableName, TableInfo &table); static int StepNext(sqlite3_stmt *stmt, bool isMemDb = false); + + static int GetCountBySql(sqlite3 *db, const std::string &sql, int &count); private: static int CreateDataBase(const OpenDbProperties &properties, sqlite3 *&dbTemp, bool setWal); diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_utils_extend.cpp b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_utils_extend.cpp index 70af3573cb5af68642089ecf3ae4077cfe4049ac..0b98cf2cfd44fb9d41c6c7fd21da94fa3bb844eb 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_utils_extend.cpp +++ b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_utils_extend.cpp @@ -695,4 +695,27 @@ int SQLiteUtils::StepNext(sqlite3_stmt *stmt, bool isMemDb) } return errCode; } + +int SQLiteUtils::GetCountBySql(sqlite3 *db, const std::string &sql, int &count) +{ + sqlite3_stmt *stmt = nullptr; + int errCode = SQLiteUtils::GetStatement(db, sql, stmt); + if (errCode != E_OK) { + LOGE("[SQLiteUtils][GetCountBySql] Get stmt failed when get local data count: %d", errCode); + return errCode; + } + errCode = SQLiteUtils::StepWithRetry(stmt, false); + if (errCode == SQLiteUtils::MapSQLiteErrno(SQLITE_ROW)) { + count = static_cast(sqlite3_column_int(stmt, 0)); + errCode = E_OK; + } else { + LOGE("[SQLiteUtils][GetCountBySql] Query local data count failed: %d", errCode); + } + int ret = E_OK; + SQLiteUtils::ResetStatement(stmt, true, ret); + if (ret != E_OK) { + LOGE("[SQLiteUtils][GetCountBySql] Reset stmt failed when get local data count: %d", ret); + } + return errCode != E_OK ? errCode : ret; +} } // namespace DistributedDB diff --git a/frameworks/libs/distributeddb/storage/src/storage_proxy.cpp b/frameworks/libs/distributeddb/storage/src/storage_proxy.cpp index 1d218e3cb4e970e49622a729a16951b0f8d26d07..a06be3273ec8f46bf6979520da19d08309c1ead2 100644 --- a/frameworks/libs/distributeddb/storage/src/storage_proxy.cpp +++ b/frameworks/libs/distributeddb/storage/src/storage_proxy.cpp @@ -718,4 +718,14 @@ bool StorageProxy::IsCurrentLogicDelete() const } return store_->IsCurrentLogicDelete(); } + +int StorageProxy::GetLocalDataCount(const std::string &tableName, int &dataCount, int &logicDeleteDataCount) +{ + std::shared_lock readLock(storeMutex_); + if (store_ == nullptr) { + LOGE("[StorageProxy] no store found when get local data"); + return false; + } + return store_->GetLocalDataCount(tableName, dataCount, logicDeleteDataCount); +} } diff --git a/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer.cpp b/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer.cpp index 11369f28deeae19719b668e38236e6d075c40fe0..52e2dd417a325885431b826c1b13bf73ef12501a 100644 --- a/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer.cpp +++ b/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer.cpp @@ -978,7 +978,7 @@ int CloudSyncer::SaveDataInTransaction(CloudSyncer::TaskId taskId, SyncParam &pa std::string maskStoreId = DBCommon::StringMiddleMasking(GetStoreIdByTask(taskId)); std::string maskTableName = DBCommon::StringMiddleMasking(param.info.tableName); if (storageProxy_->GetCursor(param.info.tableName, cursor) == E_OK) { - LOGI("[CloudSyncer] cursor before save data is %d, db: %s, table: %s, task id: %llu", cursor, + LOGI("[CloudSyncer] cursor before save data is %llu, db: %s, table: %s, task id: %llu", cursor, maskStoreId.c_str(), maskTableName.c_str(), taskId); } (void)storageProxy_->SetCursorIncFlag(true); @@ -990,7 +990,7 @@ int CloudSyncer::SaveDataInTransaction(CloudSyncer::TaskId taskId, SyncParam &pa ret = SaveData(taskId, param); (void)storageProxy_->SetCursorIncFlag(false); if (storageProxy_->GetCursor(param.info.tableName, cursor) == E_OK) { - LOGI("[CloudSyncer] cursor after save data is %d, db: %s, table: %s, task id: %llu", cursor, + LOGI("[CloudSyncer] cursor after save data is %llu, db: %s, table: %s, task id: %llu", cursor, maskStoreId.c_str(), maskTableName.c_str(), taskId); } param.insertPk.clear(); @@ -1504,8 +1504,9 @@ int CloudSyncer::PrepareSync(TaskId taskId) currentContext_.processRecorder = std::make_shared(); } LOGI("[CloudSyncer] exec storeId %.3s taskId %" PRIu64 " priority[%d] compensated[%d] logicDelete[%d]", - cloudTaskInfos_[taskId].storeId.c_str(), taskId, cloudTaskInfos_[taskId].priorityTask, - cloudTaskInfos_[taskId].compensatedTask, storageProxy_->IsCurrentLogicDelete()); + cloudTaskInfos_[taskId].storeId.c_str(), taskId, static_cast(cloudTaskInfos_[taskId].priorityTask), + static_cast(cloudTaskInfos_[taskId].compensatedTask), + static_cast(storageProxy_->IsCurrentLogicDelete())); return E_OK; } @@ -2045,26 +2046,6 @@ bool CloudSyncer::IsCurrentTableResume(TaskId taskId, bool upload) return upload == resumeTaskInfos_[taskId].upload; } -void CheckQueryCloudData(std::string &traceId, DownloadData &downloadData, std::vector &pkColNames) -{ - for (auto &data : downloadData.data) { - bool isVersionExist = data.count(CloudDbConstant::VERSION_FIELD) != 0; - bool isContainAllPk = true; - for (auto &pkColName : pkColNames) { - if (data.count(pkColName) == 0) { - isContainAllPk = false; - break; - } - } - std::string gid; - (void)CloudStorageUtils::GetValueFromVBucket(CloudDbConstant::GID_FIELD, data, gid); - if (!isVersionExist || !isContainAllPk) { - LOGE("[CloudSyncer] Invalid data from cloud, no version[%d], lost primary key[%d], gid[%s], traceId[%s]", - !isVersionExist, !isContainAllPk, gid.c_str(), traceId.c_str()); - } - } -} - int CloudSyncer::DownloadDataFromCloud(TaskId taskId, SyncParam ¶m, bool &abort, bool isFirstDownload) { diff --git a/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer.h b/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer.h index 37058f3807c5f449c63461e4c2e3a60bd1bfad8f..b6a2680a7f96ae58a6a5d4b7f94ace90963339ee 100644 --- a/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer.h +++ b/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer.h @@ -467,6 +467,10 @@ protected: static void AddNotifyDataFromDownloadAssets(const std::set &dupHashKeySet, DownloadItem &downloadItem, ChangedData &changedAssets); + void CheckDataAfterDownload(const std::string &tableName); + + void CheckQueryCloudData(std::string &traceId, DownloadData &downloadData, std::vector &pkColNames); + mutable std::mutex dataLock_; TaskId lastTaskId_; std::list taskQueue_; diff --git a/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer_extend.cpp b/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer_extend.cpp index fb9eeca3e38cdc530e285b4f82554ad9a5da1590..31889d219a51449ba0f3b09312a577c86a1e503b 100644 --- a/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer_extend.cpp +++ b/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer_extend.cpp @@ -770,6 +770,7 @@ int CloudSyncer::DoDownloadInNeed(const CloudTaskInfo &taskInfo, const bool need if (errCode != E_OK) { return errCode; } + CheckDataAfterDownload(table); MarkDownloadFinishIfNeed(table); // needUpload indicate that the syncMode need push if (needUpload) { @@ -1486,4 +1487,38 @@ void CloudSyncer::AddNotifyDataFromDownloadAssets(const std::set &dupHashKe changedAssets.primaryData[ChangeType::OP_UPDATE].push_back(downloadItem.primaryKeyValList); } } -} \ No newline at end of file + +void CloudSyncer::CheckDataAfterDownload(const std::string &tableName) +{ + int dataCount = 0; + int logicDeleteDataCount = 0; + int errCode = storageProxy_->GetLocalDataCount(tableName, dataCount, logicDeleteDataCount); + if (errCode == E_OK) { + LOGI("[CloudSyncer] Check local data after download[%s[%u]], data count: %d, logic delete data count: %d", + DBCommon::StringMiddleMasking(tableName).c_str(), tableName.length(), dataCount, logicDeleteDataCount); + } else { + LOGW("[CloudSyncer] Get local data after download fail: %d", errCode); + } +} + +void CloudSyncer::CheckQueryCloudData(std::string &traceId, DownloadData &downloadData, + std::vector &pkColNames) +{ + for (auto &data : downloadData.data) { + bool isVersionExist = data.count(CloudDbConstant::VERSION_FIELD) != 0; + bool isContainAllPk = true; + for (auto &pkColName : pkColNames) { + if (data.count(pkColName) == 0) { + isContainAllPk = false; + break; + } + } + std::string gid; + (void)CloudStorageUtils::GetValueFromVBucket(CloudDbConstant::GID_FIELD, data, gid); + if (!isVersionExist || !isContainAllPk) { + LOGE("[CloudSyncer] Invalid data from cloud, no version[%d], lost primary key[%d], gid[%s], traceId[%s]", + static_cast(!isVersionExist), static_cast(!isContainAllPk), gid.c_str(), traceId.c_str()); + } + } +} +} diff --git a/frameworks/libs/distributeddb/test/unittest/common/interfaces/distributeddb_interfaces_nb_delegate_test.cpp b/frameworks/libs/distributeddb/test/unittest/common/interfaces/distributeddb_interfaces_nb_delegate_test.cpp index a95ec3c0b292697fbb99df04a814a3f902635be9..f9f6d09a92394d4e25feecadeaeddf4072792ce3 100644 --- a/frameworks/libs/distributeddb/test/unittest/common/interfaces/distributeddb_interfaces_nb_delegate_test.cpp +++ b/frameworks/libs/distributeddb/test/unittest/common/interfaces/distributeddb_interfaces_nb_delegate_test.cpp @@ -2280,6 +2280,8 @@ HWTEST_F(DistributedDBInterfacesNBDelegateTest, SingleVerGetSecurityOption001, T ASSERT_TRUE(g_kvNbDelegatePtr != nullptr); EXPECT_TRUE(g_kvDelegateStatus == OK); EXPECT_TRUE(g_kvNbDelegatePtr->GetSecurityOption(savedOption) == OK); + SecurityOption secOption = {option.secOption.securityLabel, option.secOption.securityFlag}; + EXPECT_TRUE(savedOption != secOption); EXPECT_TRUE(savedOption.securityLabel == 0); EXPECT_TRUE(savedOption.securityFlag == 0); diff --git a/frameworks/libs/distributeddb/test/unittest/common/syncer/cloud/mock_icloud_sync_storage_interface.h b/frameworks/libs/distributeddb/test/unittest/common/syncer/cloud/mock_icloud_sync_storage_interface.h index ec34ffe9f53864bbaf02b593328a88a84d858b33..76e7912a7ebb73f46869d9d55183f99101d4d4ad 100644 --- a/frameworks/libs/distributeddb/test/unittest/common/syncer/cloud/mock_icloud_sync_storage_interface.h +++ b/frameworks/libs/distributeddb/test/unittest/common/syncer/cloud/mock_icloud_sync_storage_interface.h @@ -51,6 +51,7 @@ public: MOCK_METHOD1(CheckQueryValid, int(const QuerySyncObject &)); MOCK_METHOD1(IsSharedTable, bool(const std::string &)); MOCK_CONST_METHOD0(GetCloudSyncConfig, CloudSyncConfig()); + MOCK_METHOD3(GetLocalDataCount, int(const std::string &, int &, int &)); }; }