Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
28026681
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
28026681
编写于
12月 02, 2002
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Repair core dump when trying to delete an entry from an already-NULL
datconfig or useconfig field. Per report from Dustin Sallings.
上级
dfebfc1b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
46 addition
and
20 deletion
+46
-20
src/backend/commands/dbcommands.c
src/backend/commands/dbcommands.c
+5
-2
src/backend/commands/user.c
src/backend/commands/user.c
+7
-2
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+34
-16
未找到文件。
src/backend/commands/dbcommands.c
浏览文件 @
28026681
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.10
7 2002/11/02 18:41:21
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.10
8 2002/12/02 05:20:47
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -561,7 +561,10 @@ AlterDatabaseSet(AlterDatabaseSetStmt *stmt)
else
a
=
GUCArrayDelete
(
a
,
stmt
->
variable
);
repl_val
[
Anum_pg_database_datconfig
-
1
]
=
PointerGetDatum
(
a
);
if
(
a
)
repl_val
[
Anum_pg_database_datconfig
-
1
]
=
PointerGetDatum
(
a
);
else
repl_null
[
Anum_pg_database_datconfig
-
1
]
=
'n'
;
}
newtuple
=
heap_modifytuple
(
tuple
,
rel
,
repl_val
,
repl_null
,
repl_repl
);
...
...
src/backend/commands/user.c
浏览文件 @
28026681
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.11
3 2002/10/21 19:46:45
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.11
4 2002/12/02 05:20:47
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -915,8 +915,10 @@ AlterUserSet(AlterUserSetStmt *stmt)
repl_repl
[
Anum_pg_shadow_useconfig
-
1
]
=
'r'
;
if
(
strcmp
(
stmt
->
variable
,
"all"
)
==
0
&&
valuestr
==
NULL
)
{
/* RESET ALL */
repl_null
[
Anum_pg_shadow_useconfig
-
1
]
=
'n'
;
}
else
{
Datum
datum
;
...
...
@@ -935,7 +937,10 @@ AlterUserSet(AlterUserSetStmt *stmt)
else
array
=
GUCArrayDelete
(
array
,
stmt
->
variable
);
repl_val
[
Anum_pg_shadow_useconfig
-
1
]
=
PointerGetDatum
(
array
);
if
(
array
)
repl_val
[
Anum_pg_shadow_useconfig
-
1
]
=
PointerGetDatum
(
array
);
else
repl_null
[
Anum_pg_shadow_useconfig
-
1
]
=
'n'
;
}
newtuple
=
heap_modifytuple
(
oldtuple
,
rel
,
repl_val
,
repl_null
,
repl_repl
);
...
...
src/backend/utils/misc/guc.c
浏览文件 @
28026681
...
...
@@ -5,7 +5,7 @@
* command, configuration file, and command line options.
* See src/backend/utils/misc/README for more information.
*
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.10
7 2002/11/21 00:42:19
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.10
8 2002/12/02 05:20:47
tgl Exp $
*
* Copyright 2000 by PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>.
...
...
@@ -2754,7 +2754,7 @@ assign_defaultxactisolevel(const char *newval, bool doit, bool interactive)
/*
* Handle options fetched from pg_database.datconfig or pg_shadow.useconfig.
* The array parameter must be an array of TEXT.
* The array parameter must be an array of TEXT
(it must not be NULL)
.
*/
void
ProcessGUCArray
(
ArrayType
*
array
,
GucSource
source
)
...
...
@@ -2809,7 +2809,10 @@ ProcessGUCArray(ArrayType *array, GucSource source)
}
/*
* Add an entry to an option array. The array parameter may be NULL
* to indicate the current table entry is NULL.
*/
ArrayType
*
GUCArrayAdd
(
ArrayType
*
array
,
const
char
*
name
,
const
char
*
value
)
{
...
...
@@ -2880,7 +2883,11 @@ GUCArrayAdd(ArrayType *array, const char *name, const char *value)
}
/*
* Delete an entry from an option array. The array parameter may be NULL
* to indicate the current table entry is NULL. Also, if the return value
* is NULL then a null should be stored.
*/
ArrayType
*
GUCArrayDelete
(
ArrayType
*
array
,
const
char
*
name
)
{
...
...
@@ -2889,16 +2896,17 @@ GUCArrayDelete(ArrayType *array, const char *name)
int
index
;
Assert
(
name
);
Assert
(
array
);
/* test if the option is valid */
set_config_option
(
name
,
NULL
,
superuser
()
?
PGC_SUSET
:
PGC_USERSET
,
PGC_S_SESSION
,
false
,
false
);
newarray
=
construct_array
(
NULL
,
0
,
TEXTOID
,
-
1
,
false
,
'i'
);
/* if array is currently null, then surely nothing to delete */
if
(
!
array
)
return
NULL
;
newarray
=
NULL
;
index
=
1
;
for
(
i
=
1
;
i
<=
ARR_DIMS
(
array
)[
0
];
i
++
)
...
...
@@ -2917,18 +2925,28 @@ GUCArrayDelete(ArrayType *array, const char *name)
continue
;
val
=
DatumGetCString
(
DirectFunctionCall1
(
textout
,
d
));
/* ignore entry if it's what we want to delete */
if
(
strncmp
(
val
,
name
,
strlen
(
name
))
==
0
&&
val
[
strlen
(
name
)]
==
'='
)
continue
;
isnull
=
false
;
newarray
=
array_set
(
newarray
,
1
,
&
index
,
d
,
-
1
/* varlenarray */
,
-
1
/* TEXT's typlen */
,
false
/* TEXT's typbyval */
,
'i'
/* TEXT's typalign */
,
&
isnull
);
/* else add it to the output array */
if
(
newarray
)
{
isnull
=
false
;
newarray
=
array_set
(
newarray
,
1
,
&
index
,
d
,
-
1
/* varlenarray */
,
-
1
/* TEXT's typlen */
,
false
/* TEXT's typbyval */
,
'i'
/* TEXT's typalign */
,
&
isnull
);
}
else
newarray
=
construct_array
(
&
d
,
1
,
TEXTOID
,
-
1
,
false
,
'i'
);
index
++
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录