1010 *
1111 *
1212 * IDENTIFICATION
13- * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.43 1999/11/25 00:15:57 momjian Exp $
13+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.44 1999/11/25 00:21:34 momjian Exp $
1414 *
1515 *-------------------------------------------------------------------------
1616 */
@@ -47,7 +47,7 @@ static void getattproperties(Oid relid, AttrNumber attnum,
4747bool * typbyval ,
4848int32 * typmod );
4949static bool getattstatistics (Oid relid ,AttrNumber attnum ,
50- Oid typid ,int32 typmod ,
50+ Oid opid , Oid typid ,int32 typmod ,
5151double * nullfrac ,
5252double * commonfrac ,
5353Datum * commonval ,
@@ -92,7 +92,7 @@ eqsel(Oid opid,
9292& typid ,& typlen ,& typbyval ,& typmod );
9393
9494/* get stats for the attribute, if available */
95- if (getattstatistics (relid ,attno ,typid ,typmod ,
95+ if (getattstatistics (relid ,attno ,opid , typid ,typmod ,
9696& nullfrac ,& commonfrac ,& commonval ,
9797NULL ,NULL ))
9898{
@@ -268,7 +268,7 @@ intltsel(Oid opid,
268268getattproperties (relid ,attno ,
269269& typid ,& typlen ,& typbyval ,& typmod );
270270
271- if (!getattstatistics (relid ,attno ,typid ,typmod ,
271+ if (!getattstatistics (relid ,attno ,opid , typid ,typmod ,
272272NULL ,NULL ,NULL ,
273273& loval ,& hival ))
274274{
@@ -580,7 +580,8 @@ getattproperties(Oid relid, AttrNumber attnum,
580580 * is no index nor syscache for pg_statistic. FIX THIS!
581581 */
582582static bool
583- getattstatistics (Oid relid ,AttrNumber attnum ,Oid typid ,int32 typmod ,
583+ getattstatistics (Oid relid ,AttrNumber attnum ,Oid opid ,Oid typid ,
584+ int32 typmod ,
584585double * nullfrac ,
585586double * commonfrac ,
586587Datum * commonval ,
@@ -598,7 +599,7 @@ getattstatistics(Oid relid, AttrNumber attnum, Oid typid, int32 typmod,
598599tuple = SearchSysCacheTuple (STATRELID ,
599600ObjectIdGetDatum (relid ),
600601Int16GetDatum ((int16 )attnum ),
601- 0 ,0 );/* staop is currently 0 */
602+ opid ,0 );
602603if (!HeapTupleIsValid (tuple ))
603604{
604605/* no such stats entry */