From fdd80da06f8bdda164ee37012452a717db7e9a8d Mon Sep 17 00:00:00 2001 From: mazhao Date: Fri, 8 Sep 2023 16:27:07 +0800 Subject: [PATCH] fix code check opnion Signed-off-by: mazhao --- .../gaussdb_rd/src/executor/document/check_common.cpp | 6 +++--- .../gaussdb_rd/src/executor/document/check_common.h | 4 ++-- .../data_share/gaussdb_rd/src/interface/src/result_set.cpp | 4 +--- .../src/oh_adapter/src/sqlite_store_executor_impl.cpp | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/executor/document/check_common.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/executor/document/check_common.cpp index 8b179159..e4af38a1 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/executor/document/check_common.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/executor/document/check_common.cpp @@ -109,10 +109,10 @@ int CheckCommon::CheckFilter(JsonObject &filterObj, std::vector> &filterPath, bool &isIdExist); - static int CheckIdFormat(JsonObject &data, bool &isIdExisit); + static int CheckFilter(JsonObject &filterObj, std::vector> &filterPath, bool &isIdExist); + static int CheckIdFormat(JsonObject &idObj, bool &isIdExisit); static int CheckDocument(JsonObject &document, bool &isIdExist); static int CheckUpdata(JsonObject &updataObj); static int CheckProjection(JsonObject &projectionObj, std::vector> &path); diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/result_set.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/result_set.cpp index dd28c026..d537dd0e 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/result_set.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/result_set.cpp @@ -14,8 +14,6 @@ */ #include "result_set.h" -#include - #include "db_constant.h" #include "document_key.h" #include "log_print.h" @@ -222,7 +220,7 @@ JsonObject CreatIdObj(const std::string &idStr, int errCode) return idObj; } -int InsertId(JsonObject &cjsonObj, std::string &jsonKey) +int InsertId(JsonObject &cjsonObj, const std::string &jsonKey) { if (jsonKey.empty()) { GLOGE("Genalral Id faild"); diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/sqlite_store_executor_impl.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/sqlite_store_executor_impl.cpp index 39f34788..6750b9b5 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/sqlite_store_executor_impl.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/sqlite_store_executor_impl.cpp @@ -226,7 +226,7 @@ std::string GeneralInsertSql(const std::string &collName, Key &key, int isIdExis } } -void AssignValueToData(std::string &keyStr, std::string &valueStr, std::pair &values, +void AssignValueToData(std::string &keyStr, const std::string &valueStr, std::pair &values, int &innerErrorCode, bool &isMatchOneData) { keyStr.pop_back(); // get id from really key. -- Gitee