From dcc8a7989c0d4eeb300b50b3e59b148bd94851b7 Mon Sep 17 00:00:00 2001 From: rayrphuang Date: Tue, 18 Jul 2023 14:58:19 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E4=BF=AE=E5=A4=8Dfuture=5Fexecute()?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=97=B6=EF=BC=8CExecutionResponse.spaceName?= =?UTF-8?q?=20=3D=3D=20nullptr=EF=BC=8C=E7=9B=B4=E6=8E=A5=E8=A7=A3?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E5=AF=BC=E8=87=B4=E7=9A=84coredump=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/SessionPool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/SessionPool.cpp b/src/client/SessionPool.cpp index 43655a9c..478475c1 100644 --- a/src/client/SessionPool.cpp +++ b/src/client/SessionPool.cpp @@ -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_); } @@ -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_); }