minor tweaks

This commit is contained in:
Jeff Raymakers
2025-06-03 09:04:39 -07:00
parent 6145a1b4a9
commit c7d73dcb8d

View File

@@ -385,8 +385,7 @@ void HttpServer::DoHandleRun(const httplib::Request &req,
// If there's more than one statement, run all but the last.
if (statement_count > 1) {
for (auto i = 0; i < statement_count - 1; ++i) {
auto &statement = statements[i];
auto pending = connection->PendingQuery(std::move(statement));
auto pending = connection->PendingQuery(std::move(statements[i]));
// Return any error found before execution.
if (pending->HasError()) {
SetResponseErrorResult(res, pending->GetError());
@@ -412,7 +411,9 @@ void HttpServer::DoHandleRun(const httplib::Request &req,
pending->Execute();
break;
default:
SetResponseErrorResult(res, "Unexpected PendingExecutionResult");
SetResponseErrorResult(
res, StringUtil::Format("Unexpected PendingExecutionResult: %d",
exec_result));
return;
}
}
@@ -488,7 +489,9 @@ void HttpServer::DoHandleRun(const httplib::Request &req,
break;
}
default:
SetResponseErrorResult(res, "Unexpected PendingExecutionResult");
SetResponseErrorResult(
res, StringUtil::Format("Unexpected PendingExecutionResult: %d",
exec_result));
break;
}
}