Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite2aef49

Browse files
Jan WieckJan Wieck
Jan Wieck
authored and
Jan Wieck
committed
Added empty TOASTER files and corrected some minor glitches
in regression tests.Jan
1 parent2c29c96 commite2aef49

File tree

11 files changed

+187
-14
lines changed

11 files changed

+187
-14
lines changed

‎src/backend/access/common/tupdesc.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.58 1999/12/20 10:40:38 wieck Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.59 1999/12/21 00:06:39 wieck Exp $
1111
*
1212
* NOTES
1313
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -378,8 +378,12 @@ TupleDescInitEntry(TupleDesc desc,
378378
* relations for automatic move off into "secondary" relation.
379379
* Jan
380380
*/
381-
#ifdefLONG_ATTRIBUTES_NOW_IMPLEMENTED_FOR_ALL_VARLENA_DATA_TYPES
382-
att->attcanlong= (att->attlen==-1) ?'e' :'p';
381+
#ifdefTUPLE_TOASTER_ACTIVE
382+
#ifdefTUPLE_TOASTER_ALL_TYPES
383+
att->attstorage= (att->attlen==-1) ?'e' :'p';
384+
#else
385+
att->attstorage='p';
386+
#endif
383387
#else
384388
att->attstorage='p';
385389
#endif

‎src/backend/access/heap/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for access/heap
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/access/heap/Makefile,v 1.8 1999/12/13 22:32:24 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/access/heap/Makefile,v 1.9 1999/12/21 00:06:40 wieck Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -13,7 +13,7 @@ include ../../../Makefile.global
1313

1414
CFLAGS += -I../..
1515

16-
OBJS = heapam.o hio.o stats.o
16+
OBJS = heapam.o hio.o stats.o tuptoaster.o
1717

1818
all: SUBSYS.o
1919

‎src/backend/access/heap/heapam.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.61 1999/12/16 22:19:36 wieck Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.62 1999/12/21 00:06:40 wieck Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -78,6 +78,7 @@
7878
#include"access/heapam.h"
7979
#include"access/hio.h"
8080
#include"access/valid.h"
81+
#include"access/tuptoaster.h"
8182
#include"catalog/catalog.h"
8283
#include"miscadmin.h"
8384
#include"storage/smgr.h"

‎src/backend/access/heap/tuptoaster.c

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* tuptoaster.c
4+
* Support routines for external and compressed storage of
5+
* variable size attributes.
6+
*
7+
* Copyright (c) 2000, PostgreSQL Development Team
8+
*
9+
*
10+
* IDENTIFICATION
11+
* $Header: /cvsroot/pgsql/src/backend/access/heap/tuptoaster.c,v 1.1 1999/12/21 00:06:40 wieck Exp $
12+
*
13+
*
14+
* INTERFACE ROUTINES
15+
*heap_tuple_toast_attrs -
16+
*Try to make a given tuple fit into one page by compressing
17+
*or moving off attributes
18+
*
19+
*-------------------------------------------------------------------------
20+
*/
21+
22+
#include"postgres.h"
23+
24+
#include"access/heapam.h"
25+
#include"access/tuptoaster.h"
26+
#include"catalog/catalog.h"
27+
#include"utils/rel.h"
28+
29+
30+
#ifdefTUPLE_TOASTER_ACTIVE
31+
32+
void
33+
heap_tuple_toast_attrs (Relationrel,HeapTuplenewtup,HeapTupleoldtup)
34+
{
35+
return;
36+
}
37+
38+
39+
varattrib*
40+
heap_tuple_untoast_attr (varattrib*attr)
41+
{
42+
elog(ERROR,"heap_tuple_untoast_attr() called");
43+
}
44+
45+
46+
#endif/* TUPLE_TOASTER_ACTIVE */

‎src/include/access/htup.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: htup.h,v 1.26 1999/12/16 22:19:58 wieck Exp $
9+
* $Id: htup.h,v 1.27 1999/12/21 00:06:42 wieck Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -125,6 +125,11 @@ typedef HeapTupleData *HeapTuple;
125125
#defineHEAP_HASNULL0x0001/* has null attribute(s) */
126126
#defineHEAP_HASVARLENA0x0002/* has variable length
127127
* attribute(s) */
128+
#defineHEAP_HASEXTERNAL0x0004/* has external stored */
129+
/* attribute(s) */
130+
#defineHEAP_HASCOMPRESSED0x0008/* has compressed stored */
131+
/* attribute(s) */
132+
#defineHEAP_HASEXTENDED0x000C/* the two above combined */
128133
#defineHEAP_XMIN_COMMITTED0x0100/* t_xmin committed */
129134
#defineHEAP_XMIN_INVALID0x0200/* t_xmin invalid/aborted */
130135
#defineHEAP_XMAX_COMMITTED0x0400/* t_xmax committed */
@@ -144,4 +149,13 @@ typedef HeapTupleData *HeapTuple;
144149
#defineHeapTupleAllFixed(tuple) \
145150
(!(((HeapTuple) (tuple))->t_data->t_infomask & HEAP_HASVARLENA))
146151

152+
#defineHeapTupleHasExternal(tuple) \
153+
((((HeapTuple)(tuple))->t_data->t_infomask & HEAP_HASEXTERNAL) != 0)
154+
155+
#defineHeapTupleHasCompressed(tuple) \
156+
((((HeapTuple)(tuple))->t_data->t_infomask & HEAP_HASCOMPRESSED) != 0)
157+
158+
#defineHeapTupleHasExtended(tuple) \
159+
((((HeapTuple)(tuple))->t_data->t_infomask & HEAP_HASEXTENDED) != 0)
160+
147161
#endif/* HTUP_H */

‎src/include/access/tupmacs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: tupmacs.h,v 1.11 1999/07/15 15:20:56 momjian Exp $
9+
* $Id: tupmacs.h,v 1.12 1999/12/21 00:06:42 wieck Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -88,7 +88,7 @@
8888
) \
8989
: \
9090
( \
91-
(cur_offset) +VARSIZE(DatumGetPointer(attval)) \
91+
(cur_offset) +VARATT_SIZE(DatumGetPointer(attval)) \
9292
) \
9393
)
9494

‎src/include/access/tuptoaster.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* tuptoaster.h
4+
* POSTGRES definitions for external and compressed storage
5+
* of variable size attributes.
6+
*
7+
* Copyright (c) 2000, PostgreSQL Development Team
8+
*
9+
* $Id: tuptoaster.h,v 1.1 1999/12/21 00:06:42 wieck Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndefTUPTOASTER_H
14+
#defineTUPTOASTER_H
15+
16+
#ifdefTUPLE_TOASTER_ACTIVE
17+
18+
#include"postgres.h"
19+
#include"access/heapam.h"
20+
#include"access/htup.h"
21+
#include"access/tupmacs.h"
22+
#include"utils/rel.h"
23+
24+
25+
externvoidheap_tuple_toast_attrs(Relationrel,
26+
HeapTuplenewtup,HeapTupleoldtup);
27+
28+
externvarattrib*heap_tuple_untoast_attr(varattrib*attr);
29+
30+
#endif/* TUPLE_TOASTER_ACTIVE */
31+
32+
33+
#endif/* TUPTOASTER_H */

‎src/include/postgres.h

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1995, Regents of the University of California
88
*
9-
* $Id: postgres.h,v 1.30 1999/11/07 23:08:32 momjian Exp $
9+
* $Id: postgres.h,v 1.31 1999/12/21 00:06:41 wieck Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -104,6 +104,79 @@ typedef struct varlena text;
104104
typedefint2int28[8];
105105
typedefOidoid8[8];
106106

107+
108+
/*
109+
* Proposed new layout for variable length attributes
110+
* DO NOT USE YET - Jan
111+
*/
112+
#undef TUPLE_TOASTER_ACTIVE
113+
#undef TUPLE_TOASTER_ALL_TYPES
114+
115+
#ifdefTUPLE_TOASTER_ACTIVE
116+
typedefstructvarattrib
117+
{
118+
int32va_header;/* External/compressed storage */
119+
/* flags and item size */
120+
union
121+
{
122+
struct
123+
{
124+
int32va_rawsize;/* Plain data size */
125+
}va_compressed;/* Compressed stored attribute */
126+
127+
struct
128+
{
129+
int32va_rawsize;/* Plain data size */
130+
Oidva_valueid;/* Unique identifier of value */
131+
Oidva_longrelid;/* RelID where to find chunks */
132+
Oidva_rowid;/* Main tables row Oid */
133+
int16va_attno;/* Main tables attno */
134+
}va_external;/* External stored attribute */
135+
136+
charva_data[1];/* Plain stored attribute */
137+
}va_content;
138+
}varattrib;
139+
140+
#defineVARATT_FLAG_EXTERNAL0x8000
141+
#defineVARATT_FLAG_COMPRESSED0x4000
142+
#defineVARATT_MASK_FLAGS0xc000
143+
#defineVARATT_MASK_SIZE0x3fff
144+
145+
#defineVARATT_SIZEP(_PTR)(((varattrib *)(_PTR))->va_header)
146+
#defineVARATT_SIZE(PTR)(VARATT_SIZEP(PTR) & VARATT_MASK_SIZE)
147+
#defineVARATT_DATA(PTR)(((varattrib *)(PTR))->va_content.va_data)
148+
149+
#defineVARATT_IS_EXTENDED(PTR)\
150+
((VARATT_SIZEP(PTR) & VARATT_MASK_FLAGS) != 0)
151+
#defineVARATT_IS_EXTERNAL(PTR)\
152+
((VARATT_SIZEP(PTR) & VARATT_FLAG_EXTERNAL) != 0)
153+
#defineVARATT_IS_COMPRESSED(PTR)\
154+
((VARATT_SIZEP(PTR) & VARATT_FLAG_COMPRESSED) != 0)
155+
156+
/* ----------
157+
* This is regularly declared in access/tuptoaster.h,
158+
* but we don't want to include that into every source,
159+
* so we (evil evil evil) declare it here once more.
160+
* ----------
161+
*/
162+
externvarattrib*heap_tuple_untoast_attr(varattrib*attr);
163+
164+
#defineVARATT_GETPLAIN(_ARG,_VAR) {\
165+
if (VARATTR_IS_EXTENDED(_ARG))\
166+
(_VAR) = (void *)heap_tuple_untoast_attr(_ARG);\
167+
else\
168+
(_VAR) = (_ARG);\
169+
}
170+
#defineVARATT_FREE(_ARG,VAR) {\
171+
if ((void *)(_VAR) != (void *)(_ARG))\
172+
pfree((void *)(_VAR));\
173+
}
174+
#else/* TUPLE_TOASTER_ACTIVE */
175+
#defineVARATT_SIZE(__PTR) VARSIZE(__PTR)
176+
#defineVARATT_SIZEP(__PTR) VARSIZE(__PTR)
177+
#endif/* TUPLE_TOASTER_ACTIVE */
178+
179+
107180
/* We want NameData to have length NAMEDATALEN and int alignment,
108181
* because that's how the data type 'name' is defined in pg_type.
109182
* Use a union to make sure the compiler agrees.

‎src/test/regress/expected/opr_sanity.out

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ FROM pg_proc as p1
33
WHERE (p1.prolang = 0 OR p1.prorettype = 0 OR
44
p1.pronargs < 0 OR p1.pronargs > 9)
55
AND p1.proname !~ '^pl[^_]+_call_handler$'
6-
AND p1.proname !~ '^RI_FKey_';
6+
AND p1.proname !~ '^RI_FKey_'
7+
AND p1.proname != 'update_pg_pwd';
78
oid|proname
89
---+-------
910
(0 rows)

‎src/test/regress/expected/rules.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ a| b
128128
2|13
129129
(3 rows)
130130

131-
QUERY: delete from rtest_v1 where b = 12;
132-
QUERY: select * from rtest_v1;
133131
** Remember the delete rule on rtest_v1: It says
134132
** DO INSTEAD DELETE FROM rtest_t1 WHERE a = old.a
135133
** So this time both rows with a = 2 must get deleted
134+
QUERY: delete from rtest_v1 where b = 12;
135+
QUERY: select * from rtest_v1;
136136
a| b
137137
-+--
138138
1|11

‎src/test/regress/sql/opr_sanity.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ FROM pg_proc as p1
2828
WHERE (p1.prolang=0ORp1.prorettype=0OR
2929
p1.pronargs<0ORp1.pronargs>9)
3030
ANDp1.proname !~'^pl[^_]+_call_handler$'
31-
ANDp1.proname !~'^RI_FKey_';
31+
ANDp1.proname !~'^RI_FKey_'
32+
ANDp1.proname!='update_pg_pwd';
3233

3334
-- Look for conflicting proc definitions (same names and input datatypes).
3435

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp