mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Add opid to selectivity function call.
This commit is contained in:
parent
922e53e6ea
commit
4ae43c84c3
@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* 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,
|
||||
bool *typbyval,
|
||||
int32 *typmod);
|
||||
static bool getattstatistics(Oid relid, AttrNumber attnum,
|
||||
Oid typid, int32 typmod,
|
||||
Oid opid, Oid typid, int32 typmod,
|
||||
double *nullfrac,
|
||||
double *commonfrac,
|
||||
Datum *commonval,
|
||||
@ -92,7 +92,7 @@ eqsel(Oid opid,
|
||||
&typid, &typlen, &typbyval, &typmod);
|
||||
|
||||
/* get stats for the attribute, if available */
|
||||
if (getattstatistics(relid, attno, typid, typmod,
|
||||
if (getattstatistics(relid, attno, opid, typid, typmod,
|
||||
&nullfrac, &commonfrac, &commonval,
|
||||
NULL, NULL))
|
||||
{
|
||||
@ -268,7 +268,7 @@ intltsel(Oid opid,
|
||||
getattproperties(relid, attno,
|
||||
&typid, &typlen, &typbyval, &typmod);
|
||||
|
||||
if (! getattstatistics(relid, attno, typid, typmod,
|
||||
if (! getattstatistics(relid, attno, opid, typid, typmod,
|
||||
NULL, NULL, NULL,
|
||||
&loval, &hival))
|
||||
{
|
||||
@ -580,7 +580,8 @@ getattproperties(Oid relid, AttrNumber attnum,
|
||||
* is no index nor syscache for pg_statistic. FIX THIS!
|
||||
*/
|
||||
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 *commonfrac,
|
||||
Datum *commonval,
|
||||
@ -598,7 +599,7 @@ getattstatistics(Oid relid, AttrNumber attnum, Oid typid, int32 typmod,
|
||||
tuple = SearchSysCacheTuple(STATRELID,
|
||||
ObjectIdGetDatum(relid),
|
||||
Int16GetDatum((int16) attnum),
|
||||
0, 0); /* staop is currently 0 */
|
||||
opid, 0);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
/* no such stats entry */
|
||||
|
Loading…
x
Reference in New Issue
Block a user