aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/valid.h
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>1998-11-27 19:33:35 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>1998-11-27 19:33:35 +0000
commit2435c7d501b0a3129f6fc597a9c85863541cd596 (patch)
treecab8ad080c258c55487e1bab390cd21dd399feff /src/include/access/valid.h
parent4d7188039aba7f2b0b5fa8a092025b61e1884c65 (diff)
downloadpostgresql-2435c7d501b0a3129f6fc597a9c85863541cd596.tar.gz
postgresql-2435c7d501b0a3129f6fc597a9c85863541cd596.zip
New HeapTuple structure/interface.
Diffstat (limited to 'src/include/access/valid.h')
-rw-r--r--src/include/access/valid.h50
1 files changed, 21 insertions, 29 deletions
diff --git a/src/include/access/valid.h b/src/include/access/valid.h
index aadaf827c4b..caa22261f16 100644
--- a/src/include/access/valid.h
+++ b/src/include/access/valid.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: valid.h,v 1.15 1998/09/01 04:34:33 momjian Exp $
+ * $Id: valid.h,v 1.16 1998/11/27 19:33:32 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -109,49 +109,41 @@ do \
* with joey's expensive function work.
* ----------------
*/
-#define HeapTupleSatisfies(itemId, \
+#define HeapTupleSatisfies(tuple, \
relation, \
buffer, \
disk_page, \
seeself, \
nKeys, \
- key, \
- result) \
+ key) \
do \
{ \
/* We use underscores to protect the variable passed in as parameters */ \
- HeapTuple _tuple; \
bool _res; \
\
- if (!ItemIdIsUsed(itemId)) \
- (result) = (HeapTuple) NULL; \
+ if ((key) != NULL) \
+ HeapKeyTest(tuple, RelationGetDescr(relation), \
+ (nKeys), (key), _res); \
else \
- { \
- _tuple = (HeapTuple) PageGetItem((Page) (disk_page), (itemId)); \
- \
- if ((key) != NULL) \
- HeapKeyTest(_tuple, RelationGetDescr(relation), \
- (nKeys), (key), _res); \
- else \
- _res = TRUE; \
+ _res = TRUE; \
\
- (result) = (HeapTuple) NULL; \
- if (_res) \
+ if (_res) \
+ { \
+ if ((relation)->rd_rel->relkind != RELKIND_UNCATALOGED) \
{ \
- if ((relation)->rd_rel->relkind == RELKIND_UNCATALOGED) \
- (result) = _tuple; \
- else \
- { \
- uint16 _infomask = _tuple->t_infomask; \
- \
- _res = HeapTupleSatisfiesVisibility(_tuple, (seeself)); \
- if (_tuple->t_infomask != _infomask) \
- SetBufferCommitInfoNeedsSave(buffer); \
- if (_res) \
- (result) = _tuple; \
- } \
+ uint16 _infomask = (tuple)->t_data->t_infomask; \
+ \
+ _res = HeapTupleSatisfiesVisibility((tuple), (seeself)); \
+ if ((tuple)->t_data->t_infomask != _infomask) \
+ SetBufferCommitInfoNeedsSave(buffer); \
+ if (!_res) \
+ (tuple)->t_data = NULL; \
} \
} \
+ else \
+ { \
+ (tuple)->t_data = NULL; \
+ } \
} while (0)
extern bool TupleUpdatedByCurXactAndCmd(HeapTuple t);