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

Commite704692

Browse files
committed
Fix: Operand Order Affects OR.
where x <> 1 or x isnulldidn't return tuples with x NULL.
1 parentc2c26b6 commite704692

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

‎src/backend/executor/execQual.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.17 1997/09/12 04:07:36momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.18 1997/09/22 04:19:36vadim Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1044,7 +1044,22 @@ ExecEvalOr(Expr *orExpr, ExprContext *econtext, bool *isNull)
10441044
* ----------------
10451045
*/
10461046
if (*isNull)
1047+
{
10471048
IsNull=*isNull;
1049+
/*
1050+
* Many functions don't (or can't!) check is an argument
1051+
* NULL or NOT_NULL and may return TRUE (1) with *isNull TRUE
1052+
* (an_int4_column <> 1: int4ne returns TRUE for NULLs).
1053+
* Not having time to fix function manager I want to fix
1054+
* OR: if we had 'x <> 1 OR x isnull' then TRUE, TRUE were
1055+
* returned by 'x <> 1' for NULL ... but ExecQualClause say
1056+
* that qualification *fails* if isnull is TRUE for all values
1057+
* returned by ExecEvalExpr. So, force this rule here: if isnull
1058+
* is TRUE then clause failed. Note: nullvalue() & nonnullvalue()
1059+
* always set isnull to FALSE for NULLs.- vadim 09/22/97
1060+
*/
1061+
const_value=0;
1062+
}
10481063

10491064
/* ----------------
10501065
* if we have a true result, then we return it.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp