|
15 | 15 | *
|
16 | 16 | *
|
17 | 17 | * IDENTIFICATION
|
18 |
| - * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.66 2000/05/26 17:19:15 tgl Exp $ |
| 18 | + * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.66.2.1 2000/09/23 21:27:05 tgl Exp $ |
19 | 19 | *
|
20 | 20 | *-------------------------------------------------------------------------
|
21 | 21 | */
|
@@ -255,9 +255,24 @@ neqsel(Oid opid,
|
255 | 255 | Datumvalue,
|
256 | 256 | int32flag)
|
257 | 257 | {
|
| 258 | +Oideqopid; |
258 | 259 | float64result;
|
259 | 260 |
|
260 |
| -result=eqsel(opid,relid,attno,value,flag); |
| 261 | +/* |
| 262 | + * We want 1 - eqsel() where the equality operator is the one associated |
| 263 | + * with this != operator, that is, its negator. |
| 264 | + */ |
| 265 | +eqopid=get_negator(opid); |
| 266 | +if (eqopid) |
| 267 | +{ |
| 268 | +result=eqsel(eqopid,relid,attno,value,flag); |
| 269 | +} |
| 270 | +else |
| 271 | +{ |
| 272 | +/* Use default selectivity (should we raise an error instead?) */ |
| 273 | +result= (float64)palloc(sizeof(float64data)); |
| 274 | +*result=DEFAULT_EQ_SEL; |
| 275 | +} |
261 | 276 | *result=1.0-*result;
|
262 | 277 | returnresult;
|
263 | 278 | }
|
|