|
12 | 12 | * |
13 | 13 | * |
14 | 14 | * IDENTIFICATION |
15 | | - * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.29 1999/05/31 19:32:47 tgl Exp $ |
| 15 | + * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.30 1999/06/19 00:44:44 tgl Exp $ |
16 | 16 | * |
17 | 17 | *------------------------------------------------------------------------- |
18 | 18 | */ |
@@ -414,17 +414,29 @@ btreesel(Oid operatorObjectId, |
414 | 414 | * don't want to miss the benefits of a good selectivity estimate.) |
415 | 415 | */ |
416 | 416 | if (!oprrest) |
| 417 | +{ |
| 418 | +#if1 |
| 419 | +/* |
| 420 | + * XXX temporary fix for 6.5: rtree operators are missing their |
| 421 | + * selectivity estimators, so return a default estimate instead. |
| 422 | + * Ugh. |
| 423 | + */ |
| 424 | +result= (float64)palloc(sizeof(float64data)); |
| 425 | +*result=0.5; |
| 426 | +#else |
417 | 427 | elog(ERROR, |
418 | | -"Operator %u must have a restriction selectivity estimator to be used ina btree index", |
| 428 | +"Operator %u must have a restriction selectivity estimator to be used inan index", |
419 | 429 | operatorObjectId); |
420 | | - |
421 | | -result= (float64)fmgr(oprrest, |
422 | | -(char*)operatorObjectId, |
423 | | -(char*)indrelid, |
424 | | -(char*) (int)attributeNumber, |
425 | | -(char*)constValue, |
426 | | -(char*)constFlag, |
427 | | -NULL); |
| 430 | +#endif |
| 431 | +} |
| 432 | +else |
| 433 | +result= (float64)fmgr(oprrest, |
| 434 | +(char*)operatorObjectId, |
| 435 | +(char*)indrelid, |
| 436 | +(char*) (int)attributeNumber, |
| 437 | +(char*)constValue, |
| 438 | +(char*)constFlag, |
| 439 | +NULL); |
428 | 440 | } |
429 | 441 |
|
430 | 442 | if (!PointerIsValid(result)) |
@@ -473,18 +485,31 @@ btreenpage(Oid operatorObjectId, |
473 | 485 | * don't want to miss the benefits of a good selectivity estimate.) |
474 | 486 | */ |
475 | 487 | if (!oprrest) |
| 488 | +{ |
| 489 | +#if1 |
| 490 | +/* |
| 491 | + * XXX temporary fix for 6.5: rtree operators are missing their |
| 492 | + * selectivity estimators, so return a default estimate instead. |
| 493 | + * Ugh. |
| 494 | + */ |
| 495 | +tempData=0.5; |
| 496 | +temp=&tempData; |
| 497 | +#else |
476 | 498 | elog(ERROR, |
477 | | -"Operator %u must have a restriction selectivity estimator to be used ina btree index", |
| 499 | +"Operator %u must have a restriction selectivity estimator to be used inan index", |
478 | 500 | operatorObjectId); |
479 | | - |
480 | | -temp= (float64)fmgr(oprrest, |
481 | | - (char*)operatorObjectId, |
482 | | - (char*)indrelid, |
483 | | - (char*) (int)attributeNumber, |
484 | | - (char*)constValue, |
485 | | - (char*)constFlag, |
486 | | -NULL); |
| 501 | +#endif |
| 502 | +} |
| 503 | +else |
| 504 | +temp= (float64)fmgr(oprrest, |
| 505 | + (char*)operatorObjectId, |
| 506 | + (char*)indrelid, |
| 507 | + (char*) (int)attributeNumber, |
| 508 | + (char*)constValue, |
| 509 | + (char*)constFlag, |
| 510 | +NULL); |
487 | 511 | } |
| 512 | + |
488 | 513 | atp=SearchSysCacheTuple(RELOID, |
489 | 514 | ObjectIdGetDatum(indexrelid), |
490 | 515 | 0,0,0); |
|