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
faf7d781
Commit
faf7d781
authored
Jul 19, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install new alignment code to use MAXALIGN rather than DOUBLEALIGN where
approproate.
parent
e259780b
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
70 additions
and
69 deletions
+70
-69
src/backend/access/common/heaptuple.c
src/backend/access/common/heaptuple.c
+3
-3
src/backend/access/common/indextuple.c
src/backend/access/common/indextuple.c
+2
-2
src/backend/access/hash/hashinsert.c
src/backend/access/hash/hashinsert.c
+2
-2
src/backend/access/hash/hashovfl.c
src/backend/access/hash/hashovfl.c
+2
-2
src/backend/access/hash/hashpage.c
src/backend/access/hash/hashpage.c
+4
-4
src/backend/access/hash/hashutil.c
src/backend/access/hash/hashutil.c
+3
-3
src/backend/access/heap/heapam.c
src/backend/access/heap/heapam.c
+2
-2
src/backend/access/heap/hio.c
src/backend/access/heap/hio.c
+3
-3
src/backend/access/nbtree/nbtinsert.c
src/backend/access/nbtree/nbtinsert.c
+8
-8
src/backend/access/nbtree/nbtsort.c
src/backend/access/nbtree/nbtsort.c
+9
-9
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+5
-5
src/backend/rewrite/rewriteDefine.c
src/backend/rewrite/rewriteDefine.c
+4
-3
src/backend/storage/large_object/inv_api.c
src/backend/storage/large_object/inv_api.c
+5
-5
src/backend/storage/page/bufpage.c
src/backend/storage/page/bufpage.c
+7
-7
src/backend/utils/adt/arrayfuncs.c
src/backend/utils/adt/arrayfuncs.c
+2
-2
src/include/access/hash.h
src/include/access/hash.h
+2
-2
src/include/access/htup.h
src/include/access/htup.h
+2
-2
src/include/access/itup.h
src/include/access/itup.h
+2
-2
src/include/utils/array.h
src/include/utils/array.h
+3
-3
No files found.
src/backend/access/common/heaptuple.c
View file @
faf7d781
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.5
7 1999/07/17 20:16:3
5 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.5
8 1999/07/19 07:07:1
5 momjian Exp $
*
* NOTES
* The old interface functions have been converted to macros
...
...
@@ -677,7 +677,7 @@ heap_formtuple(TupleDesc tupleDescriptor,
len
+=
bitmaplen
;
}
hoff
=
len
=
DOUBLE
ALIGN
(
len
);
/* be conservative here */
hoff
=
len
=
MAX
ALIGN
(
len
);
/* be conservative here */
len
+=
ComputeDataSize
(
tupleDescriptor
,
value
,
nulls
);
...
...
@@ -811,7 +811,7 @@ heap_addheader(uint32 natts, /* max domain index */
len
=
offsetof
(
HeapTupleHeaderData
,
t_bits
);
hoff
=
len
=
DOUBLE
ALIGN
(
len
);
/* be conservative */
hoff
=
len
=
MAX
ALIGN
(
len
);
/* be conservative */
len
+=
structlen
;
tuple
=
(
HeapTuple
)
palloc
(
HEAPTUPLESIZE
+
len
);
td
=
tuple
->
t_data
=
(
HeapTupleHeader
)
((
char
*
)
tuple
+
HEAPTUPLESIZE
);
...
...
src/backend/access/common/indextuple.c
View file @
faf7d781
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.3
7 1999/07/17 20:16:3
5 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.3
8 1999/07/19 07:07:1
5 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -60,7 +60,7 @@ index_formtuple(TupleDesc tupleDescriptor,
hoff
=
IndexInfoFindDataOffset
(
infomask
);
size
=
hoff
+
ComputeDataSize
(
tupleDescriptor
,
value
,
null
);
size
=
DOUBLE
ALIGN
(
size
);
/* be conservative */
size
=
MAX
ALIGN
(
size
);
/* be conservative */
tp
=
(
char
*
)
palloc
(
size
);
tuple
=
(
IndexTuple
)
tp
;
...
...
src/backend/access/hash/hashinsert.c
View file @
faf7d781
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.1
7 1999/07/15 23:02:54
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.1
8 1999/07/19 07:07:16
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -128,7 +128,7 @@ _hash_insertonpg(Relation rel,
itemsz
=
IndexTupleDSize
(
hitem
->
hash_itup
)
+
(
sizeof
(
HashItemData
)
-
sizeof
(
IndexTupleData
));
itemsz
=
DOUBLE
ALIGN
(
itemsz
);
itemsz
=
MAX
ALIGN
(
itemsz
);
while
(
PageGetFreeSpace
(
page
)
<
itemsz
)
{
...
...
src/backend/access/hash/hashovfl.c
View file @
faf7d781
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.2
4 1999/07/17 20:16:38
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.2
5 1999/07/19 07:07:16
momjian Exp $
*
* NOTES
* Overflow pages look like ordinary relation pages.
...
...
@@ -531,7 +531,7 @@ _hash_squeezebucket(Relation rel,
hitem
=
(
HashItem
)
PageGetItem
(
rpage
,
PageGetItemId
(
rpage
,
roffnum
));
itemsz
=
IndexTupleDSize
(
hitem
->
hash_itup
)
+
(
sizeof
(
HashItemData
)
-
sizeof
(
IndexTupleData
));
itemsz
=
DOUBLE
ALIGN
(
itemsz
);
itemsz
=
MAX
ALIGN
(
itemsz
);
/*
* walk up the bucket chain, looking for a page big enough for
...
...
src/backend/access/hash/hashpage.c
View file @
faf7d781
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.2
4 1999/07/17 20:16:39
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.2
5 1999/07/19 07:07:17
momjian Exp $
*
* NOTES
* Postgres hash pages look like ordinary relation pages. The opaque
...
...
@@ -96,8 +96,8 @@ _hash_metapinit(Relation rel)
for
(
i
=
metap
->
hashm_bshift
;
i
>
0
;
--
i
)
{
if
((
1
<<
i
)
<
(
metap
->
hashm_bsize
-
(
DOUBLE
ALIGN
(
sizeof
(
PageHeaderData
))
+
DOUBLE
ALIGN
(
sizeof
(
HashPageOpaqueData
)))))
(
MAX
ALIGN
(
sizeof
(
PageHeaderData
))
+
MAX
ALIGN
(
sizeof
(
HashPageOpaqueData
)))))
break
;
}
Assert
(
i
);
...
...
@@ -605,7 +605,7 @@ _hash_splitpage(Relation rel,
itemsz
=
IndexTupleDSize
(
hitem
->
hash_itup
)
+
(
sizeof
(
HashItemData
)
-
sizeof
(
IndexTupleData
));
itemsz
=
DOUBLE
ALIGN
(
itemsz
);
itemsz
=
MAX
ALIGN
(
itemsz
);
if
(
PageGetFreeSpace
(
npage
)
<
itemsz
)
{
...
...
src/backend/access/hash/hashutil.c
View file @
faf7d781
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.2
1 1999/07/17 20:16:39
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.2
2 1999/07/19 07:07:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -127,9 +127,9 @@ _hash_checkpage(Page page, int flags)
Assert
(((
PageHeader
)
(
page
))
->
pd_lower
>=
(
sizeof
(
PageHeaderData
)
-
sizeof
(
ItemIdData
)));
#if 1
Assert
(((
PageHeader
)
(
page
))
->
pd_upper
<=
(
BLCKSZ
-
DOUBLE
ALIGN
(
sizeof
(
HashPageOpaqueData
))));
(
BLCKSZ
-
MAX
ALIGN
(
sizeof
(
HashPageOpaqueData
))));
Assert
(((
PageHeader
)
(
page
))
->
pd_special
==
(
BLCKSZ
-
DOUBLE
ALIGN
(
sizeof
(
HashPageOpaqueData
))));
(
BLCKSZ
-
MAX
ALIGN
(
sizeof
(
HashPageOpaqueData
))));
Assert
(((
PageHeader
)
(
page
))
->
pd_opaque
.
od_pagesize
==
BLCKSZ
);
#endif
if
(
flags
)
...
...
src/backend/access/heap/heapam.c
View file @
faf7d781
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.5
2 1999/07/17 20:16:39
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.5
3 1999/07/19 07:07:18
momjian Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -1280,7 +1280,7 @@ l2:
HEAP_XMAX_INVALID
|
HEAP_MARKED_FOR_UPDATE
);
/* insert new item */
if
((
unsigned
)
DOUBLE
ALIGN
(
newtup
->
t_len
)
<=
PageGetFreeSpace
((
Page
)
dp
))
if
((
unsigned
)
MAX
ALIGN
(
newtup
->
t_len
)
<=
PageGetFreeSpace
((
Page
)
dp
))
RelationPutHeapTuple
(
relation
,
buffer
,
newtup
);
else
{
...
...
src/backend/access/heap/hio.c
View file @
faf7d781
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Id: hio.c,v 1.2
5 1999/07/16 04:58:27
momjian Exp $
* $Id: hio.c,v 1.2
6 1999/07/19 07:07:18
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -50,7 +50,7 @@ RelationPutHeapTuple(Relation relation,
IncrHeapAccessStat
(
global_RelationPutHeapTuple
);
pageHeader
=
(
Page
)
BufferGetPage
(
buffer
);
len
=
(
unsigned
)
DOUBLE
ALIGN
(
tuple
->
t_len
);
/* be conservative */
len
=
(
unsigned
)
MAX
ALIGN
(
tuple
->
t_len
);
/* be conservative */
Assert
((
int
)
len
<=
PageGetFreeSpace
(
pageHeader
));
offnum
=
PageAddItem
((
Page
)
pageHeader
,
(
Item
)
tuple
->
t_data
,
...
...
@@ -143,7 +143,7 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
LockBuffer
(
buffer
,
BUFFER_LOCK_EXCLUSIVE
);
pageHeader
=
(
Page
)
BufferGetPage
(
buffer
);
len
=
(
unsigned
)
DOUBLE
ALIGN
(
tuple
->
t_len
);
/* be conservative */
len
=
(
unsigned
)
MAX
ALIGN
(
tuple
->
t_len
);
/* be conservative */
/*
* Note that this is true if the above returned a bogus page, which it
...
...
src/backend/access/nbtree/nbtinsert.c
View file @
faf7d781
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.4
8 1999/07/17 20:16:42
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.4
9 1999/07/19 07:07:19
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -263,7 +263,7 @@ _bt_insertonpg(Relation rel,
itemsz
=
IndexTupleDSize
(
btitem
->
bti_itup
)
+
(
sizeof
(
BTItemData
)
-
sizeof
(
IndexTupleData
));
itemsz
=
DOUBLE
ALIGN
(
itemsz
);
/* be safe, PageAddItem will do
itemsz
=
MAX
ALIGN
(
itemsz
);
/* be safe, PageAddItem will do
* this but we need to be
* consistent */
...
...
@@ -369,7 +369,7 @@ _bt_insertonpg(Relation rel,
if
(
currsize
>
maxsize
)
maxsize
=
currsize
;
maxsize
+=
sizeof
(
PageHeaderData
)
+
DOUBLE
ALIGN
(
sizeof
(
BTPageOpaqueData
));
MAX
ALIGN
(
sizeof
(
BTPageOpaqueData
));
if
(
maxsize
>=
PageGetPageSize
(
page
)
/
2
)
do_split
=
true
;
}
...
...
@@ -460,7 +460,7 @@ _bt_insertonpg(Relation rel,
maxoff
=
PageGetMaxOffsetNumber
(
page
);
llimit
=
PageGetPageSize
(
page
)
-
sizeof
(
PageHeaderData
)
-
DOUBLE
ALIGN
(
sizeof
(
BTPageOpaqueData
))
MAX
ALIGN
(
sizeof
(
BTPageOpaqueData
))
+
sizeof
(
ItemIdData
);
llimit
/=
2
;
firstright
=
_bt_findsplitloc
(
rel
,
page
,
start
,
maxoff
,
llimit
);
...
...
@@ -689,8 +689,8 @@ l_spl: ;
* then we must forse insertion.
*/
if
(
!
parent_chained
&&
DOUBLE
ALIGN
(
IndexTupleDSize
(
lowLeftItem
->
bti_itup
))
==
DOUBLE
ALIGN
(
IndexTupleDSize
(
stack
->
bts_btitem
->
bti_itup
)))
MAX
ALIGN
(
IndexTupleDSize
(
lowLeftItem
->
bti_itup
))
==
MAX
ALIGN
(
IndexTupleDSize
(
stack
->
bts_btitem
->
bti_itup
)))
{
_bt_updateitem
(
rel
,
keysz
,
pbuf
,
stack
->
bts_btitem
,
lowLeftItem
);
...
...
@@ -1591,7 +1591,7 @@ _bt_shift(Relation rel, Buffer buf, BTStack stack, int keysz,
/* add passed hikey */
itemsz
=
IndexTupleDSize
(
hikey
->
bti_itup
)
+
(
sizeof
(
BTItemData
)
-
sizeof
(
IndexTupleData
));
itemsz
=
DOUBLE
ALIGN
(
itemsz
);
itemsz
=
MAX
ALIGN
(
itemsz
);
if
(
PageAddItem
(
page
,
(
Item
)
hikey
,
itemsz
,
P_HIKEY
,
LP_USED
)
==
InvalidOffsetNumber
)
elog
(
FATAL
,
"btree: failed to add hikey in _bt_shift"
);
pfree
(
hikey
);
...
...
@@ -1599,7 +1599,7 @@ _bt_shift(Relation rel, Buffer buf, BTStack stack, int keysz,
/* add btitem */
itemsz
=
IndexTupleDSize
(
btitem
->
bti_itup
)
+
(
sizeof
(
BTItemData
)
-
sizeof
(
IndexTupleData
));
itemsz
=
DOUBLE
ALIGN
(
itemsz
);
itemsz
=
MAX
ALIGN
(
itemsz
);
if
(
PageAddItem
(
page
,
(
Item
)
btitem
,
itemsz
,
P_FIRSTKEY
,
LP_USED
)
==
InvalidOffsetNumber
)
elog
(
FATAL
,
"btree: failed to add firstkey in _bt_shift"
);
pfree
(
btitem
);
...
...
src/backend/access/nbtree/nbtsort.c
View file @
faf7d781
...
...
@@ -5,7 +5,7 @@
*
*
* IDENTIFICATION
* $Id: nbtsort.c,v 1.4
5 1999/07/17 20:16:43
momjian Exp $
* $Id: nbtsort.c,v 1.4
6 1999/07/19 07:07:19
momjian Exp $
*
* NOTES
*
...
...
@@ -86,7 +86,7 @@ extern int NDirectFileWrite;
* are potentially reading a bunch of zeroes off of disk in many
* cases.
*
* BTItems are packed in and
DOUBLE
ALIGN'd.
* BTItems are packed in and
MAX
ALIGN'd.
*
* the fd should not be going out to disk, strictly speaking, but it's
* the only thing like that so i'm not going to worry about wasting a
...
...
@@ -497,7 +497,7 @@ _bt_tapenext(BTTapeBlock *tape, char **pos)
return
(
BTItem
)
NULL
;
bti
=
(
BTItem
)
*
pos
;
itemsz
=
BTITEMSZ
(
bti
);
*
pos
+=
DOUBLE
ALIGN
(
itemsz
);
*
pos
+=
MAX
ALIGN
(
itemsz
);
return
bti
;
}
...
...
@@ -517,7 +517,7 @@ _bt_tapeadd(BTTapeBlock *tape, BTItem item, int itemsz)
{
memcpy
(
tape
->
bttb_data
+
tape
->
bttb_top
,
item
,
itemsz
);
++
tape
->
bttb_ntup
;
tape
->
bttb_top
+=
DOUBLE
ALIGN
(
itemsz
);
tape
->
bttb_top
+=
MAX
ALIGN
(
itemsz
);
}
/*-------------------------------------------------------------------------
...
...
@@ -653,7 +653,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
itape
=
btspool
->
bts_itape
[
btspool
->
bts_tape
];
itemsz
=
BTITEMSZ
(
btitem
);
itemsz
=
DOUBLE
ALIGN
(
itemsz
);
itemsz
=
MAX
ALIGN
(
itemsz
);
/*
* if this buffer is too full for this BTItemData, or if we have run
...
...
@@ -693,7 +693,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
* BTItemDatas in the order dictated by the sorted array of
* BTItems, not the original order.
*
* (since everything was
DOUBLE
ALIGN'd and is all on a single tape
* (since everything was
MAX
ALIGN'd and is all on a single tape
* block, everything had *better* still fit on one tape block..)
*/
otape
=
btspool
->
bts_otape
[
btspool
->
bts_tape
];
...
...
@@ -701,7 +701,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
{
bti
=
parray
[
i
].
btsk_item
;
btisz
=
BTITEMSZ
(
bti
);
btisz
=
DOUBLE
ALIGN
(
btisz
);
btisz
=
MAX
ALIGN
(
btisz
);
_bt_tapeadd
(
otape
,
bti
,
btisz
);
#if defined(FASTBUILD_DEBUG) && defined(FASTBUILD_SPOOL)
{
...
...
@@ -903,7 +903,7 @@ _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags)
pgspc
=
PageGetFreeSpace
(
npage
);
btisz
=
BTITEMSZ
(
bti
);
btisz
=
DOUBLE
ALIGN
(
btisz
);
btisz
=
MAX
ALIGN
(
btisz
);
if
(
pgspc
<
btisz
)
{
Buffer
obuf
=
nbuf
;
...
...
@@ -1221,7 +1221,7 @@ _bt_merge(Relation index, BTSpool *btspool)
if
(
bti
!=
(
BTItem
)
NULL
)
{
btisz
=
BTITEMSZ
(
bti
);
btisz
=
DOUBLE
ALIGN
(
btisz
);
btisz
=
MAX
ALIGN
(
btisz
);
if
(
doleaf
)
{
_bt_buildadd
(
index
,
state
,
bti
,
BTP_LEAF
);
...
...
src/backend/commands/vacuum.c
View file @
faf7d781
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.11
4 1999/07/17 20:16:54
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.11
5 1999/07/19 07:07:20
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1282,9 +1282,9 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
to_item
=
i
;
to_vpd
=
fraged_pages
->
vpl_pagedesc
[
to_item
];
}
to_vpd
->
vpd_free
-=
DOUBLE
ALIGN
(
tlen
);
to_vpd
->
vpd_free
-=
MAX
ALIGN
(
tlen
);
if
(
to_vpd
->
vpd_offsets_used
>=
to_vpd
->
vpd_offsets_free
)
to_vpd
->
vpd_free
-=
DOUBLE
ALIGN
(
sizeof
(
ItemIdData
));
to_vpd
->
vpd_free
-=
MAX
ALIGN
(
sizeof
(
ItemIdData
));
(
to_vpd
->
vpd_offsets_used
)
++
;
if
(
free_vtmove
==
0
)
{
...
...
@@ -2790,7 +2790,7 @@ static bool
vc_enough_space
(
VPageDescr
vpd
,
Size
len
)
{
len
=
DOUBLE
ALIGN
(
len
);
len
=
MAX
ALIGN
(
len
);
if
(
len
>
vpd
->
vpd_free
)
return
false
;
...
...
@@ -2800,7 +2800,7 @@ vc_enough_space(VPageDescr vpd, Size len)
return
true
;
/* and len <= free_space */
/* ok. noff_usd >= noff_free and so we'll have to allocate new itemid */
if
(
len
+
DOUBLE
ALIGN
(
sizeof
(
ItemIdData
))
<=
vpd
->
vpd_free
)
if
(
len
+
MAX
ALIGN
(
sizeof
(
ItemIdData
))
<=
vpd
->
vpd_free
)
return
true
;
return
false
;
...
...
src/backend/rewrite/rewriteDefine.c
View file @
faf7d781
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.3
4 1999/07/17 20:17:36
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.3
5 1999/07/19 07:07:21
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -108,8 +108,9 @@ InsertRule(char *rulname,
(rulename, ev_type, ev_class, ev_attr, ev_action, ev_qual, is_instead) VALUES \
('%s', %d::char, %u::oid, %d::int2, '%s'::text, '%s'::text, \
'%s'::bool);"
;
if
(
sizeof
(
FormData_pg_rewrite
)
+
strlen
(
actionbuf
)
+
strlen
(
qualbuf
)
>
MaxAttrSize
)
if
(
MAXALIGN
(
sizeof
(
FormData_pg_rewrite
))
+
MAXALIGN
(
strlen
(
actionbuf
))
+
MAXALIGN
(
strlen
(
qualbuf
))
>
MaxAttrSize
)
elog
(
ERROR
,
"DefineQueryRewrite: rule plan string too big."
);
sprintf
(
rulebuf
,
template
,
rulname
,
evtype
,
eventrel_oid
,
evslot_index
,
actionbuf
,
...
...
src/backend/storage/large_object/inv_api.c
View file @
faf7d781
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.5
7 1999/07/17 20:17:45
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.5
8 1999/07/19 07:07:23
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -57,8 +57,8 @@
*/
#define IFREESPC(p) (PageGetFreeSpace(p) - \
DOUBLE
ALIGN(offsetof(HeapTupleHeaderData,t_bits)) - \
DOUBLE
ALIGN(sizeof(struct varlena) + sizeof(int32)) - \
MAX
ALIGN(offsetof(HeapTupleHeaderData,t_bits)) - \
MAX
ALIGN(sizeof(struct varlena) + sizeof(int32)) - \
sizeof(double))
#define IMAXBLK 8092
#define IMINBLK 512
...
...
@@ -1005,11 +1005,11 @@ inv_newtuple(LargeObjectDesc *obj_desc,
/* compute tuple size -- no nulls */
hoff
=
offsetof
(
HeapTupleHeaderData
,
t_bits
);
hoff
=
DOUBLE
ALIGN
(
hoff
);
hoff
=
MAX
ALIGN
(
hoff
);
/* add in olastbyte, varlena.vl_len, varlena.vl_dat */
tupsize
=
hoff
+
(
2
*
sizeof
(
int32
))
+
nwrite
;
tupsize
=
DOUBLE
ALIGN
(
tupsize
);
tupsize
=
MAX
ALIGN
(
tupsize
);
/*
* Allocate the tuple on the page, violating the page abstraction.
...
...
src/backend/storage/page/bufpage.c
View file @
faf7d781
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.2
6 1999/07/17 20:17:48
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.2
7 1999/07/19 07:07:24
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -41,7 +41,7 @@ PageInit(Page page, Size pageSize, Size specialSize)
Assert
(
pageSize
>
specialSize
+
sizeof
(
PageHeaderData
)
-
sizeof
(
ItemIdData
));
specialSize
=
DOUBLE
ALIGN
(
specialSize
);
specialSize
=
MAX
ALIGN
(
specialSize
);
p
->
pd_lower
=
sizeof
(
PageHeaderData
)
-
sizeof
(
ItemIdData
);
p
->
pd_upper
=
pageSize
-
specialSize
;
...
...
@@ -149,7 +149,7 @@ PageAddItem(Page page,
else
lower
=
((
PageHeader
)
page
)
->
pd_lower
;
alignedSize
=
DOUBLE
ALIGN
(
size
);
alignedSize
=
MAX
ALIGN
(
size
);
upper
=
((
PageHeader
)
page
)
->
pd_upper
-
alignedSize
;
...
...
@@ -190,12 +190,12 @@ PageGetTempPage(Page page, Size specialSize)
/* clear out the middle */
size
=
(
pageSize
-
sizeof
(
PageHeaderData
))
+
sizeof
(
ItemIdData
);
size
-=
DOUBLE
ALIGN
(
specialSize
);
size
-=
MAX
ALIGN
(
specialSize
);
MemSet
((
char
*
)
&
(
thdr
->
pd_linp
[
0
]),
0
,
size
);
/* set high, low water marks */
thdr
->
pd_lower
=
sizeof
(
PageHeaderData
)
-
sizeof
(
ItemIdData
);
thdr
->
pd_upper
=
pageSize
-
DOUBLE
ALIGN
(
specialSize
);
thdr
->
pd_upper
=
pageSize
-
MAX
ALIGN
(
specialSize
);
return
temp
;
}
...
...
@@ -307,7 +307,7 @@ PageRepairFragmentation(Page page)
for
(
i
=
0
,
itemidptr
=
itemidbase
;
i
<
nused
;
i
++
,
itemidptr
++
)
{
lp
=
((
PageHeader
)
page
)
->
pd_linp
+
itemidptr
->
offsetindex
;
alignedSize
=
DOUBLE
ALIGN
((
*
lp
).
lp_len
);
alignedSize
=
MAX
ALIGN
((
*
lp
).
lp_len
);
upper
=
((
PageHeader
)
page
)
->
pd_upper
-
alignedSize
;
memmove
((
char
*
)
page
+
upper
,
(
char
*
)
page
+
(
*
lp
).
lp_off
,
...
...
@@ -381,7 +381,7 @@ PageIndexTupleDelete(Page page, OffsetNumber offnum)
tup
=
PageGetItemId
(
page
,
offnum
);
size
=
ItemIdGetLength
(
tup
);
size
=
DOUBLE
ALIGN
(
size
);
size
=
MAX
ALIGN
(
size
);
/* location of deleted tuple data */
locn
=
(
char
*
)
(
page
+
ItemIdGetOffset
(
tup
));
...
...
src/backend/utils/adt/arrayfuncs.c
View file @
faf7d781
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.4
7 1999/07/17 20:17:53
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.4
8 1999/07/19 07:07:25
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -472,7 +472,7 @@ _ReadArrayStr(char *arrayStr,
if
(
values
[
i
])
{
if
(
typalign
==
'd'
)
*
nbytes
+=
DOUBLE
ALIGN
(
*
(
int32
*
)
values
[
i
]);
*
nbytes
+=
MAX
ALIGN
(
*
(
int32
*
)
values
[
i
]);
else
*
nbytes
+=
INTALIGN
(
*
(
int32
*
)
values
[
i
]);
}
...
...
src/include/access/hash.h
View file @
faf7d781
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: hash.h,v 1.2
7 1999/07/16 17:07:26
momjian Exp $
* $Id: hash.h,v 1.2
8 1999/07/19 07:07:27
momjian Exp $
*
* NOTES
* modeled after Margo Seltzer's hash implementation for unix.
...
...
@@ -202,7 +202,7 @@ typedef HashItemData *HashItem;
#define BMPGSZ_BYTE(metap) ((metap)->hashm_bmsize)
#define BMPGSZ_BIT(metap) ((metap)->hashm_bmsize << BYTE_TO_BIT)
#define HashPageGetBitmap(pg) \
((uint32 *) (((char *) (pg)) +
DOUBLE
ALIGN(sizeof(PageHeaderData))))
((uint32 *) (((char *) (pg)) +
MAX
ALIGN(sizeof(PageHeaderData))))
/*
* The number of bits in an ovflpage bitmap which
...
...
src/include/access/htup.h
View file @
faf7d781
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: htup.h,v 1.2
4 1999/07/15 23:03:34
momjian Exp $
* $Id: htup.h,v 1.2
5 1999/07/19 07:07:28
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -88,7 +88,7 @@ typedef struct HeapTupleData
typedef
HeapTupleData
*
HeapTuple
;
#define HEAPTUPLESIZE
DOUBLE
ALIGN(sizeof(HeapTupleData))
#define HEAPTUPLESIZE
MAX
ALIGN(sizeof(HeapTupleData))
/* ----------------
...
...
src/include/access/itup.h
View file @
faf7d781
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: itup.h,v 1.2
0 1999/07/16 17:07:27
momjian Exp $
* $Id: itup.h,v 1.2
1 1999/07/19 07:07:28
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -103,7 +103,7 @@ typedef struct PredInfo
) \
: \
( \
(Size)
DOUBLE
ALIGN(sizeof(IndexTupleData) + sizeof(IndexAttributeBitMapData)) \
(Size)
MAX
ALIGN(sizeof(IndexTupleData) + sizeof(IndexAttributeBitMapData)) \
) \
)
...
...
src/include/utils/array.h
View file @
faf7d781
...
...
@@ -10,7 +10,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: array.h,v 1.2
0 1999/07/17 20:18:35
momjian Exp $
* $Id: array.h,v 1.2
1 1999/07/19 07:07:29
momjian Exp $
*
* NOTES
* XXX the data array should be LONGALIGN'd -- notice that the array
...
...
@@ -84,13 +84,13 @@ typedef struct
*/
#define ARR_DATA_PTR(a) \
(((char *) a) + \
DOUBLE
ALIGN(sizeof(ArrayType) + 2 * (sizeof(int) * (a)->ndim)))
MAX
ALIGN(sizeof(ArrayType) + 2 * (sizeof(int) * (a)->ndim)))
/*
* The total array header size for an array of dimension n (in bytes).
*/
#define ARR_OVERHEAD(n) \
(
DOUBLE
ALIGN(sizeof(ArrayType) + 2 * (n) * sizeof(int)))
(
MAX
ALIGN(sizeof(ArrayType) + 2 * (n) * sizeof(int)))
/*------------------------------------------------------------------------
* Miscellaneous helper definitions and routines for arrayfuncs.c
...
...
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