Inline fastgetattr and others so data access does not use function
calls.
This commit is contained in:
parent
2df6bba3ca
commit
726c3854cb
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.30 1998/01/07 21:00:40 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.31 1998/01/31 04:38:02 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* The old interface functions have been converted to macros
|
* The old interface functions have been converted to macros
|
||||||
|
@ -32,6 +32,16 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Used by heap_getattr() macro, for speed */
|
||||||
|
long heap_sysoffset[] = {
|
||||||
|
/* Only the first one is pass-by-ref, and is handled specially in the macro */
|
||||||
|
offsetof(HeapTupleData, t_ctid),
|
||||||
|
offsetof(HeapTupleData, t_oid),
|
||||||
|
offsetof(HeapTupleData, t_xmin),
|
||||||
|
offsetof(HeapTupleData, t_cmin),
|
||||||
|
offsetof(HeapTupleData, t_xmax),
|
||||||
|
offsetof(HeapTupleData, t_cmax)
|
||||||
|
};
|
||||||
|
|
||||||
/* this is so the sparcstation debugger works */
|
/* this is so the sparcstation debugger works */
|
||||||
|
|
||||||
|
@ -364,10 +374,12 @@ heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* fastgetattr
|
* nocachegetattr
|
||||||
*
|
*
|
||||||
* This is a newer version of fastgetattr which attempts to be
|
* This only gets called from fastgetattr() macro, in cases where
|
||||||
* faster by caching attribute offsets in the attribute descriptor.
|
* we can't use a cacheoffset and the value is not null.
|
||||||
|
*
|
||||||
|
* This caches attribute offsets in the attribute descriptor.
|
||||||
*
|
*
|
||||||
* an alternate way to speed things up would be to cache offsets
|
* an alternate way to speed things up would be to cache offsets
|
||||||
* with the tuple, but that seems more difficult unless you take
|
* with the tuple, but that seems more difficult unless you take
|
||||||
|
@ -381,7 +393,7 @@ heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
Datum
|
Datum
|
||||||
fastgetattr(HeapTuple tup,
|
nocachegetattr(HeapTuple tup,
|
||||||
int attnum,
|
int attnum,
|
||||||
TupleDesc tupleDesc,
|
TupleDesc tupleDesc,
|
||||||
bool *isnull)
|
bool *isnull)
|
||||||
|
@ -391,13 +403,15 @@ fastgetattr(HeapTuple tup,
|
||||||
int slow; /* do we have to walk nulls? */
|
int slow; /* do we have to walk nulls? */
|
||||||
AttributeTupleForm *att = tupleDesc->attrs;
|
AttributeTupleForm *att = tupleDesc->attrs;
|
||||||
|
|
||||||
/* ----------------
|
|
||||||
* sanity checks
|
|
||||||
* ----------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
#if IN_MACRO
|
||||||
|
/* This is handled in the macro */
|
||||||
Assert(attnum > 0);
|
Assert(attnum > 0);
|
||||||
|
|
||||||
|
if (isnull)
|
||||||
|
*isnull = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* Three cases:
|
* Three cases:
|
||||||
*
|
*
|
||||||
|
@ -407,12 +421,12 @@ fastgetattr(HeapTuple tup,
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (isnull)
|
|
||||||
*isnull = false;
|
|
||||||
|
|
||||||
if (HeapTupleNoNulls(tup))
|
if (HeapTupleNoNulls(tup))
|
||||||
{
|
{
|
||||||
attnum--;
|
attnum--;
|
||||||
|
|
||||||
|
#if IN_MACRO
|
||||||
|
/* This is handled in the macro */
|
||||||
if (att[attnum]->attcacheoff > 0)
|
if (att[attnum]->attcacheoff > 0)
|
||||||
{
|
{
|
||||||
return (Datum)
|
return (Datum)
|
||||||
|
@ -427,6 +441,7 @@ fastgetattr(HeapTuple tup,
|
||||||
*/
|
*/
|
||||||
return ((Datum) fetchatt(&(att[0]), (char *) tup + tup->t_hoff));
|
return ((Datum) fetchatt(&(att[0]), (char *) tup + tup->t_hoff));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
tp = (char *) tup + tup->t_hoff;
|
tp = (char *) tup + tup->t_hoff;
|
||||||
|
|
||||||
|
@ -449,12 +464,15 @@ fastgetattr(HeapTuple tup,
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if IN_MACRO
|
||||||
|
/* This is handled in the macro */
|
||||||
if (att_isnull(attnum, bp))
|
if (att_isnull(attnum, bp))
|
||||||
{
|
{
|
||||||
if (isnull)
|
if (isnull)
|
||||||
*isnull = true;
|
*isnull = true;
|
||||||
return (Datum) NULL;
|
return (Datum) NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* Now check to see if any preceeding bits are null...
|
* Now check to see if any preceeding bits are null...
|
||||||
|
@ -539,7 +557,7 @@ fastgetattr(HeapTuple tup,
|
||||||
if (att[j]->attlen < sizeof(int32))
|
if (att[j]->attlen < sizeof(int32))
|
||||||
{
|
{
|
||||||
elog(ERROR,
|
elog(ERROR,
|
||||||
"fastgetattr: attribute %d has len %d",
|
"nocachegetattr: attribute %d has len %d",
|
||||||
j, att[j]->attlen);
|
j, att[j]->attlen);
|
||||||
}
|
}
|
||||||
if (att[j]->attalign == 'd')
|
if (att[j]->attalign == 'd')
|
||||||
|
@ -599,7 +617,7 @@ fastgetattr(HeapTuple tup,
|
||||||
default:
|
default:
|
||||||
if (att[i]->attlen < sizeof(int32))
|
if (att[i]->attlen < sizeof(int32))
|
||||||
elog(ERROR,
|
elog(ERROR,
|
||||||
"fastgetattr2: attribute %d has len %d",
|
"nocachegetattr2: attribute %d has len %d",
|
||||||
i, att[i]->attlen);
|
i, att[i]->attlen);
|
||||||
if (att[i]->attalign == 'd')
|
if (att[i]->attalign == 'd')
|
||||||
off = DOUBLEALIGN(off);
|
off = DOUBLEALIGN(off);
|
||||||
|
@ -657,7 +675,7 @@ fastgetattr(HeapTuple tup,
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (att[attnum]->attlen < sizeof(int32))
|
if (att[attnum]->attlen < sizeof(int32))
|
||||||
elog(ERROR, "fastgetattr3: attribute %d has len %d",
|
elog(ERROR, "nocachegetattr3: attribute %d has len %d",
|
||||||
attnum, att[attnum]->attlen);
|
attnum, att[attnum]->attlen);
|
||||||
if (att[attnum]->attalign == 'd')
|
if (att[attnum]->attalign == 'd')
|
||||||
off = DOUBLEALIGN(off);
|
off = DOUBLEALIGN(off);
|
||||||
|
@ -719,7 +737,6 @@ heap_deformtuple(HeapTuple tuple,
|
||||||
bool isnull;
|
bool isnull;
|
||||||
|
|
||||||
values[i] = heap_getattr(tuple,
|
values[i] = heap_getattr(tuple,
|
||||||
InvalidBuffer,
|
|
||||||
i + 1,
|
i + 1,
|
||||||
tdesc,
|
tdesc,
|
||||||
&isnull);
|
&isnull);
|
||||||
|
@ -874,7 +891,6 @@ heap_modifytuple(HeapTuple tuple,
|
||||||
{
|
{
|
||||||
value[attoff] =
|
value[attoff] =
|
||||||
heap_getattr(tuple,
|
heap_getattr(tuple,
|
||||||
InvalidBuffer,
|
|
||||||
AttrOffsetGetAttrNumber(attoff),
|
AttrOffsetGetAttrNumber(attoff),
|
||||||
RelationGetTupleDescriptor(relation),
|
RelationGetTupleDescriptor(relation),
|
||||||
&isNull);
|
&isNull);
|
||||||
|
@ -959,3 +975,4 @@ heap_addheader(uint32 natts, /* max domain index */
|
||||||
|
|
||||||
return (tup);
|
return (tup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.22 1998/01/07 21:00:43 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.23 1998/01/31 04:38:03 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -26,11 +26,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Size IndexInfoFindDataOffset(unsigned short t_info);
|
|
||||||
static char *
|
|
||||||
fastgetiattr(IndexTuple tup, int attnum,
|
|
||||||
TupleDesc att, bool *isnull);
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------
|
/* ----------------------------------------------------------------
|
||||||
* index_ tuple interface routines
|
* index_ tuple interface routines
|
||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
|
@ -117,10 +112,12 @@ index_formtuple(TupleDesc tupleDescriptor,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* fastgetiattr
|
* nocache_index_getattr
|
||||||
*
|
*
|
||||||
* This is a newer version of fastgetiattr which attempts to be
|
* This gets called from index_getattr() macro, and only in cases
|
||||||
* faster by caching attribute offsets in the attribute descriptor.
|
* where we can't use cacheoffset and the value is not null.
|
||||||
|
*
|
||||||
|
* This caches attribute offsets in the attribute descriptor.
|
||||||
*
|
*
|
||||||
* an alternate way to speed things up would be to cache offsets
|
* an alternate way to speed things up would be to cache offsets
|
||||||
* with the tuple, but that seems more difficult unless you take
|
* with the tuple, but that seems more difficult unless you take
|
||||||
|
@ -133,8 +130,8 @@ index_formtuple(TupleDesc tupleDescriptor,
|
||||||
* the same attribute descriptor will go much quicker. -cim 5/4/91
|
* the same attribute descriptor will go much quicker. -cim 5/4/91
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static char *
|
Datum
|
||||||
fastgetiattr(IndexTuple tup,
|
nocache_index_getattr(IndexTuple tup,
|
||||||
int attnum,
|
int attnum,
|
||||||
TupleDesc tupleDesc,
|
TupleDesc tupleDesc,
|
||||||
bool *isnull)
|
bool *isnull)
|
||||||
|
@ -150,9 +147,6 @@ fastgetiattr(IndexTuple tup,
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Assert(PointerIsValid(isnull));
|
|
||||||
Assert(attnum > 0);
|
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* Three cases:
|
* Three cases:
|
||||||
*
|
*
|
||||||
|
@ -162,27 +156,37 @@ fastgetiattr(IndexTuple tup,
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef IN_MACRO
|
||||||
|
/* This is handled in the macro */
|
||||||
|
Assert(PointerIsValid(isnull));
|
||||||
|
Assert(attnum > 0);
|
||||||
|
|
||||||
*isnull = false;
|
*isnull = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
data_off = IndexTupleHasMinHeader(tup) ? sizeof *tup :
|
data_off = IndexTupleHasMinHeader(tup) ? sizeof *tup :
|
||||||
IndexInfoFindDataOffset(tup->t_info);
|
IndexInfoFindDataOffset(tup->t_info);
|
||||||
|
|
||||||
if (IndexTupleNoNulls(tup))
|
if (IndexTupleNoNulls(tup))
|
||||||
{
|
{
|
||||||
|
attnum--;
|
||||||
|
|
||||||
|
#ifdef IN_MACRO
|
||||||
|
/* This is handled in the macro */
|
||||||
|
|
||||||
/* first attribute is always at position zero */
|
/* first attribute is always at position zero */
|
||||||
|
|
||||||
if (attnum == 1)
|
if (attnum == 1)
|
||||||
{
|
{
|
||||||
return (fetchatt(&(att[0]), (char *) tup + data_off));
|
return (Datum) fetchatt(&(att[0]), (char *) tup + data_off);
|
||||||
}
|
}
|
||||||
attnum--;
|
|
||||||
|
|
||||||
if (att[attnum]->attcacheoff > 0)
|
if (att[attnum]->attcacheoff > 0)
|
||||||
{
|
{
|
||||||
return (fetchatt(&(att[attnum]),
|
return (Datum) fetchatt(&(att[attnum]),
|
||||||
(char *) tup + data_off +
|
(char *) tup + data_off +
|
||||||
att[attnum]->attcacheoff));
|
att[attnum]->attcacheoff);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
tp = (char *) tup + data_off;
|
tp = (char *) tup + data_off;
|
||||||
|
|
||||||
|
@ -191,8 +195,6 @@ fastgetiattr(IndexTuple tup,
|
||||||
else
|
else
|
||||||
{ /* there's a null somewhere in the tuple */
|
{ /* there's a null somewhere in the tuple */
|
||||||
|
|
||||||
bp = (char *) tup + sizeof(*tup); /* "knows" t_bits are
|
|
||||||
* here! */
|
|
||||||
slow = 0;
|
slow = 0;
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* check to see if desired att is null
|
* check to see if desired att is null
|
||||||
|
@ -200,13 +202,19 @@ fastgetiattr(IndexTuple tup,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
attnum--;
|
attnum--;
|
||||||
{
|
|
||||||
|
bp = (char *) tup + sizeof(*tup); /* "knows" t_bits are
|
||||||
|
* here! */
|
||||||
|
#ifdef IN_MACRO
|
||||||
|
/* This is handled in the macro */
|
||||||
|
|
||||||
if (att_isnull(attnum, bp))
|
if (att_isnull(attnum, bp))
|
||||||
{
|
{
|
||||||
*isnull = true;
|
*isnull = true;
|
||||||
return NULL;
|
return (Datum)NULL;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* Now check to see if any preceeding bits are null...
|
* Now check to see if any preceeding bits are null...
|
||||||
* ----------------
|
* ----------------
|
||||||
|
@ -251,8 +259,8 @@ fastgetiattr(IndexTuple tup,
|
||||||
{
|
{
|
||||||
if (att[attnum]->attcacheoff > 0)
|
if (att[attnum]->attcacheoff > 0)
|
||||||
{
|
{
|
||||||
return (fetchatt(&(att[attnum]),
|
return (Datum) fetchatt(&(att[attnum]),
|
||||||
tp + att[attnum]->attcacheoff));
|
tp + att[attnum]->attcacheoff);
|
||||||
}
|
}
|
||||||
else if (!IndexTupleAllFixed(tup))
|
else if (!IndexTupleAllFixed(tup))
|
||||||
{
|
{
|
||||||
|
@ -314,7 +322,7 @@ fastgetiattr(IndexTuple tup,
|
||||||
off = (att[j]->attalign == 'd') ?
|
off = (att[j]->attalign == 'd') ?
|
||||||
DOUBLEALIGN(off) : LONGALIGN(off);
|
DOUBLEALIGN(off) : LONGALIGN(off);
|
||||||
else
|
else
|
||||||
elog(ERROR, "fastgetiattr: attribute %d has len %d",
|
elog(ERROR, "nocache_index_getattr: attribute %d has len %d",
|
||||||
j, att[j]->attlen);
|
j, att[j]->attlen);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -324,8 +332,8 @@ fastgetiattr(IndexTuple tup,
|
||||||
off += att[j]->attlen;
|
off += att[j]->attlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (fetchatt(&(att[attnum]),
|
return (Datum) fetchatt(&(att[attnum]),
|
||||||
tp + att[attnum]->attcacheoff));
|
tp + att[attnum]->attcacheoff);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -382,7 +390,7 @@ fastgetiattr(IndexTuple tup,
|
||||||
DOUBLEALIGN(off) + att[i]->attlen :
|
DOUBLEALIGN(off) + att[i]->attlen :
|
||||||
LONGALIGN(off) + att[i]->attlen;
|
LONGALIGN(off) + att[i]->attlen;
|
||||||
else
|
else
|
||||||
elog(ERROR, "fastgetiattr2: attribute %d has len %d",
|
elog(ERROR, "nocache_index_getattr2: attribute %d has len %d",
|
||||||
i, att[i]->attlen);
|
i, att[i]->attlen);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -391,7 +399,7 @@ fastgetiattr(IndexTuple tup,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* I don't know why this code was missed here! I've got it from
|
* I don't know why this code was missed here! I've got it from
|
||||||
* heaptuple.c:fastgetattr(). - vadim 06/12/97
|
* heaptuple.c:nocachegetattr(). - vadim 06/12/97
|
||||||
*/
|
*/
|
||||||
switch (att[attnum]->attlen)
|
switch (att[attnum]->attlen)
|
||||||
{
|
{
|
||||||
|
@ -409,7 +417,7 @@ fastgetiattr(IndexTuple tup,
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (att[attnum]->attlen < sizeof(int32))
|
if (att[attnum]->attlen < sizeof(int32))
|
||||||
elog(ERROR, "fastgetattr3: attribute %d has len %d",
|
elog(ERROR, "nocache_index_getattr: attribute %d has len %d",
|
||||||
attnum, att[attnum]->attlen);
|
attnum, att[attnum]->attlen);
|
||||||
if (att[attnum]->attalign == 'd')
|
if (att[attnum]->attalign == 'd')
|
||||||
off = DOUBLEALIGN(off);
|
off = DOUBLEALIGN(off);
|
||||||
|
@ -418,26 +426,10 @@ fastgetiattr(IndexTuple tup,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (fetchatt(&att[attnum], tp + off));
|
return (Datum) fetchatt(&att[attnum], tp + off);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
|
||||||
* index_getattr
|
|
||||||
* ----------------
|
|
||||||
*/
|
|
||||||
Datum
|
|
||||||
index_getattr(IndexTuple tuple,
|
|
||||||
AttrNumber attNum,
|
|
||||||
TupleDesc tupDesc,
|
|
||||||
bool *isNullOutP)
|
|
||||||
{
|
|
||||||
Assert(attNum > 0);
|
|
||||||
|
|
||||||
return (Datum)
|
|
||||||
fastgetiattr(tuple, attNum, tupDesc, isNullOutP);
|
|
||||||
}
|
|
||||||
|
|
||||||
RetrieveIndexResult
|
RetrieveIndexResult
|
||||||
FormRetrieveIndexResult(ItemPointer indexItemPointer,
|
FormRetrieveIndexResult(ItemPointer indexItemPointer,
|
||||||
ItemPointer heapItemPointer)
|
ItemPointer heapItemPointer)
|
||||||
|
@ -455,29 +447,6 @@ FormRetrieveIndexResult(ItemPointer indexItemPointer,
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Takes an infomask as argument (primarily because this needs to be usable
|
|
||||||
* at index_formtuple time so enough space is allocated).
|
|
||||||
*
|
|
||||||
* Change me if adding an attribute to IndexTuples!!!!!!!!!!!
|
|
||||||
*/
|
|
||||||
static Size
|
|
||||||
IndexInfoFindDataOffset(unsigned short t_info)
|
|
||||||
{
|
|
||||||
if (!(t_info & INDEX_NULL_MASK))
|
|
||||||
return ((Size) sizeof(IndexTupleData));
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Size size = sizeof(IndexTupleData);
|
|
||||||
|
|
||||||
if (t_info & INDEX_NULL_MASK)
|
|
||||||
{
|
|
||||||
size += sizeof(IndexAttributeBitMapData);
|
|
||||||
}
|
|
||||||
return DOUBLEALIGN(size); /* be conservative */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copies source into target. If *target == NULL, we palloc space; otherwise
|
* Copies source into target. If *target == NULL, we palloc space; otherwise
|
||||||
* we assume we have space that is already palloc'ed.
|
* we assume we have space that is already palloc'ed.
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.22 1998/01/07 21:00:44 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.23 1998/01/31 04:38:03 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -97,7 +97,7 @@ printtup(HeapTuple tuple, TupleDesc typeinfo)
|
||||||
{
|
{
|
||||||
i++; /* heap_getattr is a macro, so no
|
i++; /* heap_getattr is a macro, so no
|
||||||
* increment */
|
* increment */
|
||||||
attr = heap_getattr(tuple, InvalidBuffer, i, typeinfo, &isnull);
|
attr = heap_getattr(tuple, i, typeinfo, &isnull);
|
||||||
if (!isnull)
|
if (!isnull)
|
||||||
j |= k;
|
j |= k;
|
||||||
k >>= 1;
|
k >>= 1;
|
||||||
|
@ -117,7 +117,7 @@ printtup(HeapTuple tuple, TupleDesc typeinfo)
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < tuple->t_natts; ++i)
|
for (i = 0; i < tuple->t_natts; ++i)
|
||||||
{
|
{
|
||||||
attr = heap_getattr(tuple, InvalidBuffer, i + 1, typeinfo, &isnull);
|
attr = heap_getattr(tuple, i + 1, typeinfo, &isnull);
|
||||||
typoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);
|
typoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);
|
||||||
|
|
||||||
if (!isnull && OidIsValid(typoutput))
|
if (!isnull && OidIsValid(typoutput))
|
||||||
|
@ -183,7 +183,7 @@ debugtup(HeapTuple tuple, TupleDesc typeinfo)
|
||||||
|
|
||||||
for (i = 0; i < tuple->t_natts; ++i)
|
for (i = 0; i < tuple->t_natts; ++i)
|
||||||
{
|
{
|
||||||
attr = heap_getattr(tuple, InvalidBuffer, i + 1, typeinfo, &isnull);
|
attr = heap_getattr(tuple, i + 1, typeinfo, &isnull);
|
||||||
typoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);
|
typoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);
|
||||||
|
|
||||||
if (!isnull && OidIsValid(typoutput))
|
if (!isnull && OidIsValid(typoutput))
|
||||||
|
@ -231,7 +231,7 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo)
|
||||||
{
|
{
|
||||||
i++; /* heap_getattr is a macro, so no
|
i++; /* heap_getattr is a macro, so no
|
||||||
* increment */
|
* increment */
|
||||||
attr = heap_getattr(tuple, InvalidBuffer, i, typeinfo, &isnull);
|
attr = heap_getattr(tuple, i, typeinfo, &isnull);
|
||||||
if (!isnull)
|
if (!isnull)
|
||||||
j |= k;
|
j |= k;
|
||||||
k >>= 1;
|
k >>= 1;
|
||||||
|
@ -256,7 +256,7 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo)
|
||||||
{
|
{
|
||||||
int32 len = typeinfo->attrs[i]->attlen;
|
int32 len = typeinfo->attrs[i]->attlen;
|
||||||
|
|
||||||
attr = heap_getattr(tuple, InvalidBuffer, i + 1, typeinfo, &isnull);
|
attr = heap_getattr(tuple, i + 1, typeinfo, &isnull);
|
||||||
if (!isnull)
|
if (!isnull)
|
||||||
{
|
{
|
||||||
/* # of bytes, and opaque data */
|
/* # of bytes, and opaque data */
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.19 1998/01/07 21:01:42 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.20 1998/01/31 04:38:06 momjian Exp $
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
* index_open - open an index relation by relationId
|
* index_open - open an index relation by relationId
|
||||||
|
@ -386,7 +386,6 @@ GetIndexValue(HeapTuple tuple,
|
||||||
for (i = 0; i < FIgetnArgs(fInfo); i++)
|
for (i = 0; i < FIgetnArgs(fInfo); i++)
|
||||||
{
|
{
|
||||||
attData[i] = heap_getattr(tuple,
|
attData[i] = heap_getattr(tuple,
|
||||||
buffer,
|
|
||||||
attrNums[i],
|
attrNums[i],
|
||||||
hTupDesc,
|
hTupDesc,
|
||||||
attNull);
|
attNull);
|
||||||
|
@ -400,7 +399,7 @@ GetIndexValue(HeapTuple tuple,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
returnVal = heap_getattr(tuple, buffer, attrNums[attOff],
|
returnVal = heap_getattr(tuple, attrNums[attOff],
|
||||||
hTupDesc, attNull);
|
hTupDesc, attNull);
|
||||||
}
|
}
|
||||||
return returnVal;
|
return returnVal;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.3 1998/01/15 19:42:26 pgsql Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.4 1998/01/31 04:38:11 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* See acl.h.
|
* See acl.h.
|
||||||
|
@ -140,7 +140,7 @@ ChangeAcl(char *relname,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!heap_attisnull(htp, Anum_pg_class_relacl))
|
if (!heap_attisnull(htp, Anum_pg_class_relacl))
|
||||||
old_acl = (Acl *) heap_getattr(htp, buffer,
|
old_acl = (Acl *) heap_getattr(htp,
|
||||||
Anum_pg_class_relacl,
|
Anum_pg_class_relacl,
|
||||||
RelationGetTupleDescriptor(relation),
|
RelationGetTupleDescriptor(relation),
|
||||||
(bool *) NULL);
|
(bool *) NULL);
|
||||||
|
@ -253,7 +253,7 @@ in_group(AclId uid, AclId gid)
|
||||||
if (HeapTupleIsValid(htp) &&
|
if (HeapTupleIsValid(htp) &&
|
||||||
!heap_attisnull(htp, Anum_pg_group_grolist))
|
!heap_attisnull(htp, Anum_pg_group_grolist))
|
||||||
{
|
{
|
||||||
tmp = (IdList *) heap_getattr(htp, InvalidBuffer,
|
tmp = (IdList *) heap_getattr(htp,
|
||||||
Anum_pg_group_grolist,
|
Anum_pg_group_grolist,
|
||||||
RelationGetTupleDescriptor(relation),
|
RelationGetTupleDescriptor(relation),
|
||||||
(bool *) NULL);
|
(bool *) NULL);
|
||||||
|
@ -453,7 +453,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
|
||||||
if (!heap_attisnull(htp, Anum_pg_class_relacl))
|
if (!heap_attisnull(htp, Anum_pg_class_relacl))
|
||||||
{
|
{
|
||||||
relation = heap_openr(RelationRelationName);
|
relation = heap_openr(RelationRelationName);
|
||||||
tmp = (Acl *) heap_getattr(htp, InvalidBuffer,
|
tmp = (Acl *) heap_getattr(htp,
|
||||||
Anum_pg_class_relacl,
|
Anum_pg_class_relacl,
|
||||||
RelationGetTupleDescriptor(relation),
|
RelationGetTupleDescriptor(relation),
|
||||||
(bool *) NULL);
|
(bool *) NULL);
|
||||||
|
@ -471,7 +471,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
|
||||||
Oid ownerId;
|
Oid ownerId;
|
||||||
|
|
||||||
relation = heap_openr(RelationRelationName);
|
relation = heap_openr(RelationRelationName);
|
||||||
ownerId = (Oid) heap_getattr(htp, InvalidBuffer,
|
ownerId = (Oid) heap_getattr(htp,
|
||||||
Anum_pg_class_relowner,
|
Anum_pg_class_relowner,
|
||||||
RelationGetTupleDescriptor(relation),
|
RelationGetTupleDescriptor(relation),
|
||||||
(bool *) NULL);
|
(bool *) NULL);
|
||||||
|
@ -500,7 +500,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
|
||||||
if (HeapTupleIsValid(htp) &&
|
if (HeapTupleIsValid(htp) &&
|
||||||
!heap_attisnull(htp, Anum_pg_class_relacl))
|
!heap_attisnull(htp, Anum_pg_class_relacl))
|
||||||
{
|
{
|
||||||
tmp = (Acl *) heap_getattr(htp, InvalidBuffer,
|
tmp = (Acl *) heap_getattr(htp,
|
||||||
Anum_pg_class_relacl,
|
Anum_pg_class_relacl,
|
||||||
RelationGetTupleDescriptor(relation),
|
RelationGetTupleDescriptor(relation),
|
||||||
(bool *) NULL);
|
(bool *) NULL);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.27 1998/01/25 05:12:54 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.28 1998/01/31 04:38:17 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -219,7 +219,7 @@ Async_Notify(char *relname)
|
||||||
|
|
||||||
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b)))
|
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b)))
|
||||||
{
|
{
|
||||||
d = heap_getattr(lTuple, b, Anum_pg_listener_notify,
|
d = heap_getattr(lTuple, Anum_pg_listener_notify,
|
||||||
tdesc, &isnull);
|
tdesc, &isnull);
|
||||||
if (!DatumGetInt32(d))
|
if (!DatumGetInt32(d))
|
||||||
{
|
{
|
||||||
|
@ -294,12 +294,12 @@ Async_NotifyAtCommit()
|
||||||
|
|
||||||
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b)))
|
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b)))
|
||||||
{
|
{
|
||||||
d = heap_getattr(lTuple, b, Anum_pg_listener_relname,
|
d = heap_getattr(lTuple, Anum_pg_listener_relname,
|
||||||
tdesc, &isnull);
|
tdesc, &isnull);
|
||||||
|
|
||||||
if (AsyncExistsPendingNotify((char *) DatumGetPointer(d)))
|
if (AsyncExistsPendingNotify((char *) DatumGetPointer(d)))
|
||||||
{
|
{
|
||||||
d = heap_getattr(lTuple, b, Anum_pg_listener_pid,
|
d = heap_getattr(lTuple, Anum_pg_listener_pid,
|
||||||
tdesc, &isnull);
|
tdesc, &isnull);
|
||||||
|
|
||||||
if (MyProcPid == DatumGetInt32(d))
|
if (MyProcPid == DatumGetInt32(d))
|
||||||
|
@ -444,12 +444,12 @@ Async_Listen(char *relname, int pid)
|
||||||
s = heap_beginscan(lDesc, 0, false, 0, (ScanKey) NULL);
|
s = heap_beginscan(lDesc, 0, false, 0, (ScanKey) NULL);
|
||||||
while (HeapTupleIsValid(htup = heap_getnext(s, 0, &b)))
|
while (HeapTupleIsValid(htup = heap_getnext(s, 0, &b)))
|
||||||
{
|
{
|
||||||
d = heap_getattr(htup, b, Anum_pg_listener_relname, tdesc,
|
d = heap_getattr(htup, Anum_pg_listener_relname, tdesc,
|
||||||
&isnull);
|
&isnull);
|
||||||
relnamei = DatumGetPointer(d);
|
relnamei = DatumGetPointer(d);
|
||||||
if (!strncmp(relnamei, relname, NAMEDATALEN))
|
if (!strncmp(relnamei, relname, NAMEDATALEN))
|
||||||
{
|
{
|
||||||
d = heap_getattr(htup, b, Anum_pg_listener_pid, tdesc, &isnull);
|
d = heap_getattr(htup, Anum_pg_listener_pid, tdesc, &isnull);
|
||||||
pid = DatumGetInt32(d);
|
pid = DatumGetInt32(d);
|
||||||
if (pid == MyProcPid)
|
if (pid == MyProcPid)
|
||||||
{
|
{
|
||||||
|
@ -607,7 +607,7 @@ Async_NotifyFrontEnd()
|
||||||
|
|
||||||
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b)))
|
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0, &b)))
|
||||||
{
|
{
|
||||||
d = heap_getattr(lTuple, b, Anum_pg_listener_relname,
|
d = heap_getattr(lTuple, Anum_pg_listener_relname,
|
||||||
tdesc, &isnull);
|
tdesc, &isnull);
|
||||||
rTuple = heap_modifytuple(lTuple, b, lRel, value, nulls, repl);
|
rTuple = heap_modifytuple(lTuple, b, lRel, value, nulls, repl);
|
||||||
heap_replace(lRel, &lTuple->t_ctid, rTuple);
|
heap_replace(lRel, &lTuple->t_ctid, rTuple);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.39 1998/01/16 23:19:40 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.40 1998/01/31 04:38:18 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -266,7 +266,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||||
|
|
||||||
for (i = 0; i < attr_count; i++)
|
for (i = 0; i < attr_count; i++)
|
||||||
{
|
{
|
||||||
value = heap_getattr(tuple, InvalidBuffer, i + 1, tupDesc, &isnull);
|
value = heap_getattr(tuple, i + 1, tupDesc, &isnull);
|
||||||
if (!binary)
|
if (!binary)
|
||||||
{
|
{
|
||||||
if (!isnull)
|
if (!isnull)
|
||||||
|
@ -921,12 +921,12 @@ GetIndexRelations(Oid main_relation_oid,
|
||||||
{
|
{
|
||||||
|
|
||||||
index_relation_oid =
|
index_relation_oid =
|
||||||
(Oid) DatumGetInt32(heap_getattr(tuple, InvalidBuffer, 2,
|
(Oid) DatumGetInt32(heap_getattr(tuple, 2,
|
||||||
tupDesc, &isnull));
|
tupDesc, &isnull));
|
||||||
if (index_relation_oid == main_relation_oid)
|
if (index_relation_oid == main_relation_oid)
|
||||||
{
|
{
|
||||||
scan->index_rel_oid =
|
scan->index_rel_oid =
|
||||||
(Oid) DatumGetInt32(heap_getattr(tuple, InvalidBuffer,
|
(Oid) DatumGetInt32(heap_getattr(tuple,
|
||||||
Anum_pg_index_indexrelid,
|
Anum_pg_index_indexrelid,
|
||||||
tupDesc, &isnull));
|
tupDesc, &isnull));
|
||||||
(*n_indices)++;
|
(*n_indices)++;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.5 1998/01/05 16:38:51 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.6 1998/01/31 04:38:19 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -258,12 +258,12 @@ check_permissions(char *command,
|
||||||
|
|
||||||
if (dbfound)
|
if (dbfound)
|
||||||
{
|
{
|
||||||
dbowner = (Oid) heap_getattr(dbtup, InvalidBuffer,
|
dbowner = (Oid) heap_getattr(dbtup,
|
||||||
Anum_pg_database_datdba,
|
Anum_pg_database_datdba,
|
||||||
RelationGetTupleDescriptor(dbrel),
|
RelationGetTupleDescriptor(dbrel),
|
||||||
(char *) NULL);
|
(char *) NULL);
|
||||||
*dbIdP = dbtup->t_oid;
|
*dbIdP = dbtup->t_oid;
|
||||||
dbtext = (text *) heap_getattr(dbtup, InvalidBuffer,
|
dbtext = (text *) heap_getattr(dbtup,
|
||||||
Anum_pg_database_datpath,
|
Anum_pg_database_datpath,
|
||||||
RelationGetTupleDescriptor(dbrel),
|
RelationGetTupleDescriptor(dbrel),
|
||||||
(char *) NULL);
|
(char *) NULL);
|
||||||
|
|
|
@ -118,12 +118,12 @@ void DefineUser(CreateUserStmt *stmt) {
|
||||||
|
|
||||||
scan = heap_beginscan(pg_user_rel, false, false, 0, NULL);
|
scan = heap_beginscan(pg_user_rel, false, false, 0, NULL);
|
||||||
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0, &buffer))) {
|
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0, &buffer))) {
|
||||||
datum = heap_getattr(tuple, buffer, Anum_pg_user_usename, pg_user_dsc, &n);
|
datum = heap_getattr(tuple, Anum_pg_user_usename, pg_user_dsc, &n);
|
||||||
|
|
||||||
if (!exists && !strncmp((char*)datum, stmt->user, strlen(stmt->user)))
|
if (!exists && !strncmp((char*)datum, stmt->user, strlen(stmt->user)))
|
||||||
exists = true;
|
exists = true;
|
||||||
|
|
||||||
datum = heap_getattr(tuple, buffer, Anum_pg_user_usesysid, pg_user_dsc, &n);
|
datum = heap_getattr(tuple, Anum_pg_user_usesysid, pg_user_dsc, &n);
|
||||||
if ((int)datum > max_id)
|
if ((int)datum > max_id)
|
||||||
max_id = (int)datum;
|
max_id = (int)datum;
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ extern void AlterUser(AlterUserStmt *stmt) {
|
||||||
|
|
||||||
scan = heap_beginscan(pg_user_rel, false, false, 0, NULL);
|
scan = heap_beginscan(pg_user_rel, false, false, 0, NULL);
|
||||||
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0, &buffer))) {
|
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0, &buffer))) {
|
||||||
datum = heap_getattr(tuple, buffer, Anum_pg_user_usename, pg_user_dsc, &n);
|
datum = heap_getattr(tuple, Anum_pg_user_usename, pg_user_dsc, &n);
|
||||||
|
|
||||||
if (!strncmp((char*)datum, stmt->user, strlen(stmt->user))) {
|
if (!strncmp((char*)datum, stmt->user, strlen(stmt->user))) {
|
||||||
exists = true;
|
exists = true;
|
||||||
|
@ -340,10 +340,10 @@ extern void RemoveUser(char* user) {
|
||||||
|
|
||||||
scan = heap_beginscan(pg_user_rel, false, false, 0, NULL);
|
scan = heap_beginscan(pg_user_rel, false, false, 0, NULL);
|
||||||
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0, &buffer))) {
|
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0, &buffer))) {
|
||||||
datum = heap_getattr(tuple, buffer, Anum_pg_user_usename, pg_dsc, &n);
|
datum = heap_getattr(tuple, Anum_pg_user_usename, pg_dsc, &n);
|
||||||
|
|
||||||
if (!strncmp((char*)datum, user, strlen(user))) {
|
if (!strncmp((char*)datum, user, strlen(user))) {
|
||||||
usesysid = (int)heap_getattr(tuple, buffer, Anum_pg_user_usesysid, pg_dsc, &n);
|
usesysid = (int)heap_getattr(tuple, Anum_pg_user_usesysid, pg_dsc, &n);
|
||||||
ReleaseBuffer(buffer);
|
ReleaseBuffer(buffer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -367,10 +367,10 @@ extern void RemoveUser(char* user) {
|
||||||
|
|
||||||
scan = heap_beginscan(pg_rel, false, false, 0, NULL);
|
scan = heap_beginscan(pg_rel, false, false, 0, NULL);
|
||||||
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0, &buffer))) {
|
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0, &buffer))) {
|
||||||
datum = heap_getattr(tuple, buffer, Anum_pg_database_datdba, pg_dsc, &n);
|
datum = heap_getattr(tuple, Anum_pg_database_datdba, pg_dsc, &n);
|
||||||
|
|
||||||
if ((int)datum == usesysid) {
|
if ((int)datum == usesysid) {
|
||||||
datum = heap_getattr(tuple, buffer, Anum_pg_database_datname, pg_dsc, &n);
|
datum = heap_getattr(tuple, Anum_pg_database_datname, pg_dsc, &n);
|
||||||
if (memcmp((void*)datum, "template1", 9)) {
|
if (memcmp((void*)datum, "template1", 9)) {
|
||||||
dbase = (char**)realloc((void*)dbase, sizeof(char*) * (ndbase + 1));
|
dbase = (char**)realloc((void*)dbase, sizeof(char*) * (ndbase + 1));
|
||||||
dbase[ndbase] = (char*)malloc(NAMEDATALEN + 1);
|
dbase[ndbase] = (char*)malloc(NAMEDATALEN + 1);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.58 1998/01/15 19:42:40 pgsql Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.59 1998/01/31 04:38:21 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -299,7 +299,7 @@ vc_getrels(NameData *VacRelP)
|
||||||
|
|
||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
d = heap_getattr(pgctup, buf, Anum_pg_class_relname, pgcdesc, &n);
|
d = heap_getattr(pgctup, Anum_pg_class_relname, pgcdesc, &n);
|
||||||
rname = (char *) d;
|
rname = (char *) d;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -317,7 +317,7 @@ vc_getrels(NameData *VacRelP)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
d = heap_getattr(pgctup, buf, Anum_pg_class_relkind, pgcdesc, &n);
|
d = heap_getattr(pgctup, Anum_pg_class_relkind, pgcdesc, &n);
|
||||||
|
|
||||||
rkind = DatumGetChar(d);
|
rkind = DatumGetChar(d);
|
||||||
|
|
||||||
|
@ -1637,7 +1637,7 @@ vc_attrstats(Relation onerel, VRelStats *vacrelstats, HeapTuple htup)
|
||||||
VacAttrStats *stats = &vacattrstats[i];
|
VacAttrStats *stats = &vacattrstats[i];
|
||||||
bool value_hit = true;
|
bool value_hit = true;
|
||||||
|
|
||||||
value = heap_getattr(htup, InvalidBuffer,
|
value = heap_getattr(htup,
|
||||||
stats->attr->attnum, tupDesc, &isnull);
|
stats->attr->attnum, tupDesc, &isnull);
|
||||||
|
|
||||||
if (!VacAttrStatsEqValid(stats))
|
if (!VacAttrStatsEqValid(stats))
|
||||||
|
@ -2166,7 +2166,7 @@ vc_getindices(Oid relid, int *nindices, Relation **Irel)
|
||||||
|
|
||||||
while (HeapTupleIsValid(pgitup = heap_getnext(pgiscan, 0, NULL)))
|
while (HeapTupleIsValid(pgitup = heap_getnext(pgiscan, 0, NULL)))
|
||||||
{
|
{
|
||||||
d = heap_getattr(pgitup, InvalidBuffer, Anum_pg_index_indexrelid,
|
d = heap_getattr(pgitup, Anum_pg_index_indexrelid,
|
||||||
pgidesc, &n);
|
pgidesc, &n);
|
||||||
i++;
|
i++;
|
||||||
if (i % 10 == 0)
|
if (i % 10 == 0)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.9 1997/09/12 04:07:33 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.10 1998/01/31 04:38:24 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -315,7 +315,7 @@ ExecGetJunkAttribute(JunkFilter *junkfilter,
|
||||||
tuple = slot->val;
|
tuple = slot->val;
|
||||||
tupType = (TupleDesc) junkfilter->jf_tupType;
|
tupType = (TupleDesc) junkfilter->jf_tupType;
|
||||||
|
|
||||||
*value = heap_getattr(tuple, InvalidBuffer, resno, tupType, isNull);
|
*value = heap_getattr(tuple, resno, tupType, isNull);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -391,7 +391,7 @@ ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
|
||||||
for (i = 0; i < cleanLength; i++)
|
for (i = 0; i < cleanLength; i++)
|
||||||
{
|
{
|
||||||
values[i] =
|
values[i] =
|
||||||
heap_getattr(tuple, InvalidBuffer, cleanMap[i], tupType, &isNull);
|
heap_getattr(tuple, cleanMap[i], tupType, &isNull);
|
||||||
|
|
||||||
if (isNull)
|
if (isNull)
|
||||||
nulls[i] = 'n';
|
nulls[i] = 'n';
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.23 1998/01/15 19:44:24 pgsql Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.24 1998/01/31 04:38:27 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -301,7 +301,6 @@ ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull)
|
||||||
}
|
}
|
||||||
|
|
||||||
result = heap_getattr(heapTuple, /* tuple containing attribute */
|
result = heap_getattr(heapTuple, /* tuple containing attribute */
|
||||||
buffer, /* buffer associated with tuple */
|
|
||||||
attnum, /* attribute number of desired attribute */
|
attnum, /* attribute number of desired attribute */
|
||||||
tuple_type,/* tuple descriptor of tuple */
|
tuple_type,/* tuple descriptor of tuple */
|
||||||
isNull); /* return: is attribute null? */
|
isNull); /* return: is attribute null? */
|
||||||
|
@ -525,7 +524,6 @@ GetAttributeByNum(TupleTableSlot *slot,
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = heap_getattr(slot->val,
|
retval = heap_getattr(slot->val,
|
||||||
slot->ttc_buffer,
|
|
||||||
attrno,
|
attrno,
|
||||||
slot->ttc_tupleDescriptor,
|
slot->ttc_tupleDescriptor,
|
||||||
isNull);
|
isNull);
|
||||||
|
@ -587,7 +585,6 @@ GetAttributeByName(TupleTableSlot *slot, char *attname, bool *isNull)
|
||||||
elog(ERROR, "GetAttributeByName: attribute %s not found", attname);
|
elog(ERROR, "GetAttributeByName: attribute %s not found", attname);
|
||||||
|
|
||||||
retval = heap_getattr(slot->val,
|
retval = heap_getattr(slot->val,
|
||||||
slot->ttc_buffer,
|
|
||||||
attrno,
|
attrno,
|
||||||
tupdesc,
|
tupdesc,
|
||||||
isNull);
|
isNull);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.14 1997/12/11 17:36:16 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.15 1998/01/31 04:38:28 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -82,7 +82,7 @@ ProjectAttribute(TupleDesc TD,
|
||||||
AttrNumber attrno = attrVar->varattno;
|
AttrNumber attrno = attrVar->varattno;
|
||||||
|
|
||||||
|
|
||||||
val = heap_getattr(tup, InvalidBuffer, attrno, TD, isnullP);
|
val = heap_getattr(tup, attrno, TD, isnullP);
|
||||||
if (*isnullP)
|
if (*isnullP)
|
||||||
return (Datum) NULL;
|
return (Datum) NULL;
|
||||||
|
|
||||||
|
|
|
@ -663,7 +663,6 @@ aggGetAttr(TupleTableSlot *slot,
|
||||||
|
|
||||||
result =
|
result =
|
||||||
heap_getattr(heapTuple, /* tuple containing attribute */
|
heap_getattr(heapTuple, /* tuple containing attribute */
|
||||||
buffer, /* buffer associated with tuple */
|
|
||||||
attnum, /* attribute number of desired attribute */
|
attnum, /* attribute number of desired attribute */
|
||||||
tuple_type,/* tuple descriptor of tuple */
|
tuple_type,/* tuple descriptor of tuple */
|
||||||
isNull); /* return: is attribute null? */
|
isNull); /* return: is attribute null? */
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* columns. (ie. tuples from the same group are consecutive)
|
* columns. (ie. tuples from the same group are consecutive)
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.13 1998/01/27 15:41:32 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.14 1998/01/31 04:38:29 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -402,13 +402,11 @@ sameGroup(TupleTableSlot *oldslot,
|
||||||
typoutput = typtoout((Oid) tupdesc->attrs[att - 1]->atttypid);
|
typoutput = typtoout((Oid) tupdesc->attrs[att - 1]->atttypid);
|
||||||
|
|
||||||
attr1 = heap_getattr(oldslot->val,
|
attr1 = heap_getattr(oldslot->val,
|
||||||
InvalidBuffer,
|
|
||||||
att,
|
att,
|
||||||
tupdesc,
|
tupdesc,
|
||||||
&isNull1);
|
&isNull1);
|
||||||
|
|
||||||
attr2 = heap_getattr(newslot->val,
|
attr2 = heap_getattr(newslot->val,
|
||||||
InvalidBuffer,
|
|
||||||
att,
|
att,
|
||||||
tupdesc,
|
tupdesc,
|
||||||
&isNull2);
|
&isNull2);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.11 1997/09/12 04:07:44 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.12 1998/01/31 04:38:31 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -187,9 +187,9 @@ ExecUnique(Unique *node)
|
||||||
char *val1,
|
char *val1,
|
||||||
*val2;
|
*val2;
|
||||||
|
|
||||||
attr1 = heap_getattr(slot->val, InvalidBuffer,
|
attr1 = heap_getattr(slot->val,
|
||||||
uniqueAttrNum, tupDesc, &isNull1);
|
uniqueAttrNum, tupDesc, &isNull1);
|
||||||
attr2 = heap_getattr(resultTupleSlot->val, InvalidBuffer,
|
attr2 = heap_getattr(resultTupleSlot->val,
|
||||||
uniqueAttrNum, tupDesc, &isNull2);
|
uniqueAttrNum, tupDesc, &isNull2);
|
||||||
|
|
||||||
if (isNull1 == isNull2)
|
if (isNull1 == isNull2)
|
||||||
|
|
|
@ -341,7 +341,7 @@ SPI_modifytuple(Relation rel, HeapTuple tuple, int natts, int *attnum,
|
||||||
/* fetch old values and nulls */
|
/* fetch old values and nulls */
|
||||||
for (i = 0; i < numberOfAttributes; i++)
|
for (i = 0; i < numberOfAttributes; i++)
|
||||||
{
|
{
|
||||||
v[i] = heap_getattr(tuple, InvalidBuffer, i + 1, rel->rd_att, &isnull);
|
v[i] = heap_getattr(tuple, i + 1, rel->rd_att, &isnull);
|
||||||
n[i] = (isnull) ? 'n' : ' ';
|
n[i] = (isnull) ? 'n' : ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,7 +420,7 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
val = heap_getattr(tuple, InvalidBuffer, fnumber, tupdesc, &isnull);
|
val = heap_getattr(tuple, fnumber, tupdesc, &isnull);
|
||||||
if (isnull)
|
if (isnull)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
foutoid = typtoout((Oid) tupdesc->attrs[fnumber - 1]->atttypid);
|
foutoid = typtoout((Oid) tupdesc->attrs[fnumber - 1]->atttypid);
|
||||||
|
@ -446,7 +446,7 @@ SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull)
|
||||||
return ((Datum) NULL);
|
return ((Datum) NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
val = heap_getattr(tuple, InvalidBuffer, fnumber, tupdesc, isnull);
|
val = heap_getattr(tuple, fnumber, tupdesc, isnull);
|
||||||
|
|
||||||
return (val);
|
return (val);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.10 1998/01/26 01:41:05 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.11 1998/01/31 04:38:34 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -299,7 +299,7 @@ be_printtup(HeapTuple tuple, TupleDesc typeinfo)
|
||||||
|
|
||||||
for (i = 0; i < tuple->t_natts; i++)
|
for (i = 0; i < tuple->t_natts; i++)
|
||||||
{
|
{
|
||||||
attr = heap_getattr(tuple, InvalidBuffer, i + 1, typeinfo, &isnull);
|
attr = heap_getattr(tuple, i + 1, typeinfo, &isnull);
|
||||||
typoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);
|
typoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);
|
||||||
|
|
||||||
lengths[i] = typeinfo->attrs[i]->attlen;
|
lengths[i] = typeinfo->attrs[i]->attlen;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.9 1998/01/07 21:04:41 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.10 1998/01/31 04:38:38 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -75,7 +75,6 @@ RemoveRewriteRule(char *ruleName)
|
||||||
Oid ruleId = (Oid) 0;
|
Oid ruleId = (Oid) 0;
|
||||||
Oid eventRelationOid = (Oid) NULL;
|
Oid eventRelationOid = (Oid) NULL;
|
||||||
Datum eventRelationOidDatum = (Datum) NULL;
|
Datum eventRelationOidDatum = (Datum) NULL;
|
||||||
Buffer buffer = (Buffer) NULL;
|
|
||||||
bool isNull = false;
|
bool isNull = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -109,7 +108,6 @@ RemoveRewriteRule(char *ruleName)
|
||||||
ruleId = tuple->t_oid;
|
ruleId = tuple->t_oid;
|
||||||
eventRelationOidDatum =
|
eventRelationOidDatum =
|
||||||
heap_getattr(tuple,
|
heap_getattr(tuple,
|
||||||
buffer,
|
|
||||||
Anum_pg_rewrite_ev_class,
|
Anum_pg_rewrite_ev_class,
|
||||||
RelationGetTupleDescriptor(RewriteRelation),
|
RelationGetTupleDescriptor(RewriteRelation),
|
||||||
&isNull);
|
&isNull);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.14 1998/01/07 21:04:42 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.15 1998/01/31 04:38:39 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -59,14 +59,13 @@ RuleIdGetActionInfo(Oid ruleoid, bool *instead_flag, Query **parseTrees)
|
||||||
elog(ERROR, "rule %u isn't in rewrite system relation", ruleoid);
|
elog(ERROR, "rule %u isn't in rewrite system relation", ruleoid);
|
||||||
|
|
||||||
ruleaction = (char *)heap_getattr(ruletuple,
|
ruleaction = (char *)heap_getattr(ruletuple,
|
||||||
InvalidBuffer,
|
|
||||||
Anum_pg_rewrite_ev_action,
|
Anum_pg_rewrite_ev_action,
|
||||||
ruleTupdesc,
|
ruleTupdesc,
|
||||||
&action_is_null);
|
&action_is_null);
|
||||||
rule_evqual_string = (char *)heap_getattr(ruletuple, InvalidBuffer,
|
rule_evqual_string = (char *)heap_getattr(ruletuple,
|
||||||
Anum_pg_rewrite_ev_qual,
|
Anum_pg_rewrite_ev_qual,
|
||||||
ruleTupdesc, &action_is_null);
|
ruleTupdesc, &action_is_null);
|
||||||
*instead_flag = !!heap_getattr(ruletuple, InvalidBuffer,
|
*instead_flag = !!heap_getattr(ruletuple,
|
||||||
Anum_pg_rewrite_is_instead,
|
Anum_pg_rewrite_is_instead,
|
||||||
ruleTupdesc, &instead_is_null);
|
ruleTupdesc, &instead_is_null);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.26 1998/01/07 21:05:17 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.27 1998/01/31 04:38:42 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -461,7 +461,7 @@ inv_read(LargeObjectDesc *obj_desc, char *buf, int nbytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy the data from this block into the buffer */
|
/* copy the data from this block into the buffer */
|
||||||
d = heap_getattr(htup, b, 2, obj_desc->hdesc, &isNull);
|
d = heap_getattr(htup, 2, obj_desc->hdesc, &isNull);
|
||||||
fsblock = (struct varlena *) DatumGetPointer(d);
|
fsblock = (struct varlena *) DatumGetPointer(d);
|
||||||
|
|
||||||
off = obj_desc->offset - obj_desc->lowbyte;
|
off = obj_desc->offset - obj_desc->lowbyte;
|
||||||
|
@ -637,9 +637,9 @@ inv_fetchtup(LargeObjectDesc *obj_desc, Buffer *bufP)
|
||||||
* return the tuple.
|
* return the tuple.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
d = heap_getattr(htup, *bufP, 1, obj_desc->hdesc, &isNull);
|
d = heap_getattr(htup, 1, obj_desc->hdesc, &isNull);
|
||||||
lastbyte = (int32) DatumGetInt32(d);
|
lastbyte = (int32) DatumGetInt32(d);
|
||||||
d = heap_getattr(htup, *bufP, 2, obj_desc->hdesc, &isNull);
|
d = heap_getattr(htup, 2, obj_desc->hdesc, &isNull);
|
||||||
fsblock = (struct varlena *) DatumGetPointer(d);
|
fsblock = (struct varlena *) DatumGetPointer(d);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -807,7 +807,7 @@ inv_wrold(LargeObjectDesc *obj_desc,
|
||||||
newpage = BufferGetPage(newbuf);
|
newpage = BufferGetPage(newbuf);
|
||||||
hr = obj_desc->heap_r;
|
hr = obj_desc->heap_r;
|
||||||
freespc = IFREESPC(page);
|
freespc = IFREESPC(page);
|
||||||
d = heap_getattr(htup, buffer, 2, obj_desc->hdesc, &isNull);
|
d = heap_getattr(htup, 2, obj_desc->hdesc, &isNull);
|
||||||
fsblock = (struct varlena *) DatumGetPointer(d);
|
fsblock = (struct varlena *) DatumGetPointer(d);
|
||||||
tupbytes = fsblock->vl_len - sizeof(fsblock->vl_len);
|
tupbytes = fsblock->vl_len - sizeof(fsblock->vl_len);
|
||||||
|
|
||||||
|
@ -1202,7 +1202,7 @@ _inv_getsize(Relation hreln, TupleDesc hdesc, Relation ireln)
|
||||||
index_endscan(iscan);
|
index_endscan(iscan);
|
||||||
|
|
||||||
/* get olastbyte attribute */
|
/* get olastbyte attribute */
|
||||||
d = heap_getattr(htup, buf, 1, hdesc, &isNull);
|
d = heap_getattr(htup, 1, hdesc, &isNull);
|
||||||
size = DatumGetInt32(d) + 1;
|
size = DatumGetInt32(d) + 1;
|
||||||
|
|
||||||
/* wei hates it if you forget to do this */
|
/* wei hates it if you forget to do this */
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.7 1997/11/20 23:22:57 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.8 1998/01/31 04:38:45 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -83,7 +83,6 @@ int4notin(int16 not_in_arg, char *relation_and_attr)
|
||||||
current_tuple = heap_getnext(scan_descriptor, 0, NULL))
|
current_tuple = heap_getnext(scan_descriptor, 0, NULL))
|
||||||
{
|
{
|
||||||
value = heap_getattr(current_tuple,
|
value = heap_getattr(current_tuple,
|
||||||
InvalidBuffer,
|
|
||||||
(AttrNumber) attrid,
|
(AttrNumber) attrid,
|
||||||
RelationGetTupleDescriptor(relation_to_scan),
|
RelationGetTupleDescriptor(relation_to_scan),
|
||||||
&dummy);
|
&dummy);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.12 1998/01/05 16:40:12 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.13 1998/01/31 04:38:46 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -68,7 +68,6 @@ regprocin(char *proname)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
result = (RegProcedure) heap_getattr(proctup,
|
result = (RegProcedure) heap_getattr(proctup,
|
||||||
InvalidBuffer,
|
|
||||||
ObjectIdAttributeNumber,
|
ObjectIdAttributeNumber,
|
||||||
RelationGetTupleDescriptor(proc),
|
RelationGetTupleDescriptor(proc),
|
||||||
&isnull);
|
&isnull);
|
||||||
|
@ -129,7 +128,7 @@ regprocout(RegProcedure proid)
|
||||||
bool isnull;
|
bool isnull;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
s = (char *) heap_getattr(proctup, InvalidBuffer, 1,
|
s = (char *) heap_getattr(proctup, 1,
|
||||||
RelationGetTupleDescriptor(proc), &isnull);
|
RelationGetTupleDescriptor(proc), &isnull);
|
||||||
if (!isnull)
|
if (!isnull)
|
||||||
{
|
{
|
||||||
|
@ -206,7 +205,7 @@ oid8types(Oid (*oidArray)[])
|
||||||
char *s;
|
char *s;
|
||||||
bool isnull;
|
bool isnull;
|
||||||
|
|
||||||
s = (char *) heap_getattr(typetup, InvalidBuffer, 1,
|
s = (char *) heap_getattr(typetup, 1,
|
||||||
RelationGetTupleDescriptor(type), &isnull);
|
RelationGetTupleDescriptor(type), &isnull);
|
||||||
if (!isnull)
|
if (!isnull)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.14 1998/01/05 16:40:15 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.15 1998/01/31 04:38:49 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -364,7 +364,6 @@ gethilokey(Oid relid,
|
||||||
}
|
}
|
||||||
*high = textout((struct varlena *)
|
*high = textout((struct varlena *)
|
||||||
heap_getattr(tuple,
|
heap_getattr(tuple,
|
||||||
InvalidBuffer,
|
|
||||||
Anum_pg_statistic_stahikey,
|
Anum_pg_statistic_stahikey,
|
||||||
RelationGetTupleDescriptor(rdesc),
|
RelationGetTupleDescriptor(rdesc),
|
||||||
&isnull));
|
&isnull));
|
||||||
|
@ -372,7 +371,6 @@ gethilokey(Oid relid,
|
||||||
elog(DEBUG, "gethilokey: high key is null");
|
elog(DEBUG, "gethilokey: high key is null");
|
||||||
*low = textout((struct varlena *)
|
*low = textout((struct varlena *)
|
||||||
heap_getattr(tuple,
|
heap_getattr(tuple,
|
||||||
InvalidBuffer,
|
|
||||||
Anum_pg_statistic_stalokey,
|
Anum_pg_statistic_stalokey,
|
||||||
RelationGetTupleDescriptor(rdesc),
|
RelationGetTupleDescriptor(rdesc),
|
||||||
&isnull));
|
&isnull));
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.34 1998/01/15 19:45:31 pgsql Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.35 1998/01/31 04:38:52 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -744,24 +744,24 @@ RelationBuildRuleLock(Relation relation)
|
||||||
rule->ruleId = pg_rewrite_tuple->t_oid;
|
rule->ruleId = pg_rewrite_tuple->t_oid;
|
||||||
|
|
||||||
rule->event =
|
rule->event =
|
||||||
(int) heap_getattr(pg_rewrite_tuple, InvalidBuffer,
|
(int) heap_getattr(pg_rewrite_tuple,
|
||||||
Anum_pg_rewrite_ev_type, pg_rewrite_tupdesc,
|
Anum_pg_rewrite_ev_type, pg_rewrite_tupdesc,
|
||||||
&isnull) - 48;
|
&isnull) - 48;
|
||||||
rule->attrno =
|
rule->attrno =
|
||||||
(int) heap_getattr(pg_rewrite_tuple, InvalidBuffer,
|
(int) heap_getattr(pg_rewrite_tuple,
|
||||||
Anum_pg_rewrite_ev_attr, pg_rewrite_tupdesc,
|
Anum_pg_rewrite_ev_attr, pg_rewrite_tupdesc,
|
||||||
&isnull);
|
&isnull);
|
||||||
rule->isInstead =
|
rule->isInstead =
|
||||||
!!heap_getattr(pg_rewrite_tuple, InvalidBuffer,
|
!!heap_getattr(pg_rewrite_tuple,
|
||||||
Anum_pg_rewrite_is_instead, pg_rewrite_tupdesc,
|
Anum_pg_rewrite_is_instead, pg_rewrite_tupdesc,
|
||||||
&isnull);
|
&isnull);
|
||||||
|
|
||||||
ruleaction =
|
ruleaction =
|
||||||
heap_getattr(pg_rewrite_tuple, InvalidBuffer,
|
heap_getattr(pg_rewrite_tuple,
|
||||||
Anum_pg_rewrite_ev_action, pg_rewrite_tupdesc,
|
Anum_pg_rewrite_ev_action, pg_rewrite_tupdesc,
|
||||||
&isnull);
|
&isnull);
|
||||||
rule_evqual_string =
|
rule_evqual_string =
|
||||||
heap_getattr(pg_rewrite_tuple, InvalidBuffer,
|
heap_getattr(pg_rewrite_tuple,
|
||||||
Anum_pg_rewrite_ev_qual, pg_rewrite_tupdesc,
|
Anum_pg_rewrite_ev_qual, pg_rewrite_tupdesc,
|
||||||
&isnull);
|
&isnull);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.12 1998/01/07 21:06:15 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.13 1998/01/31 04:38:54 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* These routines allow the parser/planner/executor to perform
|
* These routines allow the parser/planner/executor to perform
|
||||||
|
@ -544,7 +544,6 @@ SearchSysCacheGetAttribute(int cacheId,
|
||||||
}
|
}
|
||||||
|
|
||||||
attributeValue = heap_getattr(tp,
|
attributeValue = heap_getattr(tp,
|
||||||
(Buffer) 0,
|
|
||||||
attributeNumber,
|
attributeNumber,
|
||||||
RelationGetTupleDescriptor(relation),
|
RelationGetTupleDescriptor(relation),
|
||||||
&isNull);
|
&isNull);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.16 1998/01/07 21:06:26 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.17 1998/01/31 04:38:57 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -99,7 +99,7 @@ fmgr_dynamic(Oid procedureId, int *pronargs)
|
||||||
ProcedureRelationName);
|
ProcedureRelationName);
|
||||||
return ((func_ptr) NULL);
|
return ((func_ptr) NULL);
|
||||||
}
|
}
|
||||||
probinattr = heap_getattr(procedureTuple, (Buffer) 0,
|
probinattr = heap_getattr(procedureTuple,
|
||||||
Anum_pg_proc_probin,
|
Anum_pg_proc_probin,
|
||||||
RelationGetTupleDescriptor(rdesc), &isnull);
|
RelationGetTupleDescriptor(rdesc), &isnull);
|
||||||
if (!PointerIsValid(probinattr) /* || isnull */ )
|
if (!PointerIsValid(probinattr) /* || isnull */ )
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.5 1998/01/07 21:06:31 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.6 1998/01/31 04:39:07 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -85,13 +85,13 @@ GetDatabaseInfo(char *name, Oid *owner, char *path)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
dbowner = (Oid) heap_getattr(dbtup, InvalidBuffer,
|
dbowner = (Oid) heap_getattr(dbtup,
|
||||||
Anum_pg_database_datdba,
|
Anum_pg_database_datdba,
|
||||||
RelationGetTupleDescriptor(dbrel),
|
RelationGetTupleDescriptor(dbrel),
|
||||||
(char *) NULL);
|
(char *) NULL);
|
||||||
dbid = dbtup->t_oid;
|
dbid = dbtup->t_oid;
|
||||||
|
|
||||||
dbtext = (text *) heap_getattr(dbtup, InvalidBuffer,
|
dbtext = (text *) heap_getattr(dbtup,
|
||||||
Anum_pg_database_datpath,
|
Anum_pg_database_datpath,
|
||||||
RelationGetTupleDescriptor(dbrel),
|
RelationGetTupleDescriptor(dbrel),
|
||||||
(char *) NULL);
|
(char *) NULL);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/lselect.c,v 1.10 1998/01/15 19:46:08 pgsql Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/lselect.c,v 1.11 1998/01/31 04:39:12 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -198,12 +198,12 @@ tuplecmp(HeapTuple ltup, HeapTuple rtup, LeftistContext context)
|
||||||
return (1);
|
return (1);
|
||||||
while (nkey < context->nKeys && !result)
|
while (nkey < context->nKeys && !result)
|
||||||
{
|
{
|
||||||
lattr = heap_getattr(ltup, InvalidBuffer,
|
lattr = heap_getattr(ltup,
|
||||||
context->scanKeys[nkey].sk_attno,
|
context->scanKeys[nkey].sk_attno,
|
||||||
context->tupDesc, &isnull);
|
context->tupDesc, &isnull);
|
||||||
if (isnull)
|
if (isnull)
|
||||||
return (0);
|
return (0);
|
||||||
rattr = heap_getattr(rtup, InvalidBuffer,
|
rattr = heap_getattr(rtup,
|
||||||
context->scanKeys[nkey].sk_attno,
|
context->scanKeys[nkey].sk_attno,
|
||||||
context->tupDesc,
|
context->tupDesc,
|
||||||
&isnull);
|
&isnull);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.34 1998/01/25 05:18:34 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.35 1998/01/31 04:39:13 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Sorts the first relation into the second relation.
|
* Sorts the first relation into the second relation.
|
||||||
|
@ -1096,11 +1096,11 @@ _psort_cmp (HeapTuple *ltup, HeapTuple *rtup)
|
||||||
|
|
||||||
for (nkey = 0; nkey < PsortNkeys && !result; nkey++ )
|
for (nkey = 0; nkey < PsortNkeys && !result; nkey++ )
|
||||||
{
|
{
|
||||||
lattr = heap_getattr(*ltup, InvalidBuffer,
|
lattr = heap_getattr(*ltup,
|
||||||
PsortKeys[nkey].sk_attno,
|
PsortKeys[nkey].sk_attno,
|
||||||
PsortTupDesc,
|
PsortTupDesc,
|
||||||
&isnull1);
|
&isnull1);
|
||||||
rattr = heap_getattr(*rtup, InvalidBuffer,
|
rattr = heap_getattr(*rtup,
|
||||||
PsortKeys[nkey].sk_attno,
|
PsortKeys[nkey].sk_attno,
|
||||||
PsortTupDesc,
|
PsortTupDesc,
|
||||||
&isnull2);
|
&isnull2);
|
||||||
|
|
|
@ -6,13 +6,14 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: heapam.h,v 1.26 1998/01/27 15:57:41 momjian Exp $
|
* $Id: heapam.h,v 1.27 1998/01/31 04:39:21 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
#ifndef HEAPAM_H
|
#ifndef HEAPAM_H
|
||||||
#define HEAPAM_H
|
#define HEAPAM_H
|
||||||
|
|
||||||
|
#include <access/tupmacs.h>
|
||||||
#include <access/htup.h>
|
#include <access/htup.h>
|
||||||
#include <access/relscan.h>
|
#include <access/relscan.h>
|
||||||
#include <storage/block.h>
|
#include <storage/block.h>
|
||||||
|
@ -79,6 +80,59 @@ typedef HeapAccessStatisticsData *HeapAccessStatistics;
|
||||||
#define IncrHeapAccessStat(x) \
|
#define IncrHeapAccessStat(x) \
|
||||||
(heap_access_stats == NULL ? 0 : (heap_access_stats->x)++)
|
(heap_access_stats == NULL ? 0 : (heap_access_stats->x)++)
|
||||||
|
|
||||||
|
/* ----------------
|
||||||
|
* fastgetattr
|
||||||
|
*
|
||||||
|
* This gets called many times, so we macro the cacheable and NULL
|
||||||
|
* lookups, and call noncachegetattr() for the rest.
|
||||||
|
*
|
||||||
|
* ----------------
|
||||||
|
*/
|
||||||
|
#define fastgetattr(tup, attnum, tupleDesc, isnull) \
|
||||||
|
( \
|
||||||
|
AssertMacro((attnum) > 0) ? \
|
||||||
|
( \
|
||||||
|
((isnull) ? (*(isnull) = false) : (dummyret)NULL), \
|
||||||
|
HeapTupleNoNulls(tup) ? \
|
||||||
|
( \
|
||||||
|
((tupleDesc)->attrs[(attnum)-1]->attcacheoff > 0) ? \
|
||||||
|
( \
|
||||||
|
(Datum)fetchatt(&((tupleDesc)->attrs[(attnum)-1]), \
|
||||||
|
(char *) (tup) + (tup)->t_hoff + (tupleDesc)->attrs[(attnum)-1]->attcacheoff) \
|
||||||
|
) \
|
||||||
|
: \
|
||||||
|
( \
|
||||||
|
((attnum)-1 == 0) ? \
|
||||||
|
( \
|
||||||
|
(Datum)fetchatt(&((tupleDesc)->attrs[0]), (char *) (tup) + (tup)->t_hoff) \
|
||||||
|
) \
|
||||||
|
: \
|
||||||
|
( \
|
||||||
|
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 \
|
||||||
|
) \
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* heap_getattr
|
* heap_getattr
|
||||||
*
|
*
|
||||||
|
@ -97,15 +151,46 @@ typedef HeapAccessStatisticsData *HeapAccessStatistics;
|
||||||
* Because this macro is often called with constants, it generates
|
* Because this macro is often called with constants, it generates
|
||||||
* compiler warnings about 'left-hand comma expression has no effect.
|
* compiler warnings about 'left-hand comma expression has no effect.
|
||||||
*
|
*
|
||||||
* ---------------- */
|
* ----------------
|
||||||
#define heap_getattr(tup, b, attnum, tupleDesc, isnull) \
|
*/
|
||||||
(AssertMacro((tup) != NULL) ? \
|
#define heap_getattr(tup, attnum, tupleDesc, isnull) \
|
||||||
|
( \
|
||||||
|
AssertMacro((tup) != NULL && \
|
||||||
|
(attnum) > FirstLowInvalidHeapAttributeNumber && \
|
||||||
|
(attnum) != 0) ? \
|
||||||
|
( \
|
||||||
((attnum) > (int) (tup)->t_natts) ? \
|
((attnum) > (int) (tup)->t_natts) ? \
|
||||||
(((isnull) ? (*(isnull) = true) : (dummyret)NULL), (Datum)NULL) : \
|
( \
|
||||||
|
((isnull) ? (*(isnull) = true) : (dummyret)NULL), \
|
||||||
|
(Datum)NULL \
|
||||||
|
) \
|
||||||
|
: \
|
||||||
|
( \
|
||||||
((attnum) > 0) ? \
|
((attnum) > 0) ? \
|
||||||
fastgetattr((tup), (attnum), (tupleDesc), (isnull)) : \
|
( \
|
||||||
(((isnull) ? (*(isnull) = false) : (dummyret)NULL), heap_getsysattr((tup), (b), (attnum))) : \
|
fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \
|
||||||
(Datum)NULL)
|
) \
|
||||||
|
: \
|
||||||
|
( \
|
||||||
|
((isnull) ? (*(isnull) = false) : (dummyret)NULL), \
|
||||||
|
((attnum) == SelfItemPointerAttributeNumber) ? \
|
||||||
|
( \
|
||||||
|
(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 */
|
||||||
|
|
||||||
|
@ -143,7 +228,7 @@ extern int heap_attisnull(HeapTuple tup, int attnum);
|
||||||
extern int heap_sysattrlen(AttrNumber attno);
|
extern int heap_sysattrlen(AttrNumber attno);
|
||||||
extern bool heap_sysattrbyval(AttrNumber attno);
|
extern bool heap_sysattrbyval(AttrNumber attno);
|
||||||
extern Datum heap_getsysattr(HeapTuple tup, Buffer b, int attnum);
|
extern Datum heap_getsysattr(HeapTuple tup, Buffer b, int attnum);
|
||||||
extern Datum fastgetattr(HeapTuple tup, int attnum,
|
extern Datum nocachegetattr(HeapTuple tup, int attnum,
|
||||||
TupleDesc att, bool *isnull);
|
TupleDesc att, bool *isnull);
|
||||||
extern HeapTuple heap_copytuple(HeapTuple tuple);
|
extern HeapTuple heap_copytuple(HeapTuple tuple);
|
||||||
extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor,
|
extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: htup.h,v 1.7 1997/11/02 15:26:42 vadim Exp $
|
* $Id: htup.h,v 1.8 1998/01/31 04:39:22 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -63,6 +63,8 @@ typedef HeapTupleData *HeapTuple;
|
||||||
#define MaxCommandIdAttributeNumber (-6)
|
#define MaxCommandIdAttributeNumber (-6)
|
||||||
#define FirstLowInvalidHeapAttributeNumber (-7)
|
#define FirstLowInvalidHeapAttributeNumber (-7)
|
||||||
|
|
||||||
|
/* If you make any changes above, the order off offsets in this must change */
|
||||||
|
extern long heap_sysoffset[];
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* support macros
|
* support macros
|
||||||
|
|
|
@ -6,15 +6,18 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: itup.h,v 1.9 1998/01/24 22:48:06 momjian Exp $
|
* $Id: itup.h,v 1.10 1998/01/31 04:39:23 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
#ifndef ITUP_H
|
#ifndef ITUP_H
|
||||||
#define ITUP_H
|
#define ITUP_H
|
||||||
|
|
||||||
|
#include <access/ibit.h>
|
||||||
|
#include <access/tupmacs.h>
|
||||||
#include <access/tupdesc.h>
|
#include <access/tupdesc.h>
|
||||||
#include <storage/itemptr.h>
|
#include <storage/itemptr.h>
|
||||||
|
#include <utils/memutils.h>
|
||||||
|
|
||||||
#define MaxIndexAttributeNumber 7
|
#define MaxIndexAttributeNumber 7
|
||||||
|
|
||||||
|
@ -87,12 +90,87 @@ typedef struct PredInfo
|
||||||
|
|
||||||
#define IndexTupleHasMinHeader(itup) (IndexTupleNoNulls(itup))
|
#define IndexTupleHasMinHeader(itup) (IndexTupleNoNulls(itup))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Takes an infomask as argument (primarily because this needs to be usable
|
||||||
|
* at index_formtuple time so enough space is allocated).
|
||||||
|
*
|
||||||
|
* Change me if adding an attribute to IndexTuples!!!!!!!!!!!
|
||||||
|
*/
|
||||||
|
#define IndexInfoFindDataOffset(t_info) \
|
||||||
|
( \
|
||||||
|
(!((unsigned short)(t_info) & INDEX_NULL_MASK)) ? \
|
||||||
|
( \
|
||||||
|
(Size)sizeof(IndexTupleData) \
|
||||||
|
) \
|
||||||
|
: \
|
||||||
|
( \
|
||||||
|
(Size)DOUBLEALIGN(sizeof(IndexTupleData) + sizeof(IndexAttributeBitMapData)) \
|
||||||
|
) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/* ----------------
|
||||||
|
* index_getattr
|
||||||
|
*
|
||||||
|
* This gets called many times, so we macro the cacheable and NULL
|
||||||
|
* lookups, and call noncachegetattr() for the rest.
|
||||||
|
*
|
||||||
|
* ----------------
|
||||||
|
*/
|
||||||
|
#define index_getattr(tup, attnum, tupleDesc, isnull) \
|
||||||
|
( \
|
||||||
|
AssertMacro(PointerIsValid(isnull) && (attnum) > 0) ? \
|
||||||
|
( \
|
||||||
|
*(isnull) = false, \
|
||||||
|
IndexTupleNoNulls(tup) ? \
|
||||||
|
( \
|
||||||
|
((tupleDesc)->attrs[(attnum)-1]->attcacheoff > 0) ? \
|
||||||
|
( \
|
||||||
|
(Datum)fetchatt(&((tupleDesc)->attrs[(attnum)-1]), \
|
||||||
|
(char *) (tup) + \
|
||||||
|
(IndexTupleHasMinHeader(tup) ? sizeof (*(tup)) : \
|
||||||
|
IndexInfoFindDataOffset((tup)->t_info)) + \
|
||||||
|
(tupleDesc)->attrs[(attnum)-1]->attcacheoff) \
|
||||||
|
) \
|
||||||
|
: \
|
||||||
|
( \
|
||||||
|
((attnum)-1 == 0) ? \
|
||||||
|
( \
|
||||||
|
(Datum)fetchatt(&((tupleDesc)->attrs[0]), \
|
||||||
|
(char *) (tup) + \
|
||||||
|
(IndexTupleHasMinHeader(tup) ? sizeof (*(tup)) : \
|
||||||
|
IndexInfoFindDataOffset((tup)->t_info))) \
|
||||||
|
) \
|
||||||
|
: \
|
||||||
|
( \
|
||||||
|
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 \
|
||||||
|
) \
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/* indextuple.h */
|
/* indextuple.h */
|
||||||
extern IndexTuple index_formtuple(TupleDesc tupleDescriptor,
|
extern IndexTuple index_formtuple(TupleDesc tupleDescriptor,
|
||||||
Datum value[], char null[]);
|
Datum value[], char null[]);
|
||||||
extern Datum index_getattr(IndexTuple tuple, AttrNumber attNum,
|
extern Datum nocache_index_getattr(IndexTuple tup, int attnum,
|
||||||
TupleDesc tupDesc, bool *isNullOutP);
|
TupleDesc tupleDesc, bool *isnull);
|
||||||
extern RetrieveIndexResult FormRetrieveIndexResult(ItemPointer indexItemPointer,
|
extern RetrieveIndexResult FormRetrieveIndexResult(ItemPointer indexItemPointer,
|
||||||
ItemPointer heapItemPointer);
|
ItemPointer heapItemPointer);
|
||||||
extern void CopyIndexTuple(IndexTuple source, IndexTuple *target);
|
extern void CopyIndexTuple(IndexTuple source, IndexTuple *target);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: valid.h,v 1.12 1998/01/15 19:46:18 pgsql Exp $
|
* $Id: valid.h,v 1.13 1998/01/31 04:39:24 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -53,7 +53,7 @@ do \
|
||||||
(result) = true; /* may change */ \
|
(result) = true; /* may change */ \
|
||||||
for (; __cur_nkeys--; __cur_keys++) \
|
for (; __cur_nkeys--; __cur_keys++) \
|
||||||
{ \
|
{ \
|
||||||
__atp = heap_getattr((tuple), InvalidBuffer, \
|
__atp = heap_getattr((tuple), \
|
||||||
__cur_keys->sk_attno, \
|
__cur_keys->sk_attno, \
|
||||||
(tupdesc), \
|
(tupdesc), \
|
||||||
&__isnull); \
|
&__isnull); \
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: parse_node.h,v 1.7 1998/01/20 22:12:16 momjian Exp $
|
* $Id: parse_node.h,v 1.8 1998/01/31 04:39:26 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -28,7 +28,6 @@ typedef struct QueryTreeList
|
||||||
/* state information used during parse analysis */
|
/* state information used during parse analysis */
|
||||||
typedef struct ParseState
|
typedef struct ParseState
|
||||||
{
|
{
|
||||||
struct ParseState;
|
|
||||||
int p_last_resno;
|
int p_last_resno;
|
||||||
List *p_rtable;
|
List *p_rtable;
|
||||||
List *p_insert_columns;
|
List *p_insert_columns;
|
||||||
|
|
Loading…
Reference in New Issue