summaryrefslogtreecommitdiff
path: root/src/include/access/valid.h
diff options
context:
space:
mode:
authorTom Lane2003-11-09 21:30:38 +0000
committerTom Lane2003-11-09 21:30:38 +0000
commitc1d62bfd00f4d1ea0647e12947ca1de9fea39b33 (patch)
tree1afdccb5267627182cab94b347730657107ad6eb /src/include/access/valid.h
parent723825afebb6de7212fa18882bcc78212d5c1743 (diff)
Add operator strategy and comparison-value datatype fields to ScanKey.
Remove the 'strategy map' code, which was a large amount of mechanism that no longer had any use except reverse-mapping from procedure OID to strategy number. Passing the strategy number to the index AM in the first place is simpler and faster. This is a preliminary step in planned support for cross-datatype index operations. I'm committing it now since the ScanKeyEntryInitialize() API change touches quite a lot of files, and I want to commit those changes before the tree drifts under me.
Diffstat (limited to 'src/include/access/valid.h')
-rw-r--r--src/include/access/valid.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/include/access/valid.h b/src/include/access/valid.h
index 3109d3e7e4d..e16a392a243 100644
--- a/src/include/access/valid.h
+++ b/src/include/access/valid.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: valid.h,v 1.31 2003/09/25 18:58:35 tgl Exp $
+ * $Id: valid.h,v 1.32 2003/11/09 21:30:37 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -31,15 +31,16 @@ do \
/* We use underscores to protect the variable passed in as parameters */ \
/* We use two underscore here because this macro is included in the \
macro below */ \
- bool __isnull; \
- Datum __atp; \
- Datum __test; \
int __cur_nkeys = (nkeys); \
ScanKey __cur_keys = (keys); \
\
(result) = true; /* may change */ \
for (; __cur_nkeys--; __cur_keys++) \
{ \
+ Datum __atp; \
+ bool __isnull; \
+ Datum __test; \
+ \
__atp = heap_getattr((tuple), \
__cur_keys->sk_attno, \
(tupdesc), \
@@ -58,16 +59,11 @@ do \
break; \
} \
\
- if (__cur_keys->sk_flags & SK_COMMUTE) \
- __test = FunctionCall2(&__cur_keys->sk_func, \
- __cur_keys->sk_argument, __atp); \
- else \
- __test = FunctionCall2(&__cur_keys->sk_func, \
- __atp, __cur_keys->sk_argument); \
+ __test = FunctionCall2(&__cur_keys->sk_func, \
+ __atp, __cur_keys->sk_argument); \
\
- if (DatumGetBool(__test) == !!(__cur_keys->sk_flags & SK_NEGATE)) \
+ if (!DatumGetBool(__test)) \
{ \
- /* XXX eventually should check if SK_ISNULL */ \
(result) = false; \
break; \
} \