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
726c3854
Commit
726c3854
authored
Jan 31, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline fastgetattr and others so data access does not use function
calls.
parent
2df6bba3
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
350 additions
and
215 deletions
+350
-215
src/backend/access/common/heaptuple.c
src/backend/access/common/heaptuple.c
+37
-20
src/backend/access/common/indextuple.c
src/backend/access/common/indextuple.c
+43
-74
src/backend/access/common/printtup.c
src/backend/access/common/printtup.c
+6
-6
src/backend/access/index/indexam.c
src/backend/access/index/indexam.c
+2
-3
src/backend/catalog/aclchk.c
src/backend/catalog/aclchk.c
+6
-6
src/backend/commands/async.c
src/backend/commands/async.c
+7
-7
src/backend/commands/copy.c
src/backend/commands/copy.c
+4
-4
src/backend/commands/dbcommands.c
src/backend/commands/dbcommands.c
+3
-3
src/backend/commands/user.c
src/backend/commands/user.c
+7
-7
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+5
-5
src/backend/executor/execJunk.c
src/backend/executor/execJunk.c
+3
-3
src/backend/executor/execQual.c
src/backend/executor/execQual.c
+1
-4
src/backend/executor/functions.c
src/backend/executor/functions.c
+2
-2
src/backend/executor/nodeAgg.c
src/backend/executor/nodeAgg.c
+0
-1
src/backend/executor/nodeGroup.c
src/backend/executor/nodeGroup.c
+1
-3
src/backend/executor/nodeUnique.c
src/backend/executor/nodeUnique.c
+3
-3
src/backend/executor/spi.c
src/backend/executor/spi.c
+3
-3
src/backend/libpq/be-dumpdata.c
src/backend/libpq/be-dumpdata.c
+2
-2
src/backend/rewrite/rewriteRemove.c
src/backend/rewrite/rewriteRemove.c
+1
-3
src/backend/rewrite/rewriteSupport.c
src/backend/rewrite/rewriteSupport.c
+3
-4
src/backend/storage/large_object/inv_api.c
src/backend/storage/large_object/inv_api.c
+6
-6
src/backend/utils/adt/not_in.c
src/backend/utils/adt/not_in.c
+1
-2
src/backend/utils/adt/regproc.c
src/backend/utils/adt/regproc.c
+3
-4
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/selfuncs.c
+1
-3
src/backend/utils/cache/relcache.c
src/backend/utils/cache/relcache.c
+6
-6
src/backend/utils/cache/syscache.c
src/backend/utils/cache/syscache.c
+1
-2
src/backend/utils/fmgr/dfmgr.c
src/backend/utils/fmgr/dfmgr.c
+2
-2
src/backend/utils/misc/database.c
src/backend/utils/misc/database.c
+3
-3
src/backend/utils/sort/lselect.c
src/backend/utils/sort/lselect.c
+3
-3
src/backend/utils/sort/psort.c
src/backend/utils/sort/psort.c
+3
-3
src/include/access/heapam.h
src/include/access/heapam.h
+95
-10
src/include/access/htup.h
src/include/access/htup.h
+3
-1
src/include/access/itup.h
src/include/access/itup.h
+81
-3
src/include/access/valid.h
src/include/access/valid.h
+2
-2
src/include/parser/parse_node.h
src/include/parser/parse_node.h
+1
-2
No files found.
src/backend/access/common/heaptuple.c
View file @
726c3854
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
*
*
* heaptuple.c--
* heaptuple.c--
* This file contains heap tuple accessor and mutator routines, as well
* This file contains heap tuple accessor and mutator routines, as well
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.3
0 1998/01/07 21:00:40
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.3
1 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 @@
...
@@ -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 */
...
@@ -345,7 +355,7 @@ heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
...
@@ -345,7 +355,7 @@ heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
{
{
switch
(
attnum
)
switch
(
attnum
)
{
{
case
SelfItemPointerAttributeNumber
:
case
SelfItemPointerAttributeNumber
:
return
((
Datum
)
&
tup
->
t_ctid
);
return
((
Datum
)
&
tup
->
t_ctid
);
case
ObjectIdAttributeNumber
:
case
ObjectIdAttributeNumber
:
return
((
Datum
)
(
long
)
tup
->
t_oid
);
return
((
Datum
)
(
long
)
tup
->
t_oid
);
...
@@ -364,10 +374,12 @@ heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
...
@@ -364,10 +374,12 @@ heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
}
}
/* ----------------
/* ----------------
* fastgetattr
* nocachegetattr
*
* This only gets called from fastgetattr() macro, in cases where
* we can't use a cacheoffset and the value is not null.
*
*
* This is a newer version of fastgetattr which attempts to be
* This caches attribute offsets in the attribute descriptor.
* faster by caching 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)
...
@@ -381,7 +393,7 @@ heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
* ----------------
* ----------------
*/
*/
Datum
Datum
fast
getattr
(
HeapTuple
tup
,
nocache
getattr
(
HeapTuple
tup
,
int
attnum
,
int
attnum
,
TupleDesc
tupleDesc
,
TupleDesc
tupleDesc
,
bool
*
isnull
)
bool
*
isnull
)
...
@@ -391,13 +403,15 @@ fastgetattr(HeapTuple tup,
...
@@ -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,
...
@@ -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,
...
@@ -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,
...
@@ -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,
...
@@ -539,7 +557,7 @@ fastgetattr(HeapTuple tup,
if
(
att
[
j
]
->
attlen
<
sizeof
(
int32
))
if
(
att
[
j
]
->
attlen
<
sizeof
(
int32
))
{
{
elog
(
ERROR
,
elog
(
ERROR
,
"
fast
getattr: attribute %d has len %d"
,
"
nocache
getattr: 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,
...
@@ -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
,
"
fast
getattr2: attribute %d has len %d"
,
"
nocache
getattr2: 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,
...
@@ -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
,
"
fast
getattr3: attribute %d has len %d"
,
elog
(
ERROR
,
"
nocache
getattr3: 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,
...
@@ -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,
...
@@ -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 */
...
@@ -959,3 +975,4 @@ heap_addheader(uint32 natts, /* max domain index */
return
(
tup
);
return
(
tup
);
}
}
src/backend/access/common/indextuple.c
View file @
726c3854
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.2
2 1998/01/07 21:00:4
3 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.2
3 1998/01/31 04:38:0
3 momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -26,11 +26,6 @@
...
@@ -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,
...
@@ -117,10 +112,12 @@ index_formtuple(TupleDesc tupleDescriptor,
}
}
/* ----------------
/* ----------------
* fastgetiattr
* nocache_index_getattr
*
* This gets called from index_getattr() macro, and only in cases
* where we can't use cacheoffset and the value is not null.
*
*
* This is a newer version of fastgetiattr which attempts to be
* This caches attribute offsets in the attribute descriptor.
* faster by caching 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,
...
@@ -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
fastgeti
attr
(
IndexTuple
tup
,
nocache_index_get
attr
(
IndexTuple
tup
,
int
attnum
,
int
attnum
,
TupleDesc
tupleDesc
,
TupleDesc
tupleDesc
,
bool
*
isnull
)
bool
*
isnull
)
...
@@ -150,9 +147,6 @@ fastgetiattr(IndexTuple tup,
...
@@ -150,9 +147,6 @@ fastgetiattr(IndexTuple tup,
* ----------------
* ----------------
*/
*/
Assert
(
PointerIsValid
(
isnull
));
Assert
(
attnum
>
0
);
/* ----------------
/* ----------------
* Three cases:
* Three cases:
*
*
...
@@ -162,27 +156,37 @@ fastgetiattr(IndexTuple tup,
...
@@ -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,
...
@@ -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,
...
@@ -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
;
{
return
(
Datum
)
NULL
;
*
isnull
=
true
;
return
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,
...
@@ -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,
...
@@ -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
,
"
fastgeti
attr: attribute %d has len %d"
,
elog
(
ERROR
,
"
nocache_index_get
attr: attribute %d has len %d"
,
j
,
att
[
j
]
->
attlen
);
j
,
att
[
j
]
->
attlen
);
break
;
break
;
...
@@ -324,8 +332,8 @@ fastgetiattr(IndexTuple tup,
...
@@ -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,
...
@@ -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
,
"
fastgeti
attr2: attribute %d has len %d"
,
elog
(
ERROR
,
"
nocache_index_get
attr2: attribute %d has len %d"
,
i
,
att
[
i
]
->
attlen
);
i
,
att
[
i
]
->
attlen
);
break
;
break
;
...
@@ -391,7 +399,7 @@ fastgetiattr(IndexTuple tup,
...
@@ -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:
fast
getattr(). - vadim 06/12/97
* heaptuple.c:
nocache
getattr(). - vadim 06/12/97
*/
*/
switch
(
att
[
attnum
]
->
attlen
)
switch
(
att
[
attnum
]
->
attlen
)
{
{
...
@@ -409,7 +417,7 @@ fastgetiattr(IndexTuple tup,
...
@@ -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,
...
@@ -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,
...
@@ -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.
...
...
src/backend/access/common/printtup.c
View file @
726c3854
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.2
2 1998/01/07 21:00:44
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.2
3 1998/01/31 04:38:03
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -97,7 +97,7 @@ printtup(HeapTuple tuple, TupleDesc typeinfo)
...
@@ -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)
...
@@ -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)
...
@@ -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)
...
@@ -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)
...
@@ -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 */
...
...
src/backend/access/index/indexam.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -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,
...
@@ -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,
...
@@ -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
;
...
...
src/backend/catalog/aclchk.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -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,
...
@@ -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)
...
@@ -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)
...
@@ -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)
...
@@ -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)
...
@@ -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
);
...
...
src/backend/commands/async.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.2
7 1998/01/25 05:12:54
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.2
8 1998/01/31 04:38:17
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -219,7 +219,7 @@ Async_Notify(char *relname)
...
@@ -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()
...
@@ -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)
...
@@ -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()
...
@@ -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
);
...
...
src/backend/commands/copy.c
View file @
726c3854
...
@@ -6,7 +6,7 @@
...
@@ -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)
...
@@ -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,
...
@@ -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
)
++
;
...
...
src/backend/commands/dbcommands.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -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,
...
@@ -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
);
...
...
src/backend/commands/user.c
View file @
726c3854
...
@@ -118,12 +118,12 @@ void DefineUser(CreateUserStmt *stmt) {
...
@@ -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) {
...
@@ -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) {
...
@@ -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) {
...
@@ -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
);
...
...
src/backend/commands/vacuum.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.5
8 1998/01/15 19:42:40 pgsql
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.5
9 1998/01/31 04:38:21 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -299,7 +299,7 @@ vc_getrels(NameData *VacRelP)
...
@@ -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)
...
@@ -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)
...
@@ -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)
...
@@ -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
)
...
...
src/backend/executor/execJunk.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -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,
...
@@ -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)
...
@@ -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'
;
...
...
src/backend/executor/execQual.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.2
3 1998/01/15 19:44:24 pgsql
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.2
4 1998/01/31 04:38:27 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -301,7 +301,6 @@ ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull)
...
@@ -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,
...
@@ -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)
...
@@ -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
);
...
...
src/backend/executor/functions.c
View file @
726c3854
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.1
4 1997/12/11 17:36:16
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.1
5 1998/01/31 04:38:28
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -82,7 +82,7 @@ ProjectAttribute(TupleDesc TD,
...
@@ -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
;
...
...
src/backend/executor/nodeAgg.c
View file @
726c3854
...
@@ -663,7 +663,6 @@ aggGetAttr(TupleTableSlot *slot,
...
@@ -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? */
...
...
src/backend/executor/nodeGroup.c
View file @
726c3854
...
@@ -13,7 +13,7 @@
...
@@ -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.1
3 1998/01/27 15:41:32
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.1
4 1998/01/31 04:38:29
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -402,13 +402,11 @@ sameGroup(TupleTableSlot *oldslot,
...
@@ -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
);
...
...
src/backend/executor/nodeUnique.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.1
1 1997/09/12 04:07:44
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.1
2 1998/01/31 04:38:31
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -187,9 +187,9 @@ ExecUnique(Unique *node)
...
@@ -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
)
...
...
src/backend/executor/spi.c
View file @
726c3854
...
@@ -341,7 +341,7 @@ SPI_modifytuple(Relation rel, HeapTuple tuple, int natts, int *attnum,
...
@@ -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)
...
@@ -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)
...
@@ -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
);
}
}
...
...
src/backend/libpq/be-dumpdata.c
View file @
726c3854
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.1
0 1998/01/26 01:41:05 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.1
1 1998/01/31 04:38:34 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -299,7 +299,7 @@ be_printtup(HeapTuple tuple, TupleDesc typeinfo)
...
@@ -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
;
...
...
src/backend/rewrite/rewriteRemove.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -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)
...
@@ -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)
...
@@ -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
);
...
...
src/backend/rewrite/rewriteSupport.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.1
4 1998/01/07 21:04:42
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.1
5 1998/01/31 04:38:39
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -59,14 +59,13 @@ RuleIdGetActionInfo(Oid ruleoid, bool *instead_flag, Query **parseTrees)
...
@@ -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
);
...
...
src/backend/storage/large_object/inv_api.c
View file @
726c3854
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.2
6 1998/01/07 21:05:17
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.2
7 1998/01/31 04:38:42
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -461,7 +461,7 @@ inv_read(LargeObjectDesc *obj_desc, char *buf, int nbytes)
...
@@ -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)
...
@@ -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,
...
@@ -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)
...
@@ -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 */
...
...
src/backend/utils/adt/not_in.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -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)
...
@@ -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
);
...
...
src/backend/utils/adt/regproc.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.1
2 1998/01/05 16:40:12
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.1
3 1998/01/31 04:38:46
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -68,7 +68,6 @@ regprocin(char *proname)
...
@@ -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)
...
@@ -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)[])
...
@@ -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
)
{
{
...
...
src/backend/utils/adt/selfuncs.c
View file @
726c3854
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.1
4 1998/01/05 16:40:15
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.1
5 1998/01/31 04:38:49
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -364,7 +364,6 @@ gethilokey(Oid relid,
...
@@ -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,
...
@@ -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
));
...
...
src/backend/utils/cache/relcache.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.3
4 1998/01/15 19:45:31 pgsql
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.3
5 1998/01/31 04:38:52 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -744,24 +744,24 @@ RelationBuildRuleLock(Relation relation)
...
@@ -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
);
...
...
src/backend/utils/cache/syscache.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.1
2 1998/01/07 21:06:15
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.1
3 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,
...
@@ -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
);
...
...
src/backend/utils/fmgr/dfmgr.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.1
6 1998/01/07 21:06:26
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.1
7 1998/01/31 04:38:57
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -99,7 +99,7 @@ fmgr_dynamic(Oid procedureId, int *pronargs)
...
@@ -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 */
)
...
...
src/backend/utils/misc/database.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -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)
...
@@ -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
);
...
...
src/backend/utils/sort/lselect.c
View file @
726c3854
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/lselect.c,v 1.1
0 1998/01/15 19:46:08 pgsql
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/lselect.c,v 1.1
1 1998/01/31 04:39:12 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -198,12 +198,12 @@ tuplecmp(HeapTuple ltup, HeapTuple rtup, LeftistContext context)
...
@@ -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
);
...
...
src/backend/utils/sort/psort.c
View file @
726c3854
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.3
4 1998/01/25 05:18:34 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.3
5 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)
...
@@ -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
);
...
...
src/include/access/heapam.h
View file @
726c3854
...
@@ -6,13 +6,14 @@
...
@@ -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.2
6 1998/01/27 15:57:4
1 momjian Exp $
* $Id: heapam.h,v 1.2
7 1998/01/31 04:39:2
1 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;
...
@@ -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;
...
@@ -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) : \
( \
((attnum) > 0) ? \
((isnull) ? (*(isnull) = true) : (dummyret)NULL), \
fastgetattr((tup), (attnum), (tupleDesc), (isnull)) : \
(Datum)NULL \
(((isnull) ? (*(isnull) = false) : (dummyret)NULL), heap_getsysattr((tup), (b), (attnum))) : \
) \
(Datum)NULL)
: \
( \
((attnum) > 0) ? \
( \
fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \
) \
: \
( \
((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);
...
@@ -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
fast
getattr
(
HeapTuple
tup
,
int
attnum
,
extern
Datum
nocache
getattr
(
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
,
...
...
src/include/access/htup.h
View file @
726c3854
...
@@ -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: 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;
...
@@ -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
...
...
src/include/access/itup.h
View file @
726c3854
...
@@ -6,15 +6,18 @@
...
@@ -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
...
@@ -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
attN
um
,
extern
Datum
nocache_index_getattr
(
IndexTuple
tup
,
int
attn
um
,
TupleDesc
tup
Desc
,
bool
*
isNullOutP
);
TupleDesc
tup
leDesc
,
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
);
...
...
src/include/access/valid.h
View file @
726c3854
...
@@ -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: valid.h,v 1.1
2 1998/01/15 19:46:18 pgsql
Exp $
* $Id: valid.h,v 1.1
3 1998/01/31 04:39:24 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -53,7 +53,7 @@ do \
...
@@ -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); \
...
...
src/include/parser/parse_node.h
View file @
726c3854
...
@@ -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: parse_node.h,v 1.
7 1998/01/20 22:12:1
6 momjian Exp $
* $Id: parse_node.h,v 1.
8 1998/01/31 04:39:2
6 momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -28,7 +28,6 @@ typedef struct QueryTreeList
...
@@ -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
;
...
...
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