From d6399e7792a2ca1a5534559d34a9abfcb230354c Mon Sep 17 00:00:00 2001 From: Tishj Date: Wed, 17 Apr 2024 13:03:24 +0200 Subject: [PATCH] always create a Copy of a SQLStatement when ALTERNATIVE_VERIFY is set --- src/main/client_context.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/client_context.cpp b/src/main/client_context.cpp index c3aa1917a66e..cd517fc91f78 100644 --- a/src/main/client_context.cpp +++ b/src/main/client_context.cpp @@ -762,6 +762,11 @@ void ClientContext::SetActiveResult(ClientContextLock &lock, BaseQueryResult &re unique_ptr ClientContext::PendingStatementOrPreparedStatementInternal( ClientContextLock &lock, const string &query, unique_ptr statement, shared_ptr &prepared, const PendingQueryParameters ¶meters) { +#ifdef DUCKDB_ALTERNATIVE_VERIFY + if (statement && statement->type != StatementType::LOGICAL_PLAN_STATEMENT) { + statement = statement->Copy(); + } +#endif // check if we are on AutoCommit. In this case we should start a transaction. if (statement && config.AnyVerification()) { // query verification is enabled