Skip to content

Commit

Permalink
fix: fix pg13 compile
Browse files Browse the repository at this point in the history
  • Loading branch information
kysshsy committed Oct 9, 2024
1 parent 63cf73f commit 6b96f8c
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 @@ -136,6 +136,10 @@ pub fn execute_query<T: pgbox::WhoAllocated>(
#[cfg(feature = "pg17")]
let need_replan = !pg_sys::SearchPathMatchesCurrentEnvironment((*plan_source).search_path);

#[cfg(feature = "pg13")]
let cached_plan = pg_sys::GetCachedPlan(plan_source, null_mut(), false, null_mut());

#[cfg(not(feature = "pg13"))]
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 6b96f8c

Please sign in to comment.