@@ -385,8 +385,7 @@ void HttpServer::DoHandleRun(const httplib::Request &req,
385385 // If there's more than one statement, run all but the last.
386386 if (statement_count > 1 ) {
387387 for (auto i = 0 ; i < statement_count - 1 ; ++i) {
388- auto &statement = statements[i];
389- auto pending = connection->PendingQuery (std::move (statement));
388+ auto pending = connection->PendingQuery (std::move (statements[i]));
390389 // Return any error found before execution.
391390 if (pending->HasError ()) {
392391 SetResponseErrorResult (res, pending->GetError ());
@@ -412,7 +411,9 @@ void HttpServer::DoHandleRun(const httplib::Request &req,
412411 pending->Execute ();
413412 break ;
414413 default :
415- SetResponseErrorResult (res, " Unexpected PendingExecutionResult" );
414+ SetResponseErrorResult (
415+ res, StringUtil::Format (" Unexpected PendingExecutionResult: %d" ,
416+ exec_result));
416417 return ;
417418 }
418419 }
@@ -488,7 +489,9 @@ void HttpServer::DoHandleRun(const httplib::Request &req,
488489 break ;
489490 }
490491 default :
491- SetResponseErrorResult (res, " Unexpected PendingExecutionResult" );
492+ SetResponseErrorResult (
493+ res, StringUtil::Format (" Unexpected PendingExecutionResult: %d" ,
494+ exec_result));
492495 break ;
493496 }
494497}
0 commit comments