File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 12
12
* Portions Copyright (c) 1994, Regents of the University of California
13
13
*
14
14
* IDENTIFICATION
15
- * $PostgreSQL: pgsql/src/backend/utils/cache/spccache.c,v 1.3 2010/01/06 23:00:02 tgl Exp $
15
+ * $PostgreSQL: pgsql/src/backend/utils/cache/spccache.c,v 1.4 2010/01/07 03:53:08 rhaas Exp $
16
16
*
17
17
*-------------------------------------------------------------------------
18
18
*/
@@ -142,7 +142,6 @@ get_tablespace(Oid spcid)
142
142
{
143
143
Datum datum ;
144
144
bool isNull ;
145
- MemoryContext octx ;
146
145
147
146
datum = SysCacheGetAttr (TABLESPACEOID ,
148
147
tp ,
@@ -152,10 +151,9 @@ get_tablespace(Oid spcid)
152
151
opts = NULL ;
153
152
else
154
153
{
155
- /* XXX should NOT do the parsing work in CacheMemoryContext */
156
- octx = MemoryContextSwitchTo (CacheMemoryContext );
157
- opts = (TableSpaceOpts * ) tablespace_reloptions (datum , false);
158
- MemoryContextSwitchTo (octx );
154
+ bytea * bytea_opts = tablespace_reloptions (datum , false);
155
+ opts = MemoryContextAlloc (CacheMemoryContext , VARSIZE (bytea_opts ));
156
+ memcpy (opts , bytea_opts , VARSIZE (bytea_opts ));
159
157
}
160
158
ReleaseSysCache (tp );
161
159
}
Original file line number Diff line number Diff line change 7
7
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
10
- * $PostgreSQL: pgsql/src/include/commands/tablespace.h,v 1.22 2010/01/05 21 :53:59 rhaas Exp $
10
+ * $PostgreSQL: pgsql/src/include/commands/tablespace.h,v 1.23 2010/01/07 03 :53:08 rhaas Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -34,6 +34,7 @@ typedef struct xl_tblspc_drop_rec
34
34
35
35
typedef struct TableSpaceOpts
36
36
{
37
+ int32 vl_len_ ; /* varlena header (do not touch directly!) */
37
38
float8 random_page_cost ;
38
39
float8 seq_page_cost ;
39
40
} TableSpaceOpts ;
You can’t perform that action at this time.
0 commit comments