Skip to content
Snippets Groups Projects
Commit 4ae43c84 authored by Bruce Momjian's avatar Bruce Momjian
Browse files

Add opid to selectivity function call.

parent 922e53e6
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.43 1999/11/25 00:15:57 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.44 1999/11/25 00:21:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -47,7 +47,7 @@ static void getattproperties(Oid relid, AttrNumber attnum, ...@@ -47,7 +47,7 @@ static void getattproperties(Oid relid, AttrNumber attnum,
bool *typbyval, bool *typbyval,
int32 *typmod); int32 *typmod);
static bool getattstatistics(Oid relid, AttrNumber attnum, static bool getattstatistics(Oid relid, AttrNumber attnum,
Oid typid, int32 typmod, Oid opid, Oid typid, int32 typmod,
double *nullfrac, double *nullfrac,
double *commonfrac, double *commonfrac,
Datum *commonval, Datum *commonval,
...@@ -92,7 +92,7 @@ eqsel(Oid opid, ...@@ -92,7 +92,7 @@ eqsel(Oid opid,
&typid, &typlen, &typbyval, &typmod); &typid, &typlen, &typbyval, &typmod);
/* get stats for the attribute, if available */ /* get stats for the attribute, if available */
if (getattstatistics(relid, attno, typid, typmod, if (getattstatistics(relid, attno, opid, typid, typmod,
&nullfrac, &commonfrac, &commonval, &nullfrac, &commonfrac, &commonval,
NULL, NULL)) NULL, NULL))
{ {
...@@ -268,7 +268,7 @@ intltsel(Oid opid, ...@@ -268,7 +268,7 @@ intltsel(Oid opid,
getattproperties(relid, attno, getattproperties(relid, attno,
&typid, &typlen, &typbyval, &typmod); &typid, &typlen, &typbyval, &typmod);
if (! getattstatistics(relid, attno, typid, typmod, if (! getattstatistics(relid, attno, opid, typid, typmod,
NULL, NULL, NULL, NULL, NULL, NULL,
&loval, &hival)) &loval, &hival))
{ {
...@@ -580,7 +580,8 @@ getattproperties(Oid relid, AttrNumber attnum, ...@@ -580,7 +580,8 @@ getattproperties(Oid relid, AttrNumber attnum,
* is no index nor syscache for pg_statistic. FIX THIS! * is no index nor syscache for pg_statistic. FIX THIS!
*/ */
static bool static bool
getattstatistics(Oid relid, AttrNumber attnum, Oid typid, int32 typmod, getattstatistics(Oid relid, AttrNumber attnum, Oid opid, Oid typid,
int32 typmod,
double *nullfrac, double *nullfrac,
double *commonfrac, double *commonfrac,
Datum *commonval, Datum *commonval,
...@@ -598,7 +599,7 @@ getattstatistics(Oid relid, AttrNumber attnum, Oid typid, int32 typmod, ...@@ -598,7 +599,7 @@ getattstatistics(Oid relid, AttrNumber attnum, Oid typid, int32 typmod,
tuple = SearchSysCacheTuple(STATRELID, tuple = SearchSysCacheTuple(STATRELID,
ObjectIdGetDatum(relid), ObjectIdGetDatum(relid),
Int16GetDatum((int16) attnum), Int16GetDatum((int16) attnum),
0, 0); /* staop is currently 0 */ opid, 0);
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
{ {
/* no such stats entry */ /* no such stats entry */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment