Skip to content

Commit

Permalink
Clear cached parameters on error before re-caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzmbrzl committed Dec 31, 2024
1 parent 8886fc8 commit 9629066
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,12 @@ statement_impl::rethrow_current_exception_with_context(char const* operation)

if (!uses_.empty() && session_.get_query_context_logging_mode() != log_context::never)
{
// We have to clear previously cached query parameters as different backends behave differently
// in whether they error before or after the caching has happened. Therefore, we can't rely on
// the parameters to be or to not be cached at the point of error in a cross-backend way (that
// works for all kinds of errors).
session_.clear_query_parameters();

std::size_t const usize = uses_.size();
for (std::size_t i = 0; i != usize; ++i)
{
Expand Down

0 comments on commit 9629066

Please sign in to comment.