diff --git a/services/distributeddataservice/app/src/query_helper.cpp b/services/distributeddataservice/app/src/query_helper.cpp index cb56bf8a5349bb24e346dcdc34442482d41760cd..2c8ce69f6258332824e783608cce39481e9059ba 100644 --- a/services/distributeddataservice/app/src/query_helper.cpp +++ b/services/distributeddataservice/app/src/query_helper.cpp @@ -15,6 +15,7 @@ #define LOG_TAG "QueryHelper" +#include "query_helper.h" #include #include #include @@ -22,7 +23,6 @@ #include "data_query.h" #include "log_print.h" #include "types.h" -#include "query_helper.h" namespace OHOS::DistributedKv { constexpr int QUERY_SKIP_SIZE = 1; diff --git a/services/distributeddataservice/app/src/security/security.cpp b/services/distributeddataservice/app/src/security/security.cpp index ff70dd7f34018b796fecb67658089a6c83972846..632ae0f52065b4064b9c5e4ce375e5d072125e7f 100644 --- a/services/distributeddataservice/app/src/security/security.cpp +++ b/services/distributeddataservice/app/src/security/security.cpp @@ -241,7 +241,7 @@ DBStatus Security::GetFileSecurityOption(const std::string &filePath, SecurityOp option = {NOT_SET, ECE}; return OK; } - ZLOGI("get security option %{public}s", value.c_str()); + ZLOGI("get security option %s", value.c_str()); if (value == "s3") { option = { Convert2Security(value), SECE }; } else { diff --git a/services/distributeddataservice/app/src/single_kvstore_impl.cpp b/services/distributeddataservice/app/src/single_kvstore_impl.cpp index 3fd7506153f690c87d1ca01f04db33e0b6300cf9..33c121c045086ed0e6ab7324c35ae38f6612a607 100644 --- a/services/distributeddataservice/app/src/single_kvstore_impl.cpp +++ b/services/distributeddataservice/app/src/single_kvstore_impl.cpp @@ -900,7 +900,7 @@ std::vector SingleKvStoreImpl::MapNodeIdToUuids(const std::vector &deviceIds, } DdsTrace trace(std::string(LOG_TAG "Delegate::") + std::string(__FUNCTION__)); status = kvStoreNbDelegate_->SubscribeRemoteQuery(deviceUuids, syncEnd, dbQuery, false); - ZLOGD("end: %d", static_cast(status)); + ZLOGD("end: %u", static_cast(status)); } Reporter::GetInstance()->VisitStatistic()->Report({bundleName_, __FUNCTION__}); return ConvertDbStatus(status); @@ -962,7 +962,7 @@ Status SingleKvStoreImpl::DoUnSubscribe(const std::vector &deviceId } DdsTrace trace(std::string(LOG_TAG "Delegate::") + std::string(__FUNCTION__)); status = kvStoreNbDelegate_->UnSubscribeRemoteQuery(deviceUuids, syncEnd, dbQuery, false); - ZLOGD("end: %d", static_cast(status)); + ZLOGD("end: %u", static_cast(status)); } return ConvertDbStatus(status); } diff --git a/services/distributeddataservice/service/rdb/rdb_syncer.cpp b/services/distributeddataservice/service/rdb/rdb_syncer.cpp index 3731e28a009853bf6b5d2bc53bf7e68298099486..87ad4dea4f6354b234c648be23e95e430451dee0 100644 --- a/services/distributeddataservice/service/rdb/rdb_syncer.cpp +++ b/services/distributeddataservice/service/rdb/rdb_syncer.cpp @@ -41,7 +41,9 @@ RdbSyncer::~RdbSyncer() noexcept if ((manager_ != nullptr) && (delegate_ != nullptr)) { manager_->CloseStore(delegate_); } - delete manager_; + if (manager_ != nullptr) { + delete manager_; + } if (observer_ != nullptr) { delete observer_; }