diff options
| author | Marko Kreen | 2007-03-28 17:17:12 +0000 |
|---|---|---|
| committer | Marko Kreen | 2007-03-28 17:17:12 +0000 |
| commit | f81c1c220dd427b86206786cf64cf6b3b34e4beb (patch) | |
| tree | 033057444a53aae25c12167c4b924ee2c10886c1 /src/function.c | |
| parent | b1de258fdf8519b6f64a353a5a21df4487ce23be (diff) | |
row stamp checks for both 8.2 and 8.3
Diffstat (limited to 'src/function.c')
| -rw-r--r-- | src/function.c | 25 |
1 files changed, 5 insertions, 20 deletions
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) |
