|
33 | 33 | * ENHANCEMENTS, OR MODIFICATIONS. |
34 | 34 | * |
35 | 35 | * IDENTIFICATION |
36 | | - * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.63 2004/11/23 00:21:17 tgl Exp $ |
| 36 | + * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.64 2004/11/24 18:47:38 tgl Exp $ |
37 | 37 | * |
38 | 38 | **********************************************************************/ |
39 | 39 |
|
@@ -238,13 +238,18 @@ plperl_safe_init(void) |
238 | 238 | ; |
239 | 239 |
|
240 | 240 | SV*res; |
241 | | -floatsafe_version; |
| 241 | +doublesafe_version; |
242 | 242 |
|
243 | 243 | res=eval_pv(safe_module, FALSE);/* TRUE = croak if failure */ |
244 | 244 |
|
245 | 245 | safe_version=SvNV(res); |
246 | 246 |
|
247 | | -eval_pv((safe_version<2.09 ?safe_bad :safe_ok), FALSE); |
| 247 | +/* |
| 248 | + * We actually want to reject safe_version < 2.09, but it's risky to |
| 249 | + * assume that floating-point comparisons are exact, so use a slightly |
| 250 | + * smaller comparison value. |
| 251 | + */ |
| 252 | +eval_pv((safe_version<2.0899 ?safe_bad :safe_ok), FALSE); |
248 | 253 |
|
249 | 254 | plperl_safe_init_done= true; |
250 | 255 | } |
|