summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/valid.h24
-rw-r--r--src/include/catalog/pg_aggregate.h7
-rw-r--r--src/include/fmgr.h15
-rw-r--r--src/include/optimizer/clauses.h10
4 files changed, 29 insertions, 27 deletions
diff --git a/src/include/access/valid.h b/src/include/access/valid.h
index e710ff415af..d89b3fce187 100644
--- a/src/include/access/valid.h
+++ b/src/include/access/valid.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: valid.h,v 1.21 2000/05/28 17:56:14 tgl Exp $
+ * $Id: valid.h,v 1.22 2000/05/30 04:24:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -33,7 +33,7 @@ do \
macro below */ \
bool __isnull; \
Datum __atp; \
- int __test; \
+ Datum __test; \
int __cur_nkeys = (nkeys); \
ScanKey __cur_keys = (keys); \
\
@@ -41,9 +41,9 @@ do \
for (; __cur_nkeys--; __cur_keys++) \
{ \
__atp = heap_getattr((tuple), \
- __cur_keys->sk_attno, \
- (tupdesc), \
- &__isnull); \
+ __cur_keys->sk_attno, \
+ (tupdesc), \
+ &__isnull); \
\
if (__isnull) \
{ \
@@ -58,16 +58,14 @@ do \
break; \
} \
\
- if (__cur_keys->sk_func.fn_addr == (PGFunction) oideq) /* optimization */ \
- __test = (__cur_keys->sk_argument == __atp); \
- else if (__cur_keys->sk_flags & SK_COMMUTE) \
- __test = (long) FMGR_PTR2(&__cur_keys->sk_func, \
- __cur_keys->sk_argument, __atp); \
+ if (__cur_keys->sk_flags & SK_COMMUTE) \
+ __test = FunctionCall2(&__cur_keys->sk_func, \
+ __cur_keys->sk_argument, __atp); \
else \
- __test = (long) FMGR_PTR2(&__cur_keys->sk_func, \
- __atp, __cur_keys->sk_argument); \
+ __test = FunctionCall2(&__cur_keys->sk_func, \
+ __atp, __cur_keys->sk_argument); \
\
- if (!__test == !(__cur_keys->sk_flags & SK_NEGATE)) \
+ if (DatumGetBool(__test) == !!(__cur_keys->sk_flags & SK_NEGATE)) \
{ \
/* XXX eventually should check if SK_ISNULL */ \
(result) = false; \
diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h
index 0cae51dec64..2350d738565 100644
--- a/src/include/catalog/pg_aggregate.h
+++ b/src/include/catalog/pg_aggregate.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_aggregate.h,v 1.25 2000/04/12 17:16:27 momjian Exp $
+ * $Id: pg_aggregate.h,v 1.26 2000/05/30 04:24:55 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -151,7 +151,8 @@ extern void AggregateCreate(char *aggName,
char *aggtransfn2typeName,
char *agginitval1,
char *agginitval2);
-extern char *AggNameGetInitVal(char *aggName, Oid basetype,
- int xfuncno, bool *isNull);
+
+extern Datum AggNameGetInitVal(char *aggName, Oid basetype,
+ int xfuncno, bool *isNull);
#endif /* PG_AGGREGATE_H */
diff --git a/src/include/fmgr.h b/src/include/fmgr.h
index ce6b06bf8d4..fadb09d24e1 100644
--- a/src/include/fmgr.h
+++ b/src/include/fmgr.h
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: fmgr.h,v 1.2 2000/05/29 01:59:09 tgl Exp $
+ * $Id: fmgr.h,v 1.3 2000/05/30 04:24:56 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -272,6 +272,8 @@ typedef int32 ((*func_ptr) ());
typedef char *((*func_ptr) ());
#endif
+#if 0
+
typedef struct {
char *data[FUNC_MAX_ARGS];
} FmgrValues;
@@ -286,18 +288,11 @@ extern char *fmgr_faddr_link(char *arg0, ...);
* Macros for calling through the result of fmgr_info.
*/
-/* We don't make this static so fmgr_faddr() macros can access it */
+/* We don't make this static so fmgr_faddr() macro can access it */
extern FmgrInfo *fmgr_pl_finfo;
#define fmgr_faddr(finfo) (fmgr_pl_finfo = (finfo), (func_ptr) fmgr_faddr_link)
-#define FMGR_PTR2(FINFO, ARG1, ARG2) ((*(fmgr_faddr(FINFO))) (ARG1, ARG2))
-
-/*
- * Flags for the builtin oprrest selectivity routines.
- * XXX These do not belong here ... put 'em in some planner/optimizer header.
- */
-#define SEL_CONSTANT 1 /* operator's non-var arg is a constant */
-#define SEL_RIGHT 2 /* operator's non-var arg is on the right */
+#endif
#endif /* FMGR_H */
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h
index 9cccc65454e..946a9b0586f 100644
--- a/src/include/optimizer/clauses.h
+++ b/src/include/optimizer/clauses.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: clauses.h,v 1.36 2000/04/12 17:16:41 momjian Exp $
+ * $Id: clauses.h,v 1.37 2000/05/30 04:24:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -16,6 +16,14 @@
#include "nodes/relation.h"
+/*
+ * Flag bits returned by get_relattval().
+ * These are used in selectivity-estimation routines, too.
+ */
+#define SEL_CONSTANT 1 /* operator's non-var arg is a constant */
+#define SEL_RIGHT 2 /* operator's non-var arg is on the right */
+
+
extern Expr *make_clause(int type, Node *oper, List *args);
extern bool is_opclause(Node *clause);