Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mark called_as_trigger as unsafe #223

Merged
merged 1 commit into from
Sep 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions pgx/src/trigger_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use crate::{is_a, pg_sys};

#[inline]
pub fn called_as_trigger(fcinfo: pg_sys::FunctionCallInfo) -> bool {
let fcinfo = unsafe { fcinfo.as_ref() }.expect("fcinfo was null");
!fcinfo.context.is_null() && unsafe { is_a(fcinfo.context, pg_sys::NodeTag_T_TriggerData) }
pub unsafe fn called_as_trigger(fcinfo: pg_sys::FunctionCallInfo) -> bool {
let fcinfo = fcinfo.as_ref().expect("fcinfo was null");
!fcinfo.context.is_null() && is_a(fcinfo.context, pg_sys::NodeTag_T_TriggerData)
}

#[inline]
Expand Down