Skip to content

Commit

Permalink
fix: pg17 function name change
Browse files Browse the repository at this point in the history
  • Loading branch information
kysshsy committed Oct 4, 2024
1 parent 4b7b32d commit d6e6d9a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hooks/utility/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,12 @@ pub fn execute_query<T: pgbox::WhoAllocated>(
}

// we need to make Duckdb replan the `PREPARE` statement when search path changed.
#[cfg(not(feature = "pg17"))]
let need_replan = !pg_sys::OverrideSearchPathMatchesCurrent((*plan_source).search_path);

#[cfg(feature = "pg17")]
let need_replan = !pg_sys::SearchPathMatchesCurrentEnvironment((*plan_source).search_path);

let cached_plan = pg_sys::GetCachedPlan(plan_source, null_mut(), null_mut(), null_mut());
if cached_plan.is_null() || (*cached_plan).stmt_list.is_null() {
return Ok(true);
Expand Down

0 comments on commit d6e6d9a

Please sign in to comment.