Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
27db9ecd
Commit
27db9ecd
authored
Jun 15, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix macros that were not properly surrounded by parens or braces.
parent
3af536a1
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
462 additions
and
379 deletions
+462
-379
src/backend/access/common/scankey.c
src/backend/access/common/scankey.c
+5
-3
src/backend/access/index/indexam.c
src/backend/access/index/indexam.c
+25
-15
src/backend/executor/nodeMergejoin.c
src/backend/executor/nodeMergejoin.c
+6
-6
src/backend/optimizer/path/xfunc.c
src/backend/optimizer/path/xfunc.c
+7
-4
src/backend/storage/buffer/freelist.c
src/backend/storage/buffer/freelist.c
+11
-7
src/backend/tcop/utility.c
src/backend/tcop/utility.c
+7
-2
src/backend/tioga/Arr_TgRecipe.h
src/backend/tioga/Arr_TgRecipe.h
+12
-6
src/backend/tioga/Varray.h
src/backend/tioga/Varray.h
+4
-2
src/backend/utils/adt/date.c
src/backend/utils/adt/date.c
+6
-3
src/backend/utils/adt/dt.c
src/backend/utils/adt/dt.c
+7
-3
src/backend/utils/cache/catcache.c
src/backend/utils/cache/catcache.c
+23
-13
src/backend/utils/cache/relcache.c
src/backend/utils/cache/relcache.c
+72
-78
src/backend/utils/mmgr/portalmem.c
src/backend/utils/mmgr/portalmem.c
+42
-34
src/backend/utils/sort/psort.c
src/backend/utils/sort/psort.c
+16
-12
src/bin/psql/psqlHelp.h
src/bin/psql/psqlHelp.h
+5
-5
src/include/access/attnum.h
src/include/access/attnum.h
+5
-3
src/include/access/heapam.h
src/include/access/heapam.h
+38
-50
src/include/access/itup.h
src/include/access/itup.h
+28
-34
src/include/c.h
src/include/c.h
+2
-2
src/include/executor/execdebug.h
src/include/executor/execdebug.h
+10
-9
src/include/storage/block.h
src/include/storage/block.h
+16
-11
src/include/storage/buf_internals.h
src/include/storage/buf_internals.h
+22
-16
src/include/storage/bufmgr.h
src/include/storage/bufmgr.h
+2
-3
src/include/storage/bufpage.h
src/include/storage/bufpage.h
+18
-10
src/include/storage/itemid.h
src/include/storage/itemid.h
+5
-3
src/include/storage/itemptr.h
src/include/storage/itemptr.h
+32
-19
src/include/storage/lock.h
src/include/storage/lock.h
+5
-3
src/include/storage/s_lock.h
src/include/storage/s_lock.h
+8
-5
src/include/utils/exc.h
src/include/utils/exc.h
+23
-18
No files found.
src/backend/access/common/scankey.c
View file @
27db9ecd
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/scankey.c,v 1.1
1 1998/01/15 19:41:46 pgsql
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/scankey.c,v 1.1
2 1998/06/15 18:39:22 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -22,8 +22,10 @@
...
@@ -22,8 +22,10 @@
* True iff the scan key entry is legal.
* True iff the scan key entry is legal.
*/
*/
#define ScanKeyEntryIsLegal(entry) \
#define ScanKeyEntryIsLegal(entry) \
((bool) (AssertMacro(PointerIsValid(entry)) && \
( \
AttributeNumberIsValid(entry->sk_attno)))
AssertMacro(PointerIsValid(entry)), \
AttributeNumberIsValid((entry)->sk_attno) \
)
/*
/*
* ScanKeyEntrySetIllegal --
* ScanKeyEntrySetIllegal --
...
...
src/backend/access/index/indexam.c
View file @
27db9ecd
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.2
1 1998/02/26 12:07:10 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.2
2 1998/06/15 18:39:23 momjian
Exp $
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
* index_open - open an index relation by relationId
* index_open - open an index relation by relationId
...
@@ -92,25 +92,35 @@
...
@@ -92,25 +92,35 @@
* ----------------------------------------------------------------
* ----------------------------------------------------------------
*/
*/
#define RELATION_CHECKS \
#define RELATION_CHECKS \
Assert(RelationIsValid(relation)); \
( \
Assert(PointerIsValid(relation->rd_am))
AssertMacro(RelationIsValid(relation)), \
AssertMacro(PointerIsValid(relation->rd_am)) \
)
#define SCAN_CHECKS \
#define SCAN_CHECKS \
Assert(IndexScanIsValid(scan)); \
( \
Assert(RelationIsValid(scan->relation)); \
AssertMacro(IndexScanIsValid(scan)), \
Assert(PointerIsValid(scan->relation->rd_am))
AssertMacro(RelationIsValid(scan->relation)), \
AssertMacro(PointerIsValid(scan->relation->rd_am)) \
)
#define GET_REL_PROCEDURE(x,y) \
#define GET_REL_PROCEDURE(x,y) \
procedure = relation->rd_am->y; \
( \
if (! RegProcedureIsValid(procedure)) \
procedure = relation->rd_am->y, \
elog(ERROR, "index_%s: invalid %s regproc", \
(!RegProcedureIsValid(procedure)) ? \
CppAsString(x), CppAsString(y))
elog(ERROR, "index_%s: invalid %s regproc", \
CppAsString(x), CppAsString(y)) \
: (void)NULL \
)
#define GET_SCAN_PROCEDURE(x,y) \
#define GET_SCAN_PROCEDURE(x,y) \
procedure = scan->relation->rd_am->y; \
( \
if (! RegProcedureIsValid(procedure)) \
procedure = scan->relation->rd_am->y, \
elog(ERROR, "index_%s: invalid %s regproc", \
(!RegProcedureIsValid(procedure)) ? \
CppAsString(x), CppAsString(y))
elog(ERROR, "index_%s: invalid %s regproc", \
CppAsString(x), CppAsString(y)) \
: (void)NULL \
)
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
...
...
src/backend/executor/nodeMergejoin.c
View file @
27db9ecd
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.1
4 1998/02/27 16:11:28 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.1
5 1998/06/15 18:39:24 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -88,12 +88,12 @@
...
@@ -88,12 +88,12 @@
static
bool
MergeCompare
(
List
*
eqQual
,
List
*
compareQual
,
ExprContext
*
econtext
);
static
bool
MergeCompare
(
List
*
eqQual
,
List
*
compareQual
,
ExprContext
*
econtext
);
#define MarkInnerTuple(innerTupleSlot, mergestate) \
#define MarkInnerTuple(innerTupleSlot, mergestate) \
{
\
(
\
ExecStoreTuple(heap_copytuple(
innerTupleSlot
->val), \
ExecStoreTuple(heap_copytuple(
(innerTupleSlot)
->val), \
mergestate
->mj_MarkedTupleSlot, \
(mergestate)
->mj_MarkedTupleSlot, \
InvalidBuffer, \
InvalidBuffer, \
true)
;
\
true) \
}
)
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
* MJFormOSortopI
* MJFormOSortopI
...
...
src/backend/optimizer/path/xfunc.c
View file @
27db9ecd
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.1
3 1998/02/26 04:32:44
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.1
4 1998/06/15 18:39:26
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1424,9 +1424,12 @@ xfunc_LispRemove(LispValue foo, List bar)
...
@@ -1424,9 +1424,12 @@ xfunc_LispRemove(LispValue foo, List bar)
}
}
#define Node_Copy(a, b, c, d) \
#define Node_Copy(a, b, c, d) \
if (NodeCopy((Node)((a)->d), (Node*)&((b)->d), c) != true) { \
do { \
return false; \
if (NodeCopy((Node)((a)->d), (Node*)&((b)->d), c) != true) \
}
{ \
return false; \
} \
} while(0)
/*
/*
** xfunc_copyrel --
** xfunc_copyrel --
...
...
src/backend/storage/buffer/freelist.c
View file @
27db9ecd
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/freelist.c,v 1.
9 1998/01/07 21:04:52
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/freelist.c,v 1.
10 1998/06/15 18:39:28
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -40,14 +40,18 @@ static BufferDesc *SharedFreeList;
...
@@ -40,14 +40,18 @@ static BufferDesc *SharedFreeList;
extern
SPINLOCK
BufMgrLock
;
extern
SPINLOCK
BufMgrLock
;
#define IsInQueue(bf) \
#define IsInQueue(bf) \
Assert((bf->freeNext != INVALID_DESCRIPTOR));\
( \
Assert((bf->freePrev != INVALID_DESCRIPTOR));\
AssertMacro((bf->freeNext != INVALID_DESCRIPTOR)), \
Assert((bf->flags & BM_FREE))
AssertMacro((bf->freePrev != INVALID_DESCRIPTOR)), \
AssertMacro((bf->flags & BM_FREE)) \
)
#define NotInQueue(bf) \
#define NotInQueue(bf) \
Assert((bf->freeNext == INVALID_DESCRIPTOR));\
( \
Assert((bf->freePrev == INVALID_DESCRIPTOR));\
AssertMacro((bf->freeNext == INVALID_DESCRIPTOR)), \
Assert(! (bf->flags & BM_FREE))
AssertMacro((bf->freePrev == INVALID_DESCRIPTOR)), \
AssertMacro(! (bf->flags & BM_FREE)) \
)
/*
/*
...
...
src/backend/tcop/utility.c
View file @
27db9ecd
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.
39 1998/06/04 17:26:48
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.
40 1998/06/15 18:39:29
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -67,13 +67,18 @@ extern const char **ps_status; /* from postgres.c */
...
@@ -67,13 +67,18 @@ extern const char **ps_status; /* from postgres.c */
* processing within an aborted transaction block.
* processing within an aborted transaction block.
* ----------------
* ----------------
*/
*/
/* we have to use IF because of the 'break' */
#define CHECK_IF_ABORTED() \
#define CHECK_IF_ABORTED() \
if (IsAbortedTransactionBlockState()) { \
if (1) \
{ \
if (IsAbortedTransactionBlockState()) \
{ \
elog(NOTICE, "(transaction aborted): %s", \
elog(NOTICE, "(transaction aborted): %s", \
"queries ignored until END"); \
"queries ignored until END"); \
commandTag = "*ABORT STATE*"; \
commandTag = "*ABORT STATE*"; \
break; \
break; \
} \
} \
} else
/* ----------------
/* ----------------
* general utility function invoker
* general utility function invoker
...
...
src/backend/tioga/Arr_TgRecipe.h
View file @
27db9ecd
...
@@ -43,8 +43,10 @@ typedef struct Arr_TgString
...
@@ -43,8 +43,10 @@ typedef struct Arr_TgString
(Arr_TgString *) NewVarray(ARR_TgString_INITIAL_SIZE, sizeof(TgString))
(Arr_TgString *) NewVarray(ARR_TgString_INITIAL_SIZE, sizeof(TgString))
#define enlargeArr_TgString(A, I) \
#define enlargeArr_TgString(A, I) \
(A)->size += (I); \
( \
(A)->val = (TgString *) realloc((A)->val, (A)->valSize * (A)->size)
(A)->size += (I), \
(A)->val = (TgString *) realloc((A)->val, (A)->valSize * (A)->size) \
)
#define addArr_TgString(A, V) \
#define addArr_TgString(A, V) \
AppendVarray((Varray *) (A), (void *) (V), (CopyingFunct) copyTgString)
AppendVarray((Varray *) (A), (void *) (V), (CopyingFunct) copyTgString)
...
@@ -79,8 +81,10 @@ typedef struct Arr_TgElementPtr
...
@@ -79,8 +81,10 @@ typedef struct Arr_TgElementPtr
(Arr_TgElementPtr *) NewVarray(ARR_TgElementPtr_INITIAL_SIZE, sizeof(TgElementPtr))
(Arr_TgElementPtr *) NewVarray(ARR_TgElementPtr_INITIAL_SIZE, sizeof(TgElementPtr))
#define enlargeArr_TgElementPtr(A, I) \
#define enlargeArr_TgElementPtr(A, I) \
(A)->size += (I); \
( \
(A)->val = (TgElementPtr *) realloc((A)->val, (A)->valSize * (A)->size)
(A)->size += (I), \
(A)->val = (TgElementPtr *) realloc((A)->val, (A)->valSize * (A)->size) \
)
#define addArr_TgElementPtr(A, V) \
#define addArr_TgElementPtr(A, V) \
AppendVarray((Varray *) (A), (void *) (V), (CopyingFunct) copyTgElementPtr)
AppendVarray((Varray *) (A), (void *) (V), (CopyingFunct) copyTgElementPtr)
...
@@ -115,8 +119,10 @@ typedef struct Arr_TgNodePtr
...
@@ -115,8 +119,10 @@ typedef struct Arr_TgNodePtr
(Arr_TgNodePtr *) NewVarray(ARR_TgNodePtr_INITIAL_SIZE, sizeof(TgNodePtr))
(Arr_TgNodePtr *) NewVarray(ARR_TgNodePtr_INITIAL_SIZE, sizeof(TgNodePtr))
#define enlargeArr_TgNodePtr(A, I) \
#define enlargeArr_TgNodePtr(A, I) \
(A)->size += (I); \
( \
(A)->val = (TgNodePtr *) realloc((A)->val, (A)->valSize * (A)->size)
(A)->size += (I), \
(A)->val = (TgNodePtr *) realloc((A)->val, (A)->valSize * (A)->size) \
)
#define addArr_TgNodePtr(A, V) \
#define addArr_TgNodePtr(A, V) \
AppendVarray((Varray *) (A), (void *) (V), (CopyingFunct) copyTgNodePtr)
AppendVarray((Varray *) (A), (void *) (V), (CopyingFunct) copyTgNodePtr)
...
...
src/backend/tioga/Varray.h
View file @
27db9ecd
...
@@ -23,9 +23,11 @@ typedef void (*CopyingFunct) (void *from, void *to);
...
@@ -23,9 +23,11 @@ typedef void (*CopyingFunct) (void *from, void *to);
#define VARRAY_INITIAL_SIZE 32
#define VARRAY_INITIAL_SIZE 32
#define ENLARGE_VARRAY(ARRAY, INC) \
#define ENLARGE_VARRAY(ARRAY, INC) \
(ARRAY)->maxObj += (INC); \
( \
(ARRAY)->maxObj += (INC), \
(ARRAY)->val = (void *) realloc((ARRAY)->val, \
(ARRAY)->val = (void *) realloc((ARRAY)->val, \
(ARRAY)->size * (ARRAY)->maxObj)
(ARRAY)->size * (ARRAY)->maxObj) \
)
#define VARRAY_NTH(VAL, SIZE, N) (((char *) (VAL)) + (SIZE) * (N))
#define VARRAY_NTH(VAL, SIZE, N) (((char *) (VAL)) + (SIZE) * (N))
...
...
src/backend/utils/adt/date.c
View file @
27db9ecd
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.2
4 1998/02/26 04:36:57
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.2
5 1998/06/15 18:39:34
momjian Exp $
*
*
* NOTES
* NOTES
* This code is actually (almost) unused.
* This code is actually (almost) unused.
...
@@ -187,8 +187,11 @@ reltimeout(int32 time)
...
@@ -187,8 +187,11 @@ reltimeout(int32 time)
}
/* reltimeout() */
}
/* reltimeout() */
#define TMODULO(t,q,u) {q = (t / u); \
#define TMODULO(t,q,u) \
if (q != 0) t -= (q * u);}
do { \
q = (t / u); \
if (q != 0) t -= (q * u); \
} while(0)
static
void
static
void
reltime2tm
(
int32
time
,
struct
tm
*
tm
)
reltime2tm
(
int32
time
,
struct
tm
*
tm
)
...
...
src/backend/utils/adt/dt.c
View file @
27db9ecd
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.5
3 1998/05/09 22:38:18 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.5
4 1998/06/15 18:39:37 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -66,8 +66,12 @@ char *days[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
...
@@ -66,8 +66,12 @@ char *days[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
/* TMODULO()
/* TMODULO()
* Macro to replace modf(), which is broken on some platforms.
* Macro to replace modf(), which is broken on some platforms.
*/
*/
#define TMODULO(t,q,u) {q = ((t < 0)? ceil(t / u): floor(t / u)); \
#define TMODULO(t,q,u) \
if (q != 0) t -= rint(q * u);}
do { \
q = ((t < 0)? ceil(t / u): floor(t / u)); \
if (q != 0) \
t -= rint(q * u); \
} while(0)
static
void
GetEpochTime
(
struct
tm
*
tm
);
static
void
GetEpochTime
(
struct
tm
*
tm
);
...
...
src/backend/utils/cache/catcache.c
View file @
27db9ecd
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.2
7 1998/04/26 04:08:01
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.2
8 1998/06/15 18:39:40
momjian Exp $
*
*
* Notes:
* Notes:
* XXX This needs to use exception.h to handle recovery when
* XXX This needs to use exception.h to handle recovery when
...
@@ -96,13 +96,17 @@ static long eqproc[] = {
...
@@ -96,13 +96,17 @@ static long eqproc[] = {
*/
*/
#ifdef CACHEDEBUG
#ifdef CACHEDEBUG
#define CatalogCacheInitializeCache_DEBUG1 \
#define CatalogCacheInitializeCache_DEBUG1 \
do { \
elog(DEBUG, "CatalogCacheInitializeCache: cache @%08lx", cache); \
elog(DEBUG, "CatalogCacheInitializeCache: cache @%08lx", cache); \
if (relation) \
if (relation) \
elog(DEBUG, "CatalogCacheInitializeCache: called w/relation(inval)"); \
elog(DEBUG, "CatalogCacheInitializeCache: called w/relation(inval)"); \
else \
else \
elog(DEBUG, "CatalogCacheInitializeCache: called w/relname %s", \
elog(DEBUG, "CatalogCacheInitializeCache: called w/relname %s", \
cache->cc_relname)
cache->cc_relname) \
} while(0)
#define CatalogCacheInitializeCache_DEBUG2 \
#define CatalogCacheInitializeCache_DEBUG2 \
do { \
if (cache->cc_key[i] > 0) { \
if (cache->cc_key[i] > 0) { \
elog(DEBUG, "CatalogCacheInitializeCache: load %d/%d w/%d, %d", \
elog(DEBUG, "CatalogCacheInitializeCache: load %d/%d w/%d, %d", \
i+1, cache->cc_nkeys, cache->cc_key[i], \
i+1, cache->cc_nkeys, cache->cc_key[i], \
...
@@ -110,7 +114,9 @@ static long eqproc[] = {
...
@@ -110,7 +114,9 @@ static long eqproc[] = {
} else { \
} else { \
elog(DEBUG, "CatalogCacheInitializeCache: load %d/%d w/%d", \
elog(DEBUG, "CatalogCacheInitializeCache: load %d/%d w/%d", \
i+1, cache->cc_nkeys, cache->cc_key[i]); \
i+1, cache->cc_nkeys, cache->cc_key[i]); \
}
} \
} while(0)
#else
#else
#define CatalogCacheInitializeCache_DEBUG1
#define CatalogCacheInitializeCache_DEBUG1
#define CatalogCacheInitializeCache_DEBUG2
#define CatalogCacheInitializeCache_DEBUG2
...
@@ -654,16 +660,20 @@ SystemCacheRelationFlushed(Oid relId)
...
@@ -654,16 +660,20 @@ SystemCacheRelationFlushed(Oid relId)
*/
*/
#ifdef CACHEDEBUG
#ifdef CACHEDEBUG
#define InitSysCache_DEBUG1 \
#define InitSysCache_DEBUG1 \
elog(DEBUG, "InitSysCache: rid=%d id=%d nkeys=%d size=%d\n", \
do { \
cp->relationId, cp->id, cp->cc_nkeys, cp->cc_size); \
elog(DEBUG, "InitSysCache: rid=%d id=%d nkeys=%d size=%d\n", \
for (i = 0; i < nkeys; i += 1) { \
cp->relationId, cp->id, cp->cc_nkeys, cp->cc_size); \
elog(DEBUG, "InitSysCache: key=%d len=%d skey=[%d %d %d %d]\n", \
for (i = 0; i < nkeys; i += 1) \
cp->cc_key[i], cp->cc_klen[i], \
{ \
cp->cc_skey[i].sk_flags, \
elog(DEBUG, "InitSysCache: key=%d len=%d skey=[%d %d %d %d]\n", \
cp->cc_skey[i].sk_attno, \
cp->cc_key[i], cp->cc_klen[i], \
cp->cc_skey[i].sk_procedure, \
cp->cc_skey[i].sk_flags, \
cp->cc_skey[i].sk_argument); \
cp->cc_skey[i].sk_attno, \
}
cp->cc_skey[i].sk_procedure, \
cp->cc_skey[i].sk_argument); \
} \
} while(0)
#else
#else
#define InitSysCache_DEBUG1
#define InitSysCache_DEBUG1
#endif
#endif
...
...
src/backend/utils/cache/relcache.c
View file @
27db9ecd
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.3
8 1998/04/27 04:07:2
0 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.3
9 1998/06/15 18:39:4
0 momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -157,86 +157,80 @@ typedef struct relnamecacheent
...
@@ -157,86 +157,80 @@ typedef struct relnamecacheent
* -----------------
* -----------------
*/
*/
#define RelationCacheInsert(RELATION) \
#define RelationCacheInsert(RELATION) \
{ RelIdCacheEnt *idhentry; RelNameCacheEnt *namehentry; \
do { \
char *relname; Oid reloid; bool found; \
RelIdCacheEnt *idhentry; RelNameCacheEnt *namehentry; \
relname = (RELATION->rd_rel->relname).data; \
char *relname; Oid reloid; bool found; \
namehentry = (RelNameCacheEnt*)hash_search(RelationNameCache, \
relname = (RELATION->rd_rel->relname).data; \
relname, \
namehentry = (RelNameCacheEnt*)hash_search(RelationNameCache, \
HASH_ENTER, \
relname, \
&found); \
if (namehentry == NULL) { \
elog(FATAL, "can't insert into relation descriptor cache"); \
} \
if (found && !IsBootstrapProcessingMode()) { \
/* used to give notice -- now just keep quiet */
; \
} \
namehentry->reldesc = RELATION; \
reloid = RELATION->rd_id; \
idhentry = (RelIdCacheEnt*)hash_search(RelationIdCache, \
(char *)&reloid, \
HASH_ENTER, \
HASH_ENTER, \
&found); \
&found); \
if (idhentry == NULL) { \
if (namehentry == NULL) \
elog(FATAL, "can't insert into relation descriptor cache"); \
elog(FATAL, "can't insert into relation descriptor cache"); \
} \
if (found && !IsBootstrapProcessingMode()) \
if (found && !IsBootstrapProcessingMode()) { \
/* used to give notice -- now just keep quiet */
; \
/* used to give notice -- now just keep quiet */
; \
namehentry->reldesc = RELATION; \
} \
reloid = RELATION->rd_id; \
idhentry->reldesc = RELATION; \
idhentry = (RelIdCacheEnt*)hash_search(RelationIdCache, \
}
(char *)&reloid, \
HASH_ENTER, \
&found); \
if (idhentry == NULL) \
elog(FATAL, "can't insert into relation descriptor cache"); \
if (found && !IsBootstrapProcessingMode()) \
/* used to give notice -- now just keep quiet */
; \
idhentry->reldesc = RELATION; \
} while(0)
#define RelationNameCacheLookup(NAME, RELATION) \
#define RelationNameCacheLookup(NAME, RELATION) \
{ RelNameCacheEnt *hentry; bool found; \
do { \
hentry = (RelNameCacheEnt*)hash_search(RelationNameCache, \
RelNameCacheEnt *hentry; bool found; \
(char *)NAME,HASH_FIND,&found); \
hentry = (RelNameCacheEnt*)hash_search(RelationNameCache, \
if (hentry == NULL) { \
(char *)NAME,HASH_FIND,&found); \
elog(FATAL, "error in CACHE"); \
if (hentry == NULL) \
} \
elog(FATAL, "error in CACHE"); \
if (found) { \
if (found) \
RELATION = hentry->reldesc; \
RELATION = hentry->reldesc; \
} \
else \
else { \
RELATION = NULL; \
RELATION = NULL; \
} while(0)
} \
}
#define RelationIdCacheLookup(ID, RELATION) \
#define RelationIdCacheLookup(ID, RELATION) \
do { \
{ RelIdCacheEnt *hentry; bool found; \
RelIdCacheEnt *hentry; \
hentry = (RelIdCacheEnt*)hash_search(RelationIdCache, \
bool found; \
(char *)&(ID),HASH_FIND, &found); \
hentry = (RelIdCacheEnt*)hash_search(RelationIdCache, \
if (hentry == NULL) { \
(char *)&(ID),HASH_FIND, &found); \
elog(FATAL, "error in CACHE"); \
if (hentry == NULL) \
} \
elog(FATAL, "error in CACHE"); \
if (found) { \
if (found) \
RELATION = hentry->reldesc; \
RELATION = hentry->reldesc; \
} \
else \
else { \
RELATION = NULL; \
RELATION = NULL; \
} while(0)
} \
}
#define RelationCacheDelete(RELATION) \
#define RelationCacheDelete(RELATION) \
do { \
{ RelNameCacheEnt *namehentry; RelIdCacheEnt *idhentry; \
RelNameCacheEnt *namehentry; RelIdCacheEnt *idhentry; \
char *relname; Oid reloid; bool found; \
char *relname; Oid reloid; bool found; \
relname = (RELATION->rd_rel->relname).data; \
relname = (RELATION->rd_rel->relname).data; \
namehentry = (RelNameCacheEnt*)hash_search(RelationNameCache, \
namehentry = (RelNameCacheEnt*)hash_search(RelationNameCache, \
relname, \
relname, \
HASH_REMOVE, \
HASH_REMOVE, \
&found); \
&found); \
if (namehentry == NULL) { \
if (namehentry == NULL) \
elog(FATAL, "can't delete from relation descriptor cache"); \
elog(FATAL, "can't delete from relation descriptor cache"); \
} \
if (!found) \
if (!found) { \
elog(NOTICE, "trying to delete a reldesc that does not exist."); \
elog(NOTICE, "trying to delete a reldesc that does not exist."); \
reloid = RELATION->rd_id; \
} \
idhentry = (RelIdCacheEnt*)hash_search(RelationIdCache, \
reloid = RELATION->rd_id; \
(char *)&reloid, \
idhentry = (RelIdCacheEnt*)hash_search(RelationIdCache, \
HASH_REMOVE, &found); \
(char *)&reloid, \
if (idhentry == NULL) \
HASH_REMOVE, &found); \
elog(FATAL, "can't delete from relation descriptor cache"); \
if (idhentry == NULL) { \
if (!found) \
elog(FATAL, "can't delete from relation descriptor cache"); \
elog(NOTICE, "trying to delete a reldesc that does not exist."); \
} \
} while(0)
if (!found) { \
elog(NOTICE, "trying to delete a reldesc that does not exist."); \
} \
}
/* non-export function prototypes */
/* non-export function prototypes */
static
void
static
void
...
...
src/backend/utils/mmgr/portalmem.c
View file @
27db9ecd
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.1
0 1998/02/26 04:38:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.1
1 1998/06/15 18:39:44
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -125,41 +125,49 @@ typedef struct portalhashent
...
@@ -125,41 +125,49 @@ typedef struct portalhashent
static
HTAB
*
PortalHashTable
=
NULL
;
static
HTAB
*
PortalHashTable
=
NULL
;
#define PortalHashTableLookup(NAME, PORTAL) \
#define PortalHashTableLookup(NAME, PORTAL) \
{ PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
do { \
MemSet(key, 0, MAX_PORTALNAME_LEN); \
PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
sprintf(key, "%s", NAME); \
\
hentry = (PortalHashEnt*)hash_search(PortalHashTable, \
MemSet(key, 0, MAX_PORTALNAME_LEN); \
key, HASH_FIND, &found); \
sprintf(key, "%s", NAME); \
if (hentry == NULL) \
hentry = (PortalHashEnt*)hash_search(PortalHashTable, \
elog(FATAL, "error in PortalHashTable"); \
key, HASH_FIND, &found); \
if (found) \
if (hentry == NULL) \
PORTAL = hentry->portal; \
elog(FATAL, "error in PortalHashTable"); \
else \
if (found) \
PORTAL = NULL; \
PORTAL = hentry->portal; \
}
else \
PORTAL = NULL; \
} while(0)
#define PortalHashTableInsert(PORTAL) \
#define PortalHashTableInsert(PORTAL) \
{ PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
do { \
MemSet(key, 0, MAX_PORTALNAME_LEN); \
PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
sprintf(key, "%s", PORTAL->name); \
\
hentry = (PortalHashEnt*)hash_search(PortalHashTable, \
MemSet(key, 0, MAX_PORTALNAME_LEN); \
key, HASH_ENTER, &found); \
sprintf(key, "%s", PORTAL->name); \
if (hentry == NULL) \
hentry = (PortalHashEnt*)hash_search(PortalHashTable, \
elog(FATAL, "error in PortalHashTable"); \
key, HASH_ENTER, &found); \
if (found) \
if (hentry == NULL) \
elog(NOTICE, "trying to insert a portal name that exists."); \
elog(FATAL, "error in PortalHashTable"); \
hentry->portal = PORTAL; \
if (found) \
}
elog(NOTICE, "trying to insert a portal name that exists."); \
hentry->portal = PORTAL; \
} while(0)
#define PortalHashTableDelete(PORTAL) \
#define PortalHashTableDelete(PORTAL) \
{ PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
{ \
MemSet(key, 0, MAX_PORTALNAME_LEN); \
PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
sprintf(key, "%s", PORTAL->name); \
\
hentry = (PortalHashEnt*)hash_search(PortalHashTable, \
MemSet(key, 0, MAX_PORTALNAME_LEN); \
key, HASH_REMOVE, &found); \
sprintf(key, "%s", PORTAL->name); \
if (hentry == NULL) \
hentry = (PortalHashEnt*)hash_search(PortalHashTable, \
elog(FATAL, "error in PortalHashTable"); \
key, HASH_REMOVE, &found); \
if (!found) \
if (hentry == NULL) \
elog(NOTICE, "trying to delete portal name that does not exist."); \
elog(FATAL, "error in PortalHashTable"); \
}
if (!found) \
elog(NOTICE, "trying to delete portal name that does not exist."); \
} while(0)
static
GlobalMemory
PortalMemory
=
NULL
;
static
GlobalMemory
PortalMemory
=
NULL
;
static
char
PortalMemoryName
[]
=
"Portal"
;
static
char
PortalMemoryName
[]
=
"Portal"
;
...
...
src/backend/utils/sort/psort.c
View file @
27db9ecd
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.
39 1998/02/26 04:38:29
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.
40 1998/06/15 18:39:45
momjian Exp $
*
*
* NOTES
* NOTES
* Sorts the first relation into the second relation.
* Sorts the first relation into the second relation.
...
@@ -222,20 +222,24 @@ inittapes(Sort *node)
...
@@ -222,20 +222,24 @@ inittapes(Sort *node)
*/
*/
#define PUTTUP(NODE, TUP, FP) do {\
#define PUTTUP(NODE, TUP, FP) \
((Psortstate *)NODE->psortstate)->BytesWritten += (TUP)->t_len; \
( \
fwrite((char *)TUP, (TUP)->t_len, 1, FP); \
((Psortstate *)NODE->psortstate)->BytesWritten += (TUP)->t_len, \
fwrite((char *)&((TUP)->t_len), sizeof (tlendummy), 1, FP); \
fwrite((char *)TUP, (TUP)->t_len, 1, FP), \
} while (0)
fwrite((char *)&((TUP)->t_len), sizeof (tlendummy), 1, FP) \
)
#define ENDRUN(FP) fwrite((char *)&tlenzero, sizeof (tlenzero), 1, FP)
#define ENDRUN(FP) fwrite((char *)&tlenzero, sizeof (tlenzero), 1, FP)
#define GETLEN(LEN, FP) fread((char *)&(LEN), sizeof (tlenzero), 1, FP)
#define GETLEN(LEN, FP) fread((char *)&(LEN), sizeof (tlenzero), 1, FP)
#define ALLOCTUP(LEN) ((HeapTuple)palloc((unsigned)LEN))
#define ALLOCTUP(LEN) ((HeapTuple)palloc((unsigned)LEN))
#define GETTUP(NODE, TUP, LEN, FP) do {\
#define GETTUP(NODE, TUP, LEN, FP) \
IncrProcessed(); \
( \
((Psortstate *)NODE->psortstate)->BytesRead += (LEN) - sizeof (tlenzero); \
IncrProcessed(), \
fread((char *)(TUP) + sizeof (tlenzero), (LEN) - sizeof (tlenzero), 1, FP); \
((Psortstate *)NODE->psortstate)->BytesRead += (LEN) - sizeof (tlenzero), \
fread((char *)&tlendummy, sizeof (tlendummy), 1, FP); \
fread((char *)(TUP) + sizeof (tlenzero), (LEN) - sizeof (tlenzero), 1, FP), \
} while (0)
fread((char *)&tlendummy, sizeof (tlendummy), 1, FP) \
)
#define SETTUPLEN(TUP, LEN) (TUP)->t_len = LEN
#define SETTUPLEN(TUP, LEN) (TUP)->t_len = LEN
/*
/*
...
...
src/bin/psql/psqlHelp.h
View file @
27db9ecd
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: psqlHelp.h,v 1.4
2 1998/03/30 19:04:53
momjian Exp $
* $Id: psqlHelp.h,v 1.4
3 1998/06/15 18:39:49
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -26,8 +26,8 @@ static struct _helpStruct QL_HELP[] = {
...
@@ -26,8 +26,8 @@ static struct _helpStruct QL_HELP[] = {
"abort [transaction];"
},
"abort [transaction];"
},
{
"alter table"
,
{
"alter table"
,
"add/rename attributes, rename tables"
,
"add/rename attributes, rename tables"
,
"
\t
alter table <class_name> [*] add column <attr> <type>
;
\n
\
"
\t
alter table <class_name> [*] add column <attr> <type>
\n
\
\t
alter table <class_name> [*] rename [column] <attr1> to <attr2>
;
\n
\
\t
alter table <class_name> [*] rename [column] <attr1> to <attr2>
\n
\
\t
alter table <class_name1> rename to <class_name2>"
},
\t
alter table <class_name1> rename to <class_name2>"
},
{
"alter user"
,
{
"alter user"
,
"alter system information for a user"
,
"alter system information for a user"
,
...
@@ -128,7 +128,7 @@ static struct _helpStruct QL_HELP[] = {
...
@@ -128,7 +128,7 @@ static struct _helpStruct QL_HELP[] = {
"create a new trigger"
,
"create a new trigger"
,
"create trigger <trigger_name> after|before event1 [or event2 [or event3] ]
\n
\
"create trigger <trigger_name> after|before event1 [or event2 [or event3] ]
\n
\
\t
on <class_name> for each row|statement
\n
\
\t
on <class_name> for each row|statement
\n
\
\t
execute procedure <func_name> ([arguments])
;
\n
\
\t
execute procedure <func_name> ([arguments])
\n
\
\n
\
\n
\
\t
eventX is one of INSERT, DELETE, UPDATE"
},
\t
eventX is one of INSERT, DELETE, UPDATE"
},
{
"create type"
,
{
"create type"
,
...
@@ -238,7 +238,7 @@ static struct _helpStruct QL_HELP[] = {
...
@@ -238,7 +238,7 @@ static struct _helpStruct QL_HELP[] = {
{
"insert"
,
{
"insert"
,
"insert tuples"
,
"insert tuples"
,
"insert into <class_name> [(<attr1>...<attrN>)]
\n
\
"insert into <class_name> [(<attr1>...<attrN>)]
\n
\
\t
values (<expr1>...<exprN>)
;
|
\n
\
\t
values (<expr1>...<exprN>) |
\n
\
\t
select [distinct]
\n
\
\t
select [distinct]
\n
\
\t
<expr1>,...<exprN>
\n
\
\t
<expr1>,...<exprN>
\n
\
\t
[from <from_clause>]
\n
\
\t
[from <from_clause>]
\n
\
...
...
src/include/access/attnum.h
View file @
27db9ecd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: attnum.h,v 1.
6 1997/09/08 02:34:0
2 momjian Exp $
* $Id: attnum.h,v 1.
7 1998/06/15 18:39:5
2 momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -47,8 +47,10 @@ typedef int16 AttrNumber;
...
@@ -47,8 +47,10 @@ typedef int16 AttrNumber;
* Assumes the attribute number is for an user defined attribute.
* Assumes the attribute number is for an user defined attribute.
*/
*/
#define AttrNumberGetAttrOffset(attNum) \
#define AttrNumberGetAttrOffset(attNum) \
(AssertMacro(AttrNumberIsForUserDefinedAttr(attNum)) ? \
( \
((attNum - 1)) : 0)
AssertMacro(AttrNumberIsForUserDefinedAttr(attNum)), \
((attNum) - 1) \
)
/*
/*
* AttributeOffsetGetAttributeNumber --
* AttributeOffsetGetAttributeNumber --
...
...
src/include/access/heapam.h
View file @
27db9ecd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: heapam.h,v 1.3
2 1998/06/14 01:34:07
momjian Exp $
* $Id: heapam.h,v 1.3
3 1998/06/15 18:39:53
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -92,43 +92,37 @@ typedef HeapAccessStatisticsData *HeapAccessStatistics;
...
@@ -92,43 +92,37 @@ typedef HeapAccessStatisticsData *HeapAccessStatistics;
#define fastgetattr(tup, attnum, tupleDesc, isnull) \
#define fastgetattr(tup, attnum, tupleDesc, isnull) \
( \
( \
AssertMacro((attnum) > 0) ? \
AssertMacro((attnum) > 0), \
((isnull) ? (*(isnull) = false) : (dummyret)NULL), \
HeapTupleNoNulls(tup) ? \
( \
( \
((
isnull) ? (*(isnull) = false) : (dummyret)NULL),
\
((
tupleDesc)->attrs[(attnum)-1]->attcacheoff != -1 ||
\
HeapTupleNoNulls(tup
) ? \
(attnum) == 1
) ? \
( \
( \
((tupleDesc)->attrs[(attnum)-1]->attcacheoff != -1 || \
(Datum)fetchatt(&((tupleDesc)->attrs[(attnum)-1]), \
(attnum) == 1) ? \
(char *) (tup) + (tup)->t_hoff + \
( \
( \
(Datum)fetchatt(&((tupleDesc)->attrs[(attnum)-1]), \
((attnum) != 1) ? \
(char *) (tup) + (tup)->t_hoff + \
(tupleDesc)->attrs[(attnum)-1]->attcacheoff \
( \
: \
((attnum) != 1) ? \
0 \
(tupleDesc)->attrs[(attnum)-1]->attcacheoff \
: \
0 \
) \
) \
) \
) \
) \
: \
nocachegetattr((tup), (attnum), (tupleDesc), (isnull)) \
) \
) \
: \
: \
( \
nocachegetattr((tup), (attnum), (tupleDesc), (isnull)) \
att_isnull((attnum)-1, (tup)->t_bits) ? \
( \
((isnull) ? (*(isnull) = true) : (dummyret)NULL), \
(Datum)NULL \
) \
: \
( \
nocachegetattr((tup), (attnum), (tupleDesc), (isnull)) \
) \
) \
) \
) \
: \
: \
( \
( \
(Datum)NULL \
att_isnull((attnum)-1, (tup)->t_bits) ? \
( \
((isnull) ? (*(isnull) = true) : (dummyret)NULL), \
(Datum)NULL \
) \
: \
( \
nocachegetattr((tup), (attnum), (tupleDesc), (isnull)) \
) \
) \
) \
)
)
...
@@ -208,39 +202,33 @@ static Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
...
@@ -208,39 +202,33 @@ static Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
( \
( \
AssertMacro((tup) != NULL && \
AssertMacro((tup) != NULL && \
(attnum) > FirstLowInvalidHeapAttributeNumber && \
(attnum) > FirstLowInvalidHeapAttributeNumber && \
(attnum) != 0) ? \
(attnum) != 0), \
((attnum) > (int) (tup)->t_natts) ? \
( \
( \
((attnum) > (int) (tup)->t_natts) ? \
((isnull) ? (*(isnull) = true) : (dummyret)NULL), \
(Datum)NULL \
) \
: \
( \
((attnum) > 0) ? \
( \
( \
((isnull) ? (*(isnull) = true) : (dummyret)NULL), \
fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \
(Datum)NULL \
) \
) \
: \
: \
( \
( \
((attnum) > 0) ? \
((isnull) ? (*(isnull) = false) : (dummyret)NULL), \
((attnum) == SelfItemPointerAttributeNumber) ? \
( \
( \
fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \
(Datum)((char *)(tup) + \
heap_sysoffset[-SelfItemPointerAttributeNumber-1]) \
) \
) \
: \
: \
( \
( \
((isnull) ? (*(isnull) = false) : (dummyret)NULL), \
(Datum)*(unsigned int *) \
((attnum) == SelfItemPointerAttributeNumber) ? \
((char *)(tup) + heap_sysoffset[-(attnum)-1]) \
( \
(Datum)((char *)(tup) + \
heap_sysoffset[-SelfItemPointerAttributeNumber-1]) \
) \
: \
( \
(Datum)*(unsigned int *) \
((char *)(tup) + heap_sysoffset[-(attnum)-1]) \
) \
) \
) \
) \
) \
) \
) \
: \
( \
(Datum)NULL \
) \
)
)
extern
HeapAccessStatistics
heap_access_stats
;
/* in stats.c */
extern
HeapAccessStatistics
heap_access_stats
;
/* in stats.c */
...
...
src/include/access/itup.h
View file @
27db9ecd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: itup.h,v 1.1
3 1998/02/26 04:40:19
momjian Exp $
* $Id: itup.h,v 1.1
4 1998/06/15 18:39:54
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -118,49 +118,43 @@ typedef struct PredInfo
...
@@ -118,49 +118,43 @@ typedef struct PredInfo
*/
*/
#define index_getattr(tup, attnum, tupleDesc, isnull) \
#define index_getattr(tup, attnum, tupleDesc, isnull) \
( \
( \
AssertMacro(PointerIsValid(isnull) && (attnum) > 0) ? \
AssertMacro(PointerIsValid(isnull) && (attnum) > 0), \
*(isnull) = false, \
IndexTupleNoNulls(tup) ? \
( \
( \
*(isnull) = false,
\
((tupleDesc)->attrs[(attnum)-1]->attcacheoff != -1 ||
\
IndexTupleNoNulls(tup
) ? \
(attnum) == 1
) ? \
( \
( \
(
(tupleDesc)->attrs[(attnum)-1]->attcacheoff != -1 ||
\
(
Datum)fetchatt(&((tupleDesc)->attrs[(attnum)-1]),
\
(attnum) == 1) ?
\
(char *) (tup) +
\
( \
( \
(Datum)fetchatt(&((tupleDesc)->attrs[(attnum)-1]), \
IndexTupleHasMinHeader(tup) ? \
(char *) (tup) + \
sizeof (*(tup)) \
( \
: \
IndexTupleHasMinHeader(tup) ? \
IndexInfoFindDataOffset((tup)->t_info) \
sizeof (*(tup)) \
) + \
: \
( \
IndexInfoFindDataOffset((tup)->t_info) \
((attnum) != 1) ? \
) + \
(tupleDesc)->attrs[(attnum)-1]->attcacheoff \
( \
: \
((attnum) != 1) ? \
0 \
(tupleDesc)->attrs[(attnum)-1]->attcacheoff \
: \
0 \
) \
) \
) \
) \
) \
: \
nocache_index_getattr((tup), (attnum), (tupleDesc), (isnull)) \
) \
) \
: \
: \
( \
nocache_index_getattr((tup), (attnum), (tupleDesc), (isnull)) \
(att_isnull((attnum)-1, (char *)(tup) + sizeof(*(tup)))) ? \
( \
*(isnull) = true, \
(Datum)NULL \
) \
: \
( \
nocache_index_getattr((tup), (attnum), (tupleDesc), (isnull)) \
) \
) \
) \
) \
: \
: \
( \
( \
(Datum)NULL \
(att_isnull((attnum)-1, (char *)(tup) + sizeof(*(tup)))) ? \
( \
*(isnull) = true, \
(Datum)NULL \
) \
: \
( \
nocache_index_getattr((tup), (attnum), (tupleDesc), (isnull)) \
) \
) \
) \
)
)
...
...
src/include/c.h
View file @
27db9ecd
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: c.h,v 1.
39 1998/04/06 17:27:49
momjian Exp $
* $Id: c.h,v 1.
40 1998/06/15 18:39:51
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -624,7 +624,7 @@ typedef struct Exception
...
@@ -624,7 +624,7 @@ typedef struct Exception
Trap(!(condition), FailedAssertion)
Trap(!(condition), FailedAssertion)
#define AssertMacro(condition) \
#define AssertMacro(condition) \
TrapMacro(!(condition), FailedAssertion)
(void)
TrapMacro(!(condition), FailedAssertion)
#define AssertArg(condition) \
#define AssertArg(condition) \
Trap(!(condition), BadArg)
Trap(!(condition), BadArg)
...
...
src/include/executor/execdebug.h
View file @
27db9ecd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: execdebug.h,v 1.
4 1997/09/08 02:36:12
momjian Exp $
* $Id: execdebug.h,v 1.
5 1998/06/15 18:39:55
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -193,14 +193,15 @@ extern int NIndexTupleInserted;
...
@@ -193,14 +193,15 @@ extern int NIndexTupleInserted;
#define IncrIndexProcessed() NIndexTupleProcessed++
#define IncrIndexProcessed() NIndexTupleProcessed++
#define IncrIndexInserted() NIndexTupleInserted++
#define IncrIndexInserted() NIndexTupleInserted++
#else
#else
#define IncrRetrieved()
/* stop compiler warnings */
#define IncrAppended()
#define IncrRetrieved() (void)(0)
#define IncrDeleted()
#define IncrAppended() (void)(0)
#define IncrReplaced()
#define IncrDeleted() (void)(0)
#define IncrInserted()
#define IncrReplaced() (void)(0)
#define IncrProcessed()
#define IncrInserted() (void)(0)
#define IncrIndexProcessed()
#define IncrProcessed() (void)(0)
#define IncrIndexInserted()
#define IncrIndexProcessed() (void)(0)
#define IncrIndexInserted() (void)(0)
#endif
/* EXEC_TUPLECOUNT */
#endif
/* EXEC_TUPLECOUNT */
/* ----------------
/* ----------------
...
...
src/include/storage/block.h
View file @
27db9ecd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: block.h,v 1.
5 1997/09/08 20:58:59
momjian Exp $
* $Id: block.h,v 1.
6 1998/06/15 18:40:00
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -79,19 +79,23 @@ typedef BlockIdData *BlockId; /* block identifier */
...
@@ -79,19 +79,23 @@ typedef BlockIdData *BlockId; /* block identifier */
* Sets a block identifier to the specified value.
* Sets a block identifier to the specified value.
*/
*/
#define BlockIdSet(blockId, blockNumber) \
#define BlockIdSet(blockId, blockNumber) \
Assert(PointerIsValid(blockId)); \
( \
(blockId)->bi_hi = (blockNumber) >> 16; \
AssertMacro(PointerIsValid(blockId)), \
(blockId)->bi_lo = (blockNumber) & 0xffff
(blockId)->bi_hi = (blockNumber) >> 16, \
(blockId)->bi_lo = (blockNumber) & 0xffff \
)
/*
/*
* BlockIdCopy --
* BlockIdCopy --
* Copy a block identifier.
* Copy a block identifier.
*/
*/
#define BlockIdCopy(toBlockId, fromBlockId) \
#define BlockIdCopy(toBlockId, fromBlockId) \
Assert(PointerIsValid(toBlockId)); \
( \
Assert(PointerIsValid(fromBlockId)); \
AssertMacro(PointerIsValid(toBlockId)), \
(toBlockId)->bi_hi = (fromBlockId)->bi_hi; \
AssertMacro(PointerIsValid(fromBlockId)), \
(toBlockId)->bi_lo = (fromBlockId)->bi_lo
(toBlockId)->bi_hi = (fromBlockId)->bi_hi, \
(toBlockId)->bi_lo = (fromBlockId)->bi_lo \
)
/*
/*
* BlockIdEquals --
* BlockIdEquals --
...
@@ -106,8 +110,9 @@ typedef BlockIdData *BlockId; /* block identifier */
...
@@ -106,8 +110,9 @@ typedef BlockIdData *BlockId; /* block identifier */
* Retrieve the block number from a block identifier.
* Retrieve the block number from a block identifier.
*/
*/
#define BlockIdGetBlockNumber(blockId) \
#define BlockIdGetBlockNumber(blockId) \
(AssertMacro(BlockIdIsValid(blockId)) ? \
( \
(BlockNumber) (((blockId)->bi_hi << 16) | ((uint16) (blockId)->bi_lo)) : \
AssertMacro(BlockIdIsValid(blockId)), \
(BlockNumber) InvalidBlockNumber)
(BlockNumber) (((blockId)->bi_hi << 16) | ((uint16) (blockId)->bi_lo)) \
)
#endif
/* BLOCK_H */
#endif
/* BLOCK_H */
src/include/storage/buf_internals.h
View file @
27db9ecd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: buf_internals.h,v 1.2
1 1998/02/26 04:43:2
1 momjian Exp $
* $Id: buf_internals.h,v 1.2
2 1998/06/15 18:40:0
1 momjian Exp $
*
*
* NOTE
* NOTE
* If BUFFERPAGE0 is defined, then 0 will be used as a
* If BUFFERPAGE0 is defined, then 0 will be used as a
...
@@ -55,26 +55,32 @@ struct buftag
...
@@ -55,26 +55,32 @@ struct buftag
BlockNumber
blockNum
;
/* blknum relative to begin of reln */
BlockNumber
blockNum
;
/* blknum relative to begin of reln */
};
};
#define CLEAR_BUFFERTAG(a)\
#define CLEAR_BUFFERTAG(a) \
(a)->relId.dbId = InvalidOid; \
( \
(a)->relId.relId = InvalidOid; \
(a)->relId.dbId = InvalidOid, \
(a)->blockNum = InvalidBlockNumber
(a)->relId.relId = InvalidOid, \
(a)->blockNum = InvalidBlockNumber \
)
#define INIT_BUFFERTAG(a,xx_reln,xx_blockNum) \
#define INIT_BUFFERTAG(a,xx_reln,xx_blockNum) \
{ \
( \
(a)->blockNum = xx_blockNum;\
(a)->blockNum = xx_blockNum, \
(a)->relId = RelationGetLRelId(xx_reln); \
(a)->relId = RelationGetLRelId(xx_reln) \
}
)
#ifdef NOT_USED
#ifdef NOT_USED
#define COPY_BUFFERTAG(a,b)\
#define COPY_BUFFERTAG(a,b)
\
{
\
(
\
(a)->blockNum = (b)->blockNum;
\
(a)->blockNum = (b)->blockNum,
\
LRelIdAssign(*(a),*(b));
\
LRelIdAssign(*(a),*(b))
\
}
)
#define EQUAL_BUFFERTAG(a,b) \
#define EQUAL_BUFFERTAG(a,b) \
(((a)->blockNum == (b)->blockNum) &&\
( \
(OID_Equal((a)->relId.relId,(b)->relId.relId)))
((a)->blockNum == (b)->blockNum && \
OID_Equal((a)->relId.relId,(b)->relId.relId)) \
)
#endif
#endif
#define BAD_BUFFER_ID(bid) ((bid<1) || (bid>(NBuffers)))
#define BAD_BUFFER_ID(bid) ((bid<1) || (bid>(NBuffers)))
...
...
src/include/storage/bufmgr.h
View file @
27db9ecd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: bufmgr.h,v 1.
19 1998/04/24 14:43:18
momjian Exp $
* $Id: bufmgr.h,v 1.
20 1998/06/15 18:40:02
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -117,8 +117,7 @@ extern int ShowPinTrace;
...
@@ -117,8 +117,7 @@ extern int ShowPinTrace;
*/
*/
#define BufferGetBlock(buffer) \
#define BufferGetBlock(buffer) \
( \
( \
(void)AssertMacro(BufferIsValid(buffer)), \
AssertMacro(BufferIsValid(buffer)), \
\
BufferIsLocal(buffer) ? \
BufferIsLocal(buffer) ? \
((Block) MAKE_PTR(LocalBufferDescriptors[-(buffer) - 1].data)) \
((Block) MAKE_PTR(LocalBufferDescriptors[-(buffer) - 1].data)) \
: \
: \
...
...
src/include/storage/bufpage.h
View file @
27db9ecd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: bufpage.h,v 1.1
8 1998/04/24 14:43:23
momjian Exp $
* $Id: bufpage.h,v 1.1
9 1998/06/15 18:40:02
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -161,8 +161,10 @@ typedef enum
...
@@ -161,8 +161,10 @@ typedef enum
* Assumes page is valid.
* Assumes page is valid.
*/
*/
#define PageIsUsed(page) \
#define PageIsUsed(page) \
(AssertMacro(PageIsValid(page)) ? \
( \
((bool) (((PageHeader) (page))->pd_lower != 0)) : false)
AssertMacro(PageIsValid(page)), \
((bool) (((PageHeader) (page))->pd_lower != 0)) \
)
/*
/*
* PageIsEmpty --
* PageIsEmpty --
...
@@ -243,9 +245,10 @@ typedef enum
...
@@ -243,9 +245,10 @@ typedef enum
* Assumes page is locked.
* Assumes page is locked.
*/
*/
#define PageGetSpecialPointer(page) \
#define PageGetSpecialPointer(page) \
(AssertMacro(PageIsValid(page)) ? \
( \
(char *) ((char *) (page) + ((PageHeader) (page))->pd_special) \
AssertMacro(PageIsValid(page)), \
: (char *)0 )
(char *) ((char *) (page) + ((PageHeader) (page))->pd_special) \
)
/*
/*
* PageGetItem --
* PageGetItem --
...
@@ -256,9 +259,11 @@ typedef enum
...
@@ -256,9 +259,11 @@ typedef enum
* The semantics may change in the future.
* The semantics may change in the future.
*/
*/
#define PageGetItem(page, itemId) \
#define PageGetItem(page, itemId) \
(AssertMacro(PageIsValid(page)) ? \
( \
AssertMacro((itemId)->lp_flags & LP_USED) ? \
AssertMacro(PageIsValid(page)), \
(Item)(((char *)(page)) + (itemId)->lp_off) : false : false)
AssertMacro((itemId)->lp_flags & LP_USED), \
(Item)(((char *)(page)) + (itemId)->lp_off) \
)
/*
/*
* BufferGetPageSize --
* BufferGetPageSize --
...
@@ -272,7 +277,10 @@ typedef enum
...
@@ -272,7 +277,10 @@ typedef enum
*/
*/
/* XXX dig out of buffer descriptor */
/* XXX dig out of buffer descriptor */
#define BufferGetPageSize(buffer) \
#define BufferGetPageSize(buffer) \
(AssertMacro(BufferIsValid(buffer)) ? (Size)BLCKSZ : false)
( \
AssertMacro(BufferIsValid(buffer)), \
(Size)BLCKSZ \
)
/*
/*
* BufferGetPage --
* BufferGetPage --
...
...
src/include/storage/itemid.h
View file @
27db9ecd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: itemid.h,v 1.
5 1998/01/13 04:05:12 scrappy
Exp $
* $Id: itemid.h,v 1.
6 1998/06/15 18:40:03 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -70,7 +70,9 @@ typedef struct ItemIdData *ItemId;
...
@@ -70,7 +70,9 @@ typedef struct ItemIdData *ItemId;
* Assumes disk item identifier is valid.
* Assumes disk item identifier is valid.
*/
*/
#define ItemIdIsUsed(itemId) \
#define ItemIdIsUsed(itemId) \
(AssertMacro(ItemIdIsValid(itemId)) ? \
( \
(bool) (((itemId)->lp_flags & LP_USED) != 0) : false)
AssertMacro(ItemIdIsValid(itemId)), \
(bool) (((itemId)->lp_flags & LP_USED) != 0) \
)
#endif
/* ITEMID_H */
#endif
/* ITEMID_H */
src/include/storage/itemptr.h
View file @
27db9ecd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: itemptr.h,v 1.
7 1997/09/08 21:54:25
momjian Exp $
* $Id: itemptr.h,v 1.
8 1998/06/15 18:40:03
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -48,60 +48,73 @@ typedef ItemPointerData *ItemPointer;
...
@@ -48,60 +48,73 @@ typedef ItemPointerData *ItemPointer;
* Returns the block number of a disk item pointer.
* Returns the block number of a disk item pointer.
*/
*/
#define ItemPointerGetBlockNumber(pointer) \
#define ItemPointerGetBlockNumber(pointer) \
(AssertMacro(ItemPointerIsValid(pointer)) ? \
( \
BlockIdGetBlockNumber(&(pointer)->ip_blkid) : (BlockNumber) 0)
AssertMacro(ItemPointerIsValid(pointer)), \
BlockIdGetBlockNumber(&(pointer)->ip_blkid) \
)
/*
/*
* ItemPointerGetOffsetNumber --
* ItemPointerGetOffsetNumber --
* Returns the offset number of a disk item pointer.
* Returns the offset number of a disk item pointer.
*/
*/
#define ItemPointerGetOffsetNumber(pointer) \
#define ItemPointerGetOffsetNumber(pointer) \
(AssertMacro(ItemPointerIsValid(pointer)) ? \
( \
(pointer)->ip_posid : \
AssertMacro(ItemPointerIsValid(pointer)), \
InvalidOffsetNumber)
(pointer)->ip_posid \
)
/*
/*
* ItemPointerSet --
* ItemPointerSet --
* Sets a disk item pointer to the specified block and offset.
* Sets a disk item pointer to the specified block and offset.
*/
*/
#define ItemPointerSet(pointer, blockNumber, offNum) \
#define ItemPointerSet(pointer, blockNumber, offNum) \
Assert(PointerIsValid(pointer)); \
( \
BlockIdSet(&((pointer)->ip_blkid), blockNumber); \
AssertMacro(PointerIsValid(pointer)), \
(pointer)->ip_posid = offNum
BlockIdSet(&((pointer)->ip_blkid), blockNumber), \
(pointer)->ip_posid = offNum \
)
/*
/*
* ItemPointerSetBlockNumber --
* ItemPointerSetBlockNumber --
* Sets a disk item pointer to the specified block.
* Sets a disk item pointer to the specified block.
*/
*/
#define ItemPointerSetBlockNumber(pointer, blockNumber) \
#define ItemPointerSetBlockNumber(pointer, blockNumber) \
Assert(PointerIsValid(pointer)); \
( \
BlockIdSet(&((pointer)->ip_blkid), blockNumber)
AssertMacro(PointerIsValid(pointer)), \
BlockIdSet(&((pointer)->ip_blkid), blockNumber) \
)
/*
/*
* ItemPointerSetOffsetNumber --
* ItemPointerSetOffsetNumber --
* Sets a disk item pointer to the specified offset.
* Sets a disk item pointer to the specified offset.
*/
*/
#define ItemPointerSetOffsetNumber(pointer, offsetNumber) \
#define ItemPointerSetOffsetNumber(pointer, offsetNumber) \
AssertMacro(PointerIsValid(pointer)); \
( \
(pointer)->ip_posid = (offsetNumber)
AssertMacro(PointerIsValid(pointer)), \
(pointer)->ip_posid = (offsetNumber) \
)
/*
/*
* ItemPointerCopy --
* ItemPointerCopy --
* Copies the contents of one disk item pointer to another.
* Copies the contents of one disk item pointer to another.
*/
*/
#define ItemPointerCopy(fromPointer, toPointer) \
#define ItemPointerCopy(fromPointer, toPointer) \
Assert(PointerIsValid(toPointer)); \
( \
Assert(PointerIsValid(fromPointer)); \
AssertMacro(PointerIsValid(toPointer)), \
*(toPointer) = *(fromPointer)
AssertMacro(PointerIsValid(fromPointer)), \
*(toPointer) = *(fromPointer) \
)
/*
/*
* ItemPointerSetInvalid --
* ItemPointerSetInvalid --
* Sets a disk item pointer to be invalid.
* Sets a disk item pointer to be invalid.
*/
*/
#define ItemPointerSetInvalid(pointer) \
#define ItemPointerSetInvalid(pointer) \
Assert(PointerIsValid(pointer)); \
( \
BlockIdSet(&((pointer)->ip_blkid), InvalidBlockNumber); \
AssertMacro(PointerIsValid(pointer)), \
(pointer)->ip_posid = InvalidOffsetNumber
BlockIdSet(&((pointer)->ip_blkid), InvalidBlockNumber), \
(pointer)->ip_posid = InvalidOffsetNumber \
)
/* ----------------
/* ----------------
* externs
* externs
...
...
src/include/storage/lock.h
View file @
27db9ecd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: lock.h,v 1.1
1 1998/02/26 04:43:28
momjian Exp $
* $Id: lock.h,v 1.1
2 1998/06/15 18:40:03
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -191,8 +191,10 @@ typedef struct Lock
...
@@ -191,8 +191,10 @@ typedef struct Lock
#define LockGetLock_nHolders(l) l->nHolders
#define LockGetLock_nHolders(l) l->nHolders
#define LockDecrWaitHolders(lock, lockt) \
#define LockDecrWaitHolders(lock, lockt) \
lock->nHolding--; \
( \
lock->holders[lockt]--
lock->nHolding--, \
lock->holders[lockt]-- \
)
#define LockLockTable() SpinAcquire(LockMgrLock);
#define LockLockTable() SpinAcquire(LockMgrLock);
#define UnlockLockTable() SpinRelease(LockMgrLock);
#define UnlockLockTable() SpinRelease(LockMgrLock);
...
...
src/include/storage/s_lock.h
View file @
27db9ecd
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.3
4 1998/05/06 23:25:1
4 momjian Exp $
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.3
5 1998/06/15 18:40:0
4 momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -209,19 +209,22 @@ extern void s_lock(slock_t *lock);
...
@@ -209,19 +209,22 @@ extern void s_lock(slock_t *lock);
#else
/* S_LOCK_DEBUG */
#else
/* S_LOCK_DEBUG */
#define S_LOCK(lock) if (1) { \
#define S_LOCK(lock) \
do { \
int spins = 0; \
int spins = 0; \
while (TAS(lock)) { \
while (TAS(lock)) \
{ \
struct timeval delay; \
struct timeval delay; \
delay.tv_sec = 0; \
delay.tv_sec = 0; \
delay.tv_usec = s_spincycle[spins++ % S_NSPINCYCLE]; \
delay.tv_usec = s_spincycle[spins++ % S_NSPINCYCLE]; \
(void) select(0, NULL, NULL, NULL, &delay); \
(void) select(0, NULL, NULL, NULL, &delay); \
if (spins > S_MAX_BUSY) { \
if (spins > S_MAX_BUSY) \
{ \
/* It's been well over a minute... */
\
/* It's been well over a minute... */
\
s_lock_stuck(lock, __FILE__, __LINE__); \
s_lock_stuck(lock, __FILE__, __LINE__); \
} \
} \
} \
} \
}
else
}
while(0)
#endif
/* S_LOCK_DEBUG */
#endif
/* S_LOCK_DEBUG */
#endif
/* S_LOCK */
#endif
/* S_LOCK */
...
...
src/include/utils/exc.h
View file @
27db9ecd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: exc.h,v 1.1
2 1998/02/26 04:43:59
momjian Exp $
* $Id: exc.h,v 1.1
3 1998/06/15 18:40:05
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -47,23 +47,28 @@ typedef struct ExcFrame
...
@@ -47,23 +47,28 @@ typedef struct ExcFrame
extern
ExcFrame
*
ExcCurFrameP
;
extern
ExcFrame
*
ExcCurFrameP
;
#define ExcBegin() \
/* These are not used anywhere 1998/6/15 */
{ \
#define ExcBegin() \
ExcFrame exception; \
do { \
\
ExcFrame exception;\
exception.link = ExcCurFrameP; \
\
if (sigsetjmp(exception.context, 1) == 0) { \
exception.link = ExcCurFrameP; \
ExcCurFrameP = &exception; \
if (sigsetjmp(exception.context, 1) == 0) \
{
{ \
#define ExcExcept() \
ExcCurFrameP = &exception;
} \
ExcCurFrameP = exception.link; \
#define ExcExcept() \
} else { \
} \
{
ExcCurFrameP = exception.link; \
#define ExcEnd() \
} \
} \
else \
} \
{ \
}
{
#define ExcEnd() \
} \
} \
} while(0)
#define raise4(x, t, d, message) \
#define raise4(x, t, d, message) \
ExcRaise(&(x), (ExcDetail)(t), (ExcData)(d), (ExcMessage)(message))
ExcRaise(&(x), (ExcDetail)(t), (ExcData)(d), (ExcMessage)(message))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment