From 4ce1ca4f3c8c41b30ed19200977403b87c38e7d3 Mon Sep 17 00:00:00 2001 From: mazhao Date: Mon, 10 Jul 2023 09:58:28 +0800 Subject: [PATCH 1/3] merge Format fix for ddb Signed-off-by: mazhao --- .../service/data_share/gaussdb_rd/BUILD.gn | 7 ++-- .../gaussdb_rd/src/common/src/json_common.cpp | 5 ++- .../src/executor/document/check_common.h | 2 +- .../src/interface/include/result_set.h | 1 + .../src/interface/src/collection.cpp | 2 - .../src/interface/src/document_key.cpp | 2 - .../src/oh_adapter/include/json_object.h | 2 +- .../src/oh_adapter/src/json_object.cpp | 25 +++++++++---- .../gaussdb_rd/test/unittest/BUILD.gn | 13 ++++--- .../unittest/api/documentdb_data_test.cpp | 21 +---------- .../unittest/api/documentdb_find_test.cpp | 37 ++----------------- .../unittest/api/documentdb_insert_test.cpp | 2 +- .../documentdb_json_common_test.cpp | 1 - 13 files changed, 40 insertions(+), 80 deletions(-) mode change 100644 => 100755 services/distributeddataservice/service/data_share/gaussdb_rd/BUILD.gn diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/BUILD.gn b/services/distributeddataservice/service/data_share/gaussdb_rd/BUILD.gn old mode 100644 new mode 100755 index 47128f8c..3f44a373 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/BUILD.gn +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/BUILD.gn @@ -59,6 +59,7 @@ ohos_shared_library("gaussdb_rd") { "src/executor/document/grd_resultset_api.cpp", "src/interface/src/collection.cpp", "src/interface/src/doc_errno.cpp", + "src/interface/src/document_key.cpp", "src/interface/src/document_store.cpp", "src/interface/src/document_store_manager.cpp", "src/interface/src/projection_tree.cpp", @@ -82,9 +83,9 @@ ohos_shared_library("gaussdb_rd") { external_deps = [ "c_utils:utils", - "hisysevent_native:libhisysevent", - "hitrace_native:hitrace_meter", - "hiviewdfx_hilog_native:libhilog", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", ] subsystem_name = "distributeddatamgr" diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/common/src/json_common.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/common/src/json_common.cpp index 357c0052..a967d2e6 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/common/src/json_common.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/common/src/json_common.cpp @@ -541,7 +541,8 @@ int JsonCommon::Append(const JsonObject &src, const JsonObject &add, bool isRepl { int externErrCode = E_OK; JsonObjectIterator(add, {}, - [&src, &externErrCode, &isReplace](const JsonFieldPath &path, const JsonObject &father, const JsonObject &item) { + [&src, &externErrCode, &isReplace](const JsonFieldPath &path, + const JsonObject &father, const JsonObject &item) { bool isCollapse = false; // Whether there is a path generated by the dot operator, such as t1.t2.t3 JsonFieldPath itemPath = ExpendPathForField(path, isCollapse); if (src.IsFieldExists(itemPath)) { @@ -663,7 +664,7 @@ bool JsonCommon::JsonEqualJudge(const JsonFieldPath &itemPath, const JsonObject } return false; } - int isAlreadyMatched = 0; // means no match anyting + int isAlreadyMatched = 0; // means no match anything return IsObjectItemMatch(srcItem, item, isAlreadyMatched, isCollapse, isMatchFlag); } 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 d38ed984..3ace4198 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 @@ -32,7 +32,7 @@ public: static int CheckFilter(JsonObject &document, std::vector> &filterPath, bool &isIdExist); static int CheckIdFormat(JsonObject &data, bool &isIdExisit); static int CheckDocument(JsonObject &document, bool &isIdExist); - static int CheckUpdata(JsonObject &updata); + static int CheckUpdata(JsonObject &updataObj); static int CheckProjection(JsonObject &projectionObj, std::vector> &path); }; using Key = std::vector; diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/include/result_set.h b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/include/result_set.h index 8c015533..01c42c63 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/include/result_set.h +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/include/result_set.h @@ -16,6 +16,7 @@ #ifndef RESULTSET_H #define RESULTSET_H +#include #include #include diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/collection.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/collection.cpp index 6f852abe..d06b0943 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/collection.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/collection.cpp @@ -22,8 +22,6 @@ #include "log_print.h" namespace DocumentDB { -constexpr int JSON_LENS_MAX = 1024 * 1024; - Collection::Collection(const std::string &name, KvStoreExecutor *executor) : executor_(executor) { std::string lowerCaseName = name; diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/document_key.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/document_key.cpp index 4d676a49..a6493205 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/document_key.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/document_key.cpp @@ -18,7 +18,6 @@ #include "log_print.h" #include "securec.h" namespace DocumentDB { - static uint16_t g_oIdIncNum = 0; constexpr uint16_t MAX_NUMBER_OF_AUTOINCREMENTS = 65535; constexpr uint16_t UINT_ZERO = 0; @@ -49,5 +48,4 @@ int DocumentKey::GetOidDocKey(DocKey &key) int ret = InitDocIdFromOid(key); return ret; } - } // namespace DocumentDB \ No newline at end of file diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/include/json_object.h b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/include/json_object.h index c3d7a612..0e4276f2 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/include/json_object.h +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/include/json_object.h @@ -104,7 +104,7 @@ private: int CheckJsonRepeatField(cJSON *object, bool isFirstFloor); int CheckSubObj(std::set &fieldSet, cJSON *subObj, int parentType, bool isFirstFloor); int GetDeep(cJSON *cjson); - int CheckNumber(cJSON *cjson, int &errCode); + void CheckNumber(cJSON *cjson, int &errCode); cJSON *cjson_ = nullptr; int jsonDeep_ = 0; bool isOwner_ = false; diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/json_object.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/json_object.cpp index db21c450..9502daf9 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/json_object.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/json_object.cpp @@ -145,14 +145,18 @@ int JsonObject::GetDeep(cJSON *cjson) return depth; } -int JsonObject::CheckNumber(cJSON *item, int &errCode) +void JsonObject::CheckNumber(cJSON *item, int &errCode) { std::queue cjsonQueue; cjsonQueue.push(item); while (!cjsonQueue.empty()) { cJSON *node = cjsonQueue.front(); cjsonQueue.pop(); - if (node != NULL && cJSON_IsNumber(node)) { + if (node == nullptr) { + errCode = -E_INVALID_ARGS; + break; + } + if (cJSON_IsNumber(node)) { // node is not null all the time double value = cJSON_GetNumberValue(node); if (value > __DBL_MAX__ || value < -__DBL_MAX__) { errCode = -E_INVALID_ARGS; @@ -165,7 +169,6 @@ int JsonObject::CheckNumber(cJSON *item, int &errCode) cjsonQueue.push(node->next); } } - return E_OK; } int JsonObject::Init(const std::string &str, bool isFilter) @@ -221,6 +224,16 @@ int JsonObject::CheckJsonRepeatField(cJSON *object, bool isFirstFloor) return ret; } +bool IsFieldNameLegal(const std::string &fieldName) +{ + for (auto oneChar : fieldName) { + if (!((isalpha(oneChar)) || (isdigit(oneChar)) || (oneChar == '_'))) { + return false; + } + } + return true; +} + int JsonObject::CheckSubObj(std::set &fieldSet, cJSON *subObj, int parentType, bool isFirstFloor) { if (subObj == nullptr) { @@ -230,10 +243,8 @@ int JsonObject::CheckSubObj(std::set &fieldSet, cJSON *subObj, int if (subObj->string != nullptr) { fieldName = subObj->string; if (!isFirstFloor) { - for (auto oneChar : fieldName) { - if (!((isalpha(oneChar)) || (isdigit(oneChar)) || (oneChar == '_'))) { - return -E_INVALID_ARGS; - } + if (!IsFieldNameLegal(fieldName)) { + return -E_INVALID_ARGS; } } if (!fieldName.empty() && isdigit(fieldName[0])) { diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/BUILD.gn b/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/BUILD.gn index b4cc59a3..c8a7cab5 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/BUILD.gn +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/BUILD.gn @@ -57,6 +57,7 @@ ohos_source_set("src_file") { "../../src/executor/document/grd_resultset_api.cpp", "../../src/interface/src/collection.cpp", "../../src/interface/src/doc_errno.cpp", + "../../src/interface/src/document_key.cpp", "../../src/interface/src/document_store.cpp", "../../src/interface/src/document_store_manager.cpp", "../../src/interface/src/projection_tree.cpp", @@ -81,9 +82,9 @@ ohos_source_set("src_file") { deps += [ "//third_party/cJSON:cjson" ] external_deps = [ "c_utils:utils", - "hisysevent_native:libhisysevent", - "hitrace_native:hitrace_meter", - "hiviewdfx_hilog_native:libhilog", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", ] subsystem_name = "distributeddatamgr" @@ -115,9 +116,9 @@ template("gaussdb_rd_unittest") { ] external_deps = [ "c_utils:utils", - "hisysevent_native:libhisysevent", - "hitrace_native:hitrace_meter", - "hiviewdfx_hilog_native:libhilog", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", ] } } diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/api/documentdb_data_test.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/api/documentdb_data_test.cpp index 781bbb2b..129ea35b 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/api/documentdb_data_test.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/api/documentdb_data_test.cpp @@ -133,8 +133,7 @@ HWTEST_F(DocumentDBDataTest, UpsertDataTest006, TestSize.Level0) { std::string filter = R""({"_id":"1234"})""; std::string document = R""({"name":"Tmono","age":18,"addr":{"city":"shanghai","postal":200001}})""; - - for (auto flags : std::vector{ 2, 4, 8, 64, 1024, UINT32_MAX }) { + for (auto flags : std::vector { 2, 4, 8, 64, 1024, UINT32_MAX }) { EXPECT_EQ(GRD_UpsertDoc(g_db, g_coll, filter.c_str(), document.c_str(), flags), GRD_INVALID_ARGS); } } @@ -274,24 +273,6 @@ HWTEST_F(DocumentDBDataTest, UpdateDataTest003, TestSize.Level0) } } -/** - * @tc.name: UpdateDataTest004 - * @tc.desc: Test update data with invalid filter - * @tc.type: FUNC - * @tc.require: - * @tc.author: lianhuix - */ -HWTEST_F(DocumentDBDataTest, UpdateDataTest004, TestSize.Level0) {} - -/** - * @tc.name: UpdateDataTest005 - * @tc.desc: Test update data with invalid doc - * @tc.type: FUNC - * @tc.require: - * @tc.author: lianhuix - */ -HWTEST_F(DocumentDBDataTest, UpdateDataTest005, TestSize.Level0) {} - /** * @tc.name: UpdateDataTest006 * @tc.desc: Test update data with invalid flag diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/api/documentdb_find_test.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/api/documentdb_find_test.cpp index ea1586be..654294a3 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/api/documentdb_find_test.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/api/documentdb_find_test.cpp @@ -1467,46 +1467,15 @@ HWTEST_F(DocumentDBFindTest, DocumentDBFindTest062, TestSize.Level1) } HWTEST_F(DocumentDBFindTest, DocumentDBFindTest063, TestSize.Level1) -{ - const char *document = "{\"a\":1, \"doc64\" : 2}"; - const char *filter1 = "{\"b\":1}"; - EXPECT_EQ(GRD_UpsertDoc(g_db, COLLECTION_NAME, filter1, document, 0), 1); - EXPECT_EQ(GRD_UpsertDoc(g_db, COLLECTION_NAME, filter1, document, 0), 1); - EXPECT_EQ(GRD_UpsertDoc(g_db, COLLECTION_NAME, filter1, document, 0), 1); - EXPECT_EQ(GRD_UpsertDoc(g_db, COLLECTION_NAME, filter1, document, 0), 1); - EXPECT_EQ(GRD_UpsertDoc(g_db, COLLECTION_NAME, filter1, document, 0), 1); - EXPECT_EQ(GRD_UpsertDoc(g_db, COLLECTION_NAME, filter1, document, 0), 1); - EXPECT_EQ(GRD_UpsertDoc(g_db, COLLECTION_NAME, filter1, document, 0), 1); - EXPECT_EQ(GRD_UpsertDoc(g_db, COLLECTION_NAME, filter1, document, 0), 1); - const char *filter = "{\"a\":1}"; - GRD_ResultSet *resultSet = nullptr; - const char *projection = R"({})"; - Query query = { filter, projection }; - EXPECT_EQ(GRD_FindDoc(g_db, COLLECTION_NAME, query, 1, &resultSet), GRD_OK); - EXPECT_EQ(GRD_Next(resultSet), GRD_OK); - EXPECT_EQ(GRD_Next(resultSet), GRD_OK); - EXPECT_EQ(GRD_Next(resultSet), GRD_OK); - EXPECT_EQ(GRD_Next(resultSet), GRD_OK); - EXPECT_EQ(GRD_Next(resultSet), GRD_OK); - EXPECT_EQ(GRD_Next(resultSet), GRD_OK); - EXPECT_EQ(GRD_Next(resultSet), GRD_OK); - EXPECT_EQ(GRD_Next(resultSet), GRD_OK); - EXPECT_EQ(GRD_Next(resultSet), GRD_NO_DATA); - EXPECT_EQ(GRD_FreeResultSet(resultSet), GRD_OK); -} - -HWTEST_F(DocumentDBFindTest, DocumentDBFindTest064, TestSize.Level1) { GRD_DB *test_db = nullptr; std::string path = "./dataShare.db"; int status = GRD_DBOpen(path.c_str(), nullptr, GRD_DB_OPEN_CREATE, &test_db); EXPECT_EQ(status, GRD_OK); EXPECT_EQ(GRD_CreateCollection(test_db, colName, "", 0), GRD_OK); - - string document1 = "{\"_id\":\"key2_11_com.acts.ohos.data.datasharetestclient_100\"\ - ,\"bundleName\":\"com.acts.ohos.data.datasharetestclient\"\ - ,\"key\":\"key2\",\"subscriberId\":11,\"timestamp\":1509100700," - "\"userId\":100,\"value\":{\"type\":0,"; + string document1 = "{\"_id\":\"key2_11_com.acts.ohos.data.datasharetestclient_100\",\ + \"bundleName\":\"com.acts.ohos.data.datasharetestclient\",\"key\":\"key2\",\ + \"subscriberId\":11,\"timestamp\":1509100700,""\"userId\":100,\"value\":{\"type\":0,"; string document2 = "\"value\":["; string document3 = "5,"; string document4 = document3; diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/api/documentdb_insert_test.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/api/documentdb_insert_test.cpp index 385470b2..8e862bb6 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/api/documentdb_insert_test.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/api/documentdb_insert_test.cpp @@ -829,7 +829,7 @@ HWTEST_F(DocumentDBInsertTest, DocumentDBInsertTest046, TestSize.Level1) HWTEST_F(DocumentDBInsertTest, DocumentDBInsertTest047, TestSize.Level1) { - const char *document1 = R""({"empty" : null})""; + const char *document1 = "{\"empty\" : null}"; EXPECT_EQ(GRD_InsertDoc(g_db, RIGHT_COLLECTION_NAME, document1, 0), GRD_OK); } } // namespace diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/oh_adapter/documentdb_json_common_test.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/oh_adapter/documentdb_json_common_test.cpp index c065640b..ff4820e9 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/oh_adapter/documentdb_json_common_test.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/test/unittest/oh_adapter/documentdb_json_common_test.cpp @@ -590,5 +590,4 @@ HWTEST_F(DocumentDBJsonCommonTest, JsonObjectisFilterCheckTest023, TestSize.Leve EXPECT_EQ(JsonCommon::IsJsonNodeMatch(srcObj1, filterObj1, errCode), true); EXPECT_EQ(JsonCommon::IsJsonNodeMatch(srcObj2, filterObj1, errCode), false); } - } // namespace \ No newline at end of file -- Gitee From a99c188bc5445594d94cbb2418cfe21f1dc21be8 Mon Sep 17 00:00:00 2001 From: mazhao Date: Mon, 10 Jul 2023 15:37:14 +0800 Subject: [PATCH 2/3] merge Format fix for ddb Signed-off-by: mazhao --- .../gaussdb_rd/src/oh_adapter/include/json_object.h | 2 +- .../gaussdb_rd/src/oh_adapter/src/json_object.cpp | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/include/json_object.h b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/include/json_object.h index 0e4276f2..bd1cba71 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/include/json_object.h +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/include/json_object.h @@ -104,7 +104,7 @@ private: int CheckJsonRepeatField(cJSON *object, bool isFirstFloor); int CheckSubObj(std::set &fieldSet, cJSON *subObj, int parentType, bool isFirstFloor); int GetDeep(cJSON *cjson); - void CheckNumber(cJSON *cjson, int &errCode); + int CheckNumber(cJSON *cJSON); cJSON *cjson_ = nullptr; int jsonDeep_ = 0; bool isOwner_ = false; diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/json_object.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/json_object.cpp index 9502daf9..26c50fd8 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/json_object.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/json_object.cpp @@ -145,7 +145,7 @@ int JsonObject::GetDeep(cJSON *cjson) return depth; } -void JsonObject::CheckNumber(cJSON *item, int &errCode) +int JsonObject::CheckNumber(cJSON *item) { std::queue cjsonQueue; cjsonQueue.push(item); @@ -153,13 +153,12 @@ void JsonObject::CheckNumber(cJSON *item, int &errCode) cJSON *node = cjsonQueue.front(); cjsonQueue.pop(); if (node == nullptr) { - errCode = -E_INVALID_ARGS; - break; + return -E_INVALID_ARGS; } if (cJSON_IsNumber(node)) { // node is not null all the time double value = cJSON_GetNumberValue(node); if (value > __DBL_MAX__ || value < -__DBL_MAX__) { - errCode = -E_INVALID_ARGS; + return -E_INVALID_ARGS; } } if (node->child != nullptr) { @@ -169,6 +168,7 @@ void JsonObject::CheckNumber(cJSON *item, int &errCode) cjsonQueue.push(node->next); } } + return E_OK; } int JsonObject::Init(const std::string &str, bool isFilter) @@ -186,8 +186,7 @@ int JsonObject::Init(const std::string &str, bool isFilter) return -E_INVALID_ARGS; } - int ret = 0; - CheckNumber(cjson_, ret); + int ret = CheckNumber(cjson_); if (ret == -E_INVALID_ARGS) { GLOGE("Int value is larger than double"); return -E_INVALID_ARGS; -- Gitee From 54199055613b5a8a0fb2cc7c8aeaf1a875d8f792 Mon Sep 17 00:00:00 2001 From: mazhao Date: Mon, 10 Jul 2023 16:31:45 +0800 Subject: [PATCH 3/3] merge Format fix for ddb Signed-off-by: mazhao --- .../data_share/gaussdb_rd/src/oh_adapter/src/sqlite_utils.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/sqlite_utils.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/sqlite_utils.cpp index d5e3d961..2c56227d 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/sqlite_utils.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/oh_adapter/src/sqlite_utils.cpp @@ -162,10 +162,6 @@ int SQLiteUtils::BindBlobToStatement(sqlite3_stmt *statement, int index, const s errCode = sqlite3_bind_blob(statement, index, static_cast(value.data()), value.size(), SQLITE_TRANSIENT); } - - if (errCode != SQLITE_OK) { - GLOGE("[SQLiteUtil][Bind blob] Failed to bind the value:%d", errCode); - } return errCode; } -- Gitee