Skip to content

Commit

Permalink
bugfix: 修复future_execute()错误时,ExecutionResponse.spaceName == nullptr,…
Browse files Browse the repository at this point in the history
…直接解引用导致的coredump问题
  • Loading branch information
rayhuang90 committed Jul 18, 2023
1 parent 4fd300b commit dcc8a79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/SessionPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ExecutionResponse SessionPool::execute(const std::string &stmt) {
auto result = getIdleSession();
if (result.second) {
auto resp = result.first.execute(stmt);
if (*resp.spaceName != config_.spaceName_) {
if (resp.spaceName != nullptr && *resp.spaceName != config_.spaceName_) {
// switch to origin space
result.first.execute("USE " + config_.spaceName_);
}
Expand All @@ -62,7 +62,7 @@ ExecutionResponse SessionPool::executeWithParameter(
auto result = getIdleSession();
if (result.second) {
auto resp = result.first.executeWithParameter(stmt, parameters);
if (*resp.spaceName != config_.spaceName_) {
if (resp.spaceName != nullptr && *resp.spaceName != config_.spaceName_) {
// switch to origin space
result.first.execute("USE " + config_.spaceName_);
}
Expand Down

0 comments on commit dcc8a79

Please sign in to comment.