From ba85d69666bab2626166a773467346abfbb6f435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 20 Oct 2024 18:10:41 +0200 Subject: [PATCH] Harmonize rapi_execute() --- src/statement.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/statement.cpp b/src/statement.cpp index 75a92bb63..bec1dfd14 100644 --- a/src/statement.cpp +++ b/src/statement.cpp @@ -342,15 +342,16 @@ bool FetchArrowChunk(ChunkScanState &scan_state, ClientProperties options, Appen auto generic_result = stmt->stmt->Execute(stmt->parameters, false); - if (generic_result->HasError()) { - if (signal_handler.HandleInterrupt()) { - return R_NilValue; - } - cpp11::stop("rapi_execute: Failed to run query\nError: %s", generic_result->GetError().c_str()); + if (signal_handler.HandleInterrupt()) { + return R_NilValue; } signal_handler.Disable(); + if (generic_result->HasError()) { + cpp11::stop("rapi_execute: Failed to run query\nError: %s", generic_result->GetError().c_str()); + } + if (arrow) { auto query_result = new RQueryResult(); query_result->result = std::move(generic_result);