mirror of
https://github.com/postgres/postgres.git
synced 2025-08-21 10:42:50 +03:00
New HeapTuple structure/interface.
This commit is contained in:
@@ -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,48 +109,40 @@ 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 \
|
||||
_res = TRUE; \
|
||||
\
|
||||
if (_res) \
|
||||
{ \
|
||||
if ((relation)->rd_rel->relkind != RELKIND_UNCATALOGED) \
|
||||
{ \
|
||||
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 = (HeapTuple) PageGetItem((Page) (disk_page), (itemId)); \
|
||||
\
|
||||
if ((key) != NULL) \
|
||||
HeapKeyTest(_tuple, RelationGetDescr(relation), \
|
||||
(nKeys), (key), _res); \
|
||||
else \
|
||||
_res = TRUE; \
|
||||
\
|
||||
(result) = (HeapTuple) NULL; \
|
||||
if (_res) \
|
||||
{ \
|
||||
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; \
|
||||
} \
|
||||
} \
|
||||
(tuple)->t_data = NULL; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
Reference in New Issue
Block a user