diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-01-19 23:55:03 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-01-19 23:55:03 +0000 |
commit | 6d1efd76fb9852b8bc242dcaf35916090d7c5899 (patch) | |
tree | f827384a43f7dc18532337d555038e02498368b0 /src/backend/access | |
parent | 08fb7375e35863e0ba2b8bb6a6c75802ca13fe85 (diff) | |
download | postgresql-6d1efd76fb9852b8bc242dcaf35916090d7c5899.tar.gz postgresql-6d1efd76fb9852b8bc242dcaf35916090d7c5899.zip |
Fix handling of NULL constraint conditions: per SQL92 spec, a NULL result
from a constraint condition does not violate the constraint (cf. discussion
on pghackers 12/9/99). Implemented by adding a parameter to ExecQual,
specifying whether to return TRUE or FALSE when the qual result is
really NULL in three-valued boolean logic. Currently, ExecRelCheck is
the only caller that asks for TRUE, but if we find any other places that
have the wrong response to NULL, it'll be easy to fix them.
Diffstat (limited to 'src/backend/access')
-rw-r--r-- | src/backend/access/gist/gist.c | 6 | ||||
-rw-r--r-- | src/backend/access/hash/hash.c | 6 | ||||
-rw-r--r-- | src/backend/access/nbtree/nbtree.c | 6 | ||||
-rw-r--r-- | src/backend/access/rtree/rtree.c | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index 9c9e8aeee7f..edebfcbebe3 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.49 2000/01/17 23:57:41 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.50 2000/01/19 23:54:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -169,7 +169,7 @@ gistbuild(Relation heap, #ifndef OMIT_PARTIAL_INDEX /* SetSlotContents(slot, htup); */ slot->val = htup; - if (ExecQual((List *) oldPred, econtext) == true) + if (ExecQual((List *) oldPred, econtext, false)) { ni++; continue; @@ -186,7 +186,7 @@ gistbuild(Relation heap, #ifndef OMIT_PARTIAL_INDEX /* SetSlotContents(slot, htup); */ slot->val = htup; - if (ExecQual((List *) pred, econtext) == false) + if (! ExecQual((List *) pred, econtext, false)) continue; #endif /* OMIT_PARTIAL_INDEX */ } diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index fd3e3f94d50..1d88bfc8bc4 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.33 1999/12/10 03:55:43 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.34 2000/01/19 23:54:47 tgl Exp $ * * NOTES * This file contains only the public interface routines. @@ -131,7 +131,7 @@ hashbuild(Relation heap, /* SetSlotContents(slot, htup); */ #ifndef OMIT_PARTIAL_INDEX slot->val = htup; - if (ExecQual((List *) oldPred, econtext) == true) + if (ExecQual((List *) oldPred, econtext, false)) { nitups++; continue; @@ -148,7 +148,7 @@ hashbuild(Relation heap, #ifndef OMIT_PARTIAL_INDEX /* SetSlotContents(slot, htup); */ slot->val = htup; - if (ExecQual((List *) pred, econtext) == false) + if (! ExecQual((List *) pred, econtext, false)) continue; #endif /* OMIT_PARTIAL_INDEX */ } diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index 458b427c70d..1be5c08f973 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -11,7 +11,7 @@ * Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.50 1999/12/10 03:55:44 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.51 2000/01/19 23:54:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -167,7 +167,7 @@ btbuild(Relation heap, /* SetSlotContents(slot, htup); */ slot->val = htup; - if (ExecQual((List *) oldPred, econtext) == true) + if (ExecQual((List *) oldPred, econtext, false)) { nitups++; continue; @@ -184,7 +184,7 @@ btbuild(Relation heap, #ifndef OMIT_PARTIAL_INDEX /* SetSlotContents(slot, htup); */ slot->val = htup; - if (ExecQual((List *) pred, econtext) == false) + if (! ExecQual((List *) pred, econtext, false)) continue; #endif /* OMIT_PARTIAL_INDEX */ } diff --git a/src/backend/access/rtree/rtree.c b/src/backend/access/rtree/rtree.c index 09930e1e340..fd2a8e545a4 100644 --- a/src/backend/access/rtree/rtree.c +++ b/src/backend/access/rtree/rtree.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.41 1999/12/10 03:55:45 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.42 2000/01/19 23:54:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -163,7 +163,7 @@ rtbuild(Relation heap, #ifndef OMIT_PARTIAL_INDEX /* SetSlotContents(slot, htup); */ slot->val = htup; - if (ExecQual((List *) oldPred, econtext) == true) + if (ExecQual((List *) oldPred, econtext, false)) { ni++; continue; @@ -180,7 +180,7 @@ rtbuild(Relation heap, #ifndef OMIT_PARTIAL_INDEX /* SetSlotContents(slot, htup); */ slot->val = htup; - if (ExecQual((List *) pred, econtext) == false) + if (! ExecQual((List *) pred, econtext, false)) continue; #endif /* OMIT_PARTIAL_INDEX */ } |