1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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 ...
This commit is contained in:
Tom Lane
1999-06-19 00:44:44 +00:00
parent 0591bbd558
commit d30c4b0562

View File

@ -12,7 +12,7 @@
* *
* *
* IDENTIFICATION * 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,10 +414,22 @@ btreesel(Oid operatorObjectId,
* don't want to miss the benefits of a good selectivity estimate.) * don't want to miss the benefits of a good selectivity estimate.)
*/ */
if (!oprrest) 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, 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); operatorObjectId);
#endif
}
else
result = (float64) fmgr(oprrest, result = (float64) fmgr(oprrest,
(char *) operatorObjectId, (char *) operatorObjectId,
(char *) indrelid, (char *) indrelid,
@ -473,10 +485,22 @@ btreenpage(Oid operatorObjectId,
* don't want to miss the benefits of a good selectivity estimate.) * don't want to miss the benefits of a good selectivity estimate.)
*/ */
if (!oprrest) 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, 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); operatorObjectId);
#endif
}
else
temp = (float64) fmgr(oprrest, temp = (float64) fmgr(oprrest,
(char *) operatorObjectId, (char *) operatorObjectId,
(char *) indrelid, (char *) indrelid,
@ -485,6 +509,7 @@ btreenpage(Oid operatorObjectId,
(char *) constFlag, (char *) constFlag,
NULL); NULL);
} }
atp = SearchSysCacheTuple(RELOID, atp = SearchSysCacheTuple(RELOID,
ObjectIdGetDatum(indexrelid), ObjectIdGetDatum(indexrelid),
0, 0, 0); 0, 0, 0);