diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-04-06 22:33:43 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-04-06 22:33:43 +0000 |
commit | f02a82b6adad1af75499c4ac7221bbd94e3c4fbf (patch) | |
tree | d15b0a2a52d95e046bb3945f4487982943ed211e /src/backend/access/common/scankey.c | |
parent | 146c83c045625d6f0072dd96045ebbc54582be05 (diff) | |
download | postgresql-f02a82b6adad1af75499c4ac7221bbd94e3c4fbf.tar.gz postgresql-f02a82b6adad1af75499c4ac7221bbd94e3c4fbf.zip |
Make 'col IS NULL' clauses be indexable conditions.
Teodor Sigaev, with some kibitzing from Tom Lane.
Diffstat (limited to 'src/backend/access/common/scankey.c')
-rw-r--r-- | src/backend/access/common/scankey.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/backend/access/common/scankey.c b/src/backend/access/common/scankey.c index a93c72e0932..21fccc23a2c 100644 --- a/src/backend/access/common/scankey.c +++ b/src/backend/access/common/scankey.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/common/scankey.c,v 1.29 2007/01/05 22:19:21 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/common/scankey.c,v 1.30 2007/04/06 22:33:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -20,7 +20,8 @@ /* * ScanKeyEntryInitialize * Initializes a scan key entry given all the field values. - * The target procedure is specified by OID. + * The target procedure is specified by OID (but can be invalid + * if SK_SEARCHNULL is set). * * Note: CurrentMemoryContext at call should be as long-lived as the ScanKey * itself, because that's what will be used for any subsidiary info attached @@ -40,7 +41,13 @@ ScanKeyEntryInitialize(ScanKey entry, entry->sk_strategy = strategy; entry->sk_subtype = subtype; entry->sk_argument = argument; - fmgr_info(procedure, &entry->sk_func); + if (RegProcedureIsValid(procedure)) + fmgr_info(procedure, &entry->sk_func); + else + { + Assert(flags & SK_SEARCHNULL); + MemSet(&entry->sk_func, 0, sizeof(entry->sk_func)); + } } /* |