From f81c1c220dd427b86206786cf64cf6b3b34e4beb Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Wed, 28 Mar 2007 17:17:12 +0000 Subject: row stamp checks for both 8.2 and 8.3 --- src/function.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'src/function.c') diff --git a/src/function.c b/src/function.c index dd4bd08..2467d8d 100644 --- a/src/function.c +++ b/src/function.c @@ -155,8 +155,7 @@ fn_new(FunctionCallInfo fcinfo, HeapTuple proc_tuple) f = palloc0(sizeof(*f)); f->ctx = f_ctx; f->oid = fcinfo->flinfo->fn_oid; - f->xmin = HeapTupleHeaderGetXmin(proc_tuple->t_data); - f->cmin = HeapTupleHeaderGetCmin(proc_tuple->t_data); + plproxy_set_stamp(&f->stamp, proc_tuple); MemoryContextSwitchTo(old_ctx); @@ -376,25 +375,11 @@ plproxy_compile(FunctionCallInfo fcinfo, bool validate) /* fn_extra not used, do lookup */ f = fn_cache_lookup(oid); - /* got, but is it still valid? */ - if (f) + /* if cached, is it still valid? */ + if (f && !plproxy_check_stamp(&f->stamp, proc_tuple)) { - bool drop = 0; - - if (f->xmin != HeapTupleHeaderGetXmin(proc_tuple->t_data)) - { - drop = 1; - } - else if (f->cmin == HeapTupleHeaderGetCmin(proc_tuple->t_data)) - { - drop = 1; - } - - if (drop) - { - fn_delete(f, true); - f = NULL; - } + fn_delete(f, true); + f = NULL; } if (!f) -- cgit v1.2.3