From c2cb36056aab6a9c73e521213cd8ba7ffd1027c0 Mon Sep 17 00:00:00 2001 From: lobty Date: Thu, 14 Mar 2024 09:53:58 +0800 Subject: [PATCH] codeCheck Signed-off-by: lobty --- .../storage/src/cloud/cloud_storage_utils.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/frameworks/libs/distributeddb/storage/src/cloud/cloud_storage_utils.cpp b/frameworks/libs/distributeddb/storage/src/cloud/cloud_storage_utils.cpp index f4a4f65d727..985d50a74e7 100644 --- a/frameworks/libs/distributeddb/storage/src/cloud/cloud_storage_utils.cpp +++ b/frameworks/libs/distributeddb/storage/src/cloud/cloud_storage_utils.cpp @@ -1142,38 +1142,34 @@ int CloudStorageUtils::BindStepConsistentFlagStmt(sqlite3_stmt *stmt, const VBuc std::string gidStr; int errCode = CloudStorageUtils::GetValueFromVBucket(CloudDbConstant::GID_FIELD, data, gidStr); if (errCode != E_OK || gidStr.empty()) { - LOGE("Get gid from bucket fail when mark flag as consistent, errCode = %d", errCode); + LOGE("Get gid fail when mark consistent, err:%d, isEmpty:%d", errCode, gidStr.empty()); return errCode; } - if (gidStr.empty()) { - LOGE("Get empty gid from bucket when mark flag as consistent."); - return -E_CLOUD_ERROR; - } // this data has not yet downloaded asset, skipping if (gidFilters.find(gidStr) != gidFilters.end()) { return E_OK; } errCode = SQLiteUtils::BindTextToStatement(stmt, 1, gidStr); // 1 is cloud_gid if (errCode != E_OK) { - LOGE("Bind cloud_gid to mark flag as consistent stmt failed, %d", errCode); + LOGE("Bind gid fail when mark consistent, err:%d", errCode); return errCode; } int64_t modifyTime; errCode = CloudStorageUtils::GetValueFromVBucket(CloudDbConstant::MODIFY_FIELD, data, modifyTime); if (errCode != E_OK) { - LOGE("Get modify time from bucket fail when mark flag as consistent, errCode = %d", errCode); + LOGE("Get modify time fail when mark consistent, err:%d", errCode); return errCode; } errCode = SQLiteUtils::BindInt64ToStatement(stmt, 2, modifyTime); // 2 is timestamp if (errCode != E_OK) { - LOGE("Bind modify time to mark flag as consistent stmt failed, %d", errCode); + LOGE("Failed to bind timestamp to consistent stmt, err:%d", errCode); return errCode; } errCode = SQLiteUtils::StepWithRetry(stmt); if (errCode == SQLiteUtils::MapSQLiteErrno(SQLITE_DONE)) { errCode = E_OK; } else { - LOGE("[Storage Executor]Step mark flag as consistent stmt failed, %d", errCode); + LOGE("Step consistent stmt failed, err:%d", errCode); } return errCode; } -- Gitee