forked from huawei/mindspore2022
!20492 fix: code review check
Merge pull request !20492 from guozhijian/fix_code_review_check
This commit is contained in:
commit
36820f38dc
|
|
@ -540,6 +540,7 @@ MSRStatus ShardIndexGenerator::ExecuteTransaction(const int &shard_no, std::pair
|
||||||
in.open(realpath.value(), std::ios::in | std::ios::binary);
|
in.open(realpath.value(), std::ios::in | std::ios::binary);
|
||||||
if (!in.good()) {
|
if (!in.good()) {
|
||||||
MS_LOG(ERROR) << "Invalid file, failed to open file: " << shard_address;
|
MS_LOG(ERROR) << "Invalid file, failed to open file: " << shard_address;
|
||||||
|
in.close();
|
||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
(void)sqlite3_exec(db.second, "BEGIN TRANSACTION;", nullptr, nullptr, nullptr);
|
(void)sqlite3_exec(db.second, "BEGIN TRANSACTION;", nullptr, nullptr, nullptr);
|
||||||
|
|
|
||||||
|
|
@ -423,6 +423,8 @@ MSRStatus ShardReader::ReadAllRowsInShard(int shard_id, const std::string &sql,
|
||||||
auto realpath = Common::GetRealPath(file_name);
|
auto realpath = Common::GetRealPath(file_name);
|
||||||
if (!realpath.has_value()) {
|
if (!realpath.has_value()) {
|
||||||
MS_LOG(ERROR) << "Get real path failed, path=" << file_name;
|
MS_LOG(ERROR) << "Get real path failed, path=" << file_name;
|
||||||
|
sqlite3_free(errmsg);
|
||||||
|
sqlite3_close(db);
|
||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -431,6 +433,8 @@ MSRStatus ShardReader::ReadAllRowsInShard(int shard_id, const std::string &sql,
|
||||||
fs->open(realpath.value(), std::ios::in | std::ios::binary);
|
fs->open(realpath.value(), std::ios::in | std::ios::binary);
|
||||||
if (!fs->good()) {
|
if (!fs->good()) {
|
||||||
MS_LOG(ERROR) << "Invalid file, failed to open file: " << file_name;
|
MS_LOG(ERROR) << "Invalid file, failed to open file: " << file_name;
|
||||||
|
sqlite3_free(errmsg);
|
||||||
|
sqlite3_close(db);
|
||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue