Re: [HACKERS] Plperl Safe version check fails for Safe 2.09

2004-11-24 Thread Andrew Dunstan
Tom Lane said: > Mark Kirkwood <[EMAIL PROTECTED]> writes: >> It seems that the check in src/pl/plperl/plperl.c >> eval_pv((safe_version < 2.09 ? safe_bad : safe_ok), FALSE); >> is not working quite as expected (CVS HEAD from today): > > Yah know, I looked at that on Monday and said to myself "Se

Re: [HACKERS] Plperl Safe version check fails for Safe 2.09

2004-11-23 Thread Tom Lane
Mark Kirkwood <[EMAIL PROTECTED]> writes: > It seems that the check in src/pl/plperl/plperl.c > eval_pv((safe_version < 2.09 ? safe_bad : safe_ok), FALSE); > is not working quite as expected (CVS HEAD from today): Yah know, I looked at that on Monday and said to myself "Self, that looks like a r

Re: [HACKERS] Plperl Safe version check fails for Safe 2.09

2004-11-23 Thread Mark Kirkwood
A bit more thinking led me to try: float safe_version; ... eval_pv((safe_version < (float)2.09 ? safe_bad : safe_ok), FALSE); which seems to fix the issue. (after all float *should* be accurate enough in this case) cheers Mark P.s : trivial patch attached Andrew Dunstan wrote: Could b

Re: [HACKERS] Plperl Safe version check fails for Safe 2.09

2004-11-23 Thread Andrew Dunstan
Could be a rounding issue. What happens if you try this instead:? eval_pv((safe_version <= 2.08 ? safe_bad : safe_ok), FALSE); Alternatively, what happens if we make safe_version a double rather than a float? (If nothing else works we might have to fall back on a lexical comparison) cheers andr

[HACKERS] Plperl Safe version check fails for Safe 2.09

2004-11-23 Thread Mark Kirkwood
It seems that the check in src/pl/plperl/plperl.c eval_pv((safe_version < 2.09 ? safe_bad : safe_ok), FALSE); is not working quite as expected (CVS HEAD from today): I have Safe.pm at version 2.09, yet any plperl function I run fails with : ERROR: error from function: trusted perl functions disab