From c510f70b3d49d446097fda4f53b7d8593169a0bc Mon Sep 17 00:00:00 2001 From: lianhuix Date: Thu, 18 May 2023 16:58:22 +0800 Subject: [PATCH] Fix code check Signed-off-by: lianhuix --- .../gaussdb_rd/src/executor/document/check_common.h | 8 ++++---- .../gaussdb_rd/src/oh_adapter/src/kv_store_manager.cpp | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/executor/document/check_common.h b/services/distributeddataservice/service/data_share/gaussdb_rd/src/executor/document/check_common.h index ec81d50d..2985bd67 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/executor/document/check_common.h +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/executor/document/check_common.h @@ -29,10 +29,10 @@ public: ~CheckCommon() = default; static bool CheckCollectionName(const std::string &collectionName, std::string &formattedName, int &errCode); - static int CheckFilter(JsonObject &document, bool &isOnlyId, std::vector> &filterPath); - static int CheckIdFormat(JsonObject &data, bool &isIdExisit); - static int CheckDocument(JsonObject &document); - static int CheckUpdata(JsonObject &updata, std::vector> &path); + static int CheckFilter(JsonObject &filterObj, bool &isOnlyId, std::vector> &filterPath); + static int CheckIdFormat(JsonObject &filterJson, bool &isIdExisit); + static int CheckDocument(JsonObject &documentObj); + static int CheckUpdata(JsonObject &updataObj, std::vector> &path); static int CheckProjection(JsonObject &projectionObj, std::vector> &path); }; using Key = std::vector; diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/kv_store_manager.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/kv_store_manager.cpp index 5162ebf4..d038491f 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/kv_store_manager.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/kv_store_manager.cpp @@ -45,6 +45,10 @@ int KvStoreManager::GetKvStore(const std::string &path, const DBConfig &config, errCode = sqliteExecutor->GetDBConfig(oriConfigStr); if (errCode == -E_NOT_FOUND) { errCode = sqliteExecutor->SetDBConfig(config.ToString()); + if (errCode != E_OK) { + GLOGE("Set db config failed. %d", errCode); + goto END; + } } else if (errCode != E_OK) { goto END; } else { @@ -65,7 +69,6 @@ int KvStoreManager::GetKvStore(const std::string &path, const DBConfig &config, END: delete sqliteExecutor; - sqliteExecutor = nullptr; return errCode; } } // namespace DocumentDB \ No newline at end of file -- Gitee