diff --git a/frameworks/libs/distributeddb/syncer/src/single_ver_sync_target.cpp b/frameworks/libs/distributeddb/syncer/src/single_ver_sync_target.cpp index 1a03df1bd49923dea3aaf38dfa58b70c1c4a9097..b471ae705d813ca7c685d7295c3572adcf8f75b1 100644 --- a/frameworks/libs/distributeddb/syncer/src/single_ver_sync_target.cpp +++ b/frameworks/libs/distributeddb/syncer/src/single_ver_sync_target.cpp @@ -35,7 +35,7 @@ void SingleVerSyncTarget::SetSyncOperation(SyncOperation *operation) { SyncTarget::SetSyncOperation(operation); if ((operation != nullptr) && !operation->IsKilled()) { - operation->GetQuery(query_); + query_ = operation->GetQuery(); isQuerySync_ = operation->IsQuerySync(); } } diff --git a/frameworks/libs/distributeddb/syncer/src/sync_operation.cpp b/frameworks/libs/distributeddb/syncer/src/sync_operation.cpp index 812c39c951a7e221c4e0daeecc66d4e6a2731350..f31faa4c891426f6ff822cc99910853a046cf8c1 100644 --- a/frameworks/libs/distributeddb/syncer/src/sync_operation.cpp +++ b/frameworks/libs/distributeddb/syncer/src/sync_operation.cpp @@ -241,10 +241,10 @@ void SyncOperation::SetQuery(const QuerySyncObject &query) } } -void SyncOperation::GetQuery(QuerySyncObject &targetObject) const +QuerySyncObject SyncOperation::GetQuery() const { std::lock_guard lock(queryMutex_); - targetObject = query_; + return query_; } bool SyncOperation::IsQuerySync() const diff --git a/frameworks/libs/distributeddb/syncer/src/sync_operation.h b/frameworks/libs/distributeddb/syncer/src/sync_operation.h index d1542e89991f97127e686fe135fd2c0337add131..fa2ea12c4bab35e6a4bd0c57b29e18afd76a6595 100644 --- a/frameworks/libs/distributeddb/syncer/src/sync_operation.h +++ b/frameworks/libs/distributeddb/syncer/src/sync_operation.h @@ -121,7 +121,7 @@ public: // For query sync void SetQuery(const QuerySyncObject &query); - void GetQuery(QuerySyncObject &targetObject) const; + QuerySyncObject GetQuery() const; bool IsQuerySync() const; std::string GetQueryId() const; static SyncType GetSyncType(int mode);