diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-06-19 00:44:44 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-06-19 00:44:44 +0000 |
commit | d30c4b056212a0b0ac7be363aaa5cf634114e618 (patch) | |
tree | a3ce0b55f294f074a28060f4d7b6e4a6c13550af | |
parent | 0591bbd558ef23f756e6dcd2f4c5ee8250086040 (diff) | |
download | postgresql-d30c4b056212a0b0ac7be363aaa5cf634114e618.tar.gz postgresql-d30c4b056212a0b0ac7be363aaa5cf634114e618.zip |
Temporarily disable error checks for missing selectivity
functions, in order to work around oversight in 6.5 release: rtree
index functions haven't got any. Mea culpa ...
-rw-r--r-- | src/backend/utils/adt/selfuncs.c | 63 |
1 files changed, 44 insertions, 19 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index eb6bf557033..fe11c77b193 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -12,7 +12,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.29 1999/05/31 19:32:47 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.30 1999/06/19 00:44:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -414,17 +414,29 @@ btreesel(Oid operatorObjectId, * don't want to miss the benefits of a good selectivity estimate.) */ if (!oprrest) + { +#if 1 + /* + * XXX temporary fix for 6.5: rtree operators are missing their + * selectivity estimators, so return a default estimate instead. + * Ugh. + */ + result = (float64) palloc(sizeof(float64data)); + *result = 0.5; +#else elog(ERROR, - "Operator %u must have a restriction selectivity estimator to be used in a btree index", + "Operator %u must have a restriction selectivity estimator to be used in an index", operatorObjectId); - - result = (float64) fmgr(oprrest, - (char *) operatorObjectId, - (char *) indrelid, - (char *) (int) attributeNumber, - (char *) constValue, - (char *) constFlag, - NULL); +#endif + } + else + result = (float64) fmgr(oprrest, + (char *) operatorObjectId, + (char *) indrelid, + (char *) (int) attributeNumber, + (char *) constValue, + (char *) constFlag, + NULL); } if (!PointerIsValid(result)) @@ -473,18 +485,31 @@ btreenpage(Oid operatorObjectId, * don't want to miss the benefits of a good selectivity estimate.) */ if (!oprrest) + { +#if 1 + /* + * XXX temporary fix for 6.5: rtree operators are missing their + * selectivity estimators, so return a default estimate instead. + * Ugh. + */ + tempData = 0.5; + temp = &tempData; +#else elog(ERROR, - "Operator %u must have a restriction selectivity estimator to be used in a btree index", + "Operator %u must have a restriction selectivity estimator to be used in an index", operatorObjectId); - - temp = (float64) fmgr(oprrest, - (char *) operatorObjectId, - (char *) indrelid, - (char *) (int) attributeNumber, - (char *) constValue, - (char *) constFlag, - NULL); +#endif + } + else + temp = (float64) fmgr(oprrest, + (char *) operatorObjectId, + (char *) indrelid, + (char *) (int) attributeNumber, + (char *) constValue, + (char *) constFlag, + NULL); } + atp = SearchSysCacheTuple(RELOID, ObjectIdGetDatum(indexrelid), 0, 0, 0); |