Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit89ebadc

Browse files
committed
Back-patch fix for erroneous selectivity of not-equals.
1 parent5a5531a commit89ebadc

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

‎src/backend/utils/adt/selfuncs.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* 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 $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -255,9 +255,24 @@ neqsel(Oid opid,
255255
Datumvalue,
256256
int32flag)
257257
{
258+
Oideqopid;
258259
float64result;
259260

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+
}
261276
*result=1.0-*result;
262277
returnresult;
263278
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp