Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
7d5edf2b
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,发现更多精彩内容 >>
提交
7d5edf2b
编写于
3月 06, 2002
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add new elog() levels to stored procedure languages. plperl DEBUG hack
still needed because only removed in 7.4.
上级
9956c566
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
111 addition
and
35 deletion
+111
-35
src/pl/plperl/SPI.xs
src/pl/plperl/SPI.xs
+13
-5
src/pl/plperl/eloglvl.c
src/pl/plperl/eloglvl.c
+21
-2
src/pl/plperl/eloglvl.h
src/pl/plperl/eloglvl.h
+10
-5
src/pl/plperl/plperl.c
src/pl/plperl/plperl.c
+2
-2
src/pl/plpgsql/src/gram.y
src/pl/plpgsql/src/gram.y
+16
-1
src/pl/plpgsql/src/scan.l
src/pl/plpgsql/src/scan.l
+4
-1
src/pl/plpython/error.expected
src/pl/plpython/error.expected
+3
-3
src/pl/plpython/feature.expected
src/pl/plpython/feature.expected
+1
-1
src/pl/plpython/plpython.c
src/pl/plpython/plpython.c
+35
-11
src/pl/tcl/pltcl.c
src/pl/tcl/pltcl.c
+6
-4
未找到文件。
src/pl/plperl/SPI.xs
浏览文件 @
7d5edf2b
...
...
@@ -55,17 +55,25 @@ elog_elog(level, message)
int level
char* message
CODE:
if (level > 0)
return;
else
elog(level, message);
elog(level, message);
int
elog_DEBUG()
int
elog_ERROR()
elog_LOG()
int
elog_INFO()
int
elog_NOTICE()
int
elog_WARNING()
int
elog_ERROR()
src/pl/plperl/eloglvl.c
浏览文件 @
7d5edf2b
...
...
@@ -12,14 +12,20 @@
int
elog_DEBUG
(
void
)
{
return
DEBUG1
;
}
int
elog_LOG
(
void
)
{
return
LOG
;
}
int
elog_
ERROR
(
void
)
elog_
INFO
(
void
)
{
return
ERROR
;
return
INFO
;
}
int
...
...
@@ -27,3 +33,16 @@ elog_NOTICE(void)
{
return
NOTICE
;
}
int
elog_WARNING
(
void
)
{
return
WARNING
;
}
int
elog_ERROR
(
void
)
{
return
ERROR
;
}
src/pl/plperl/eloglvl.h
浏览文件 @
7d5edf2b
int
elog_DEBUG
(
void
);
int
elog_DEBUG
(
void
);
int
elog_ERROR
(
void
);
int
elog_LOG
(
void
);
int
elog_INFO
(
void
);
int
elog_NOTICE
(
void
);
int
elog_WARNING
(
void
);
int
elog_ERROR
(
void
);
int
elog_NOTICE
(
void
);
src/pl/plperl/plperl.c
浏览文件 @
7d5edf2b
...
...
@@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.2
8 2002/01/24 21:40:44 tgl
Exp $
* $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.2
9 2002/03/06 18:50:26 momjian
Exp $
*
**********************************************************************/
...
...
@@ -210,7 +210,7 @@ plperl_init_interp(void)
*/
"require Safe; SPI::bootstrap();"
"sub ::mksafefunc { my $x = new Safe; $x->permit_only(':default');$x->permit(':base_math');"
"$x->share(qw[&elog &DEBUG &
NOTICE
&ERROR]);"
"$x->share(qw[&elog &DEBUG &
LOG &INFO &NOTICE &WARNING
&ERROR]);"
" return $x->reval(qq[sub { $_[0] }]); }"
"sub ::mkunsafefunc {return eval(qq[ sub { $_[0] } ]); }"
};
...
...
src/pl/plpgsql/src/gram.y
浏览文件 @
7d5edf2b
...
...
@@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.3
0 2002/03/02 21:39:35
momjian Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.3
1 2002/03/06 18:50:29
momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
@@ -161,8 +161,10 @@ static PLpgSQL_expr *make_tupret_expr(PLpgSQL_row *row);
%token K_GET
%token K_IF
%token K_IN
%token K_INFO
%token K_INTO
%token K_IS
%token K_LOG
%token K_LOOP
%token K_NOT
%token K_NOTICE
...
...
@@ -180,6 +182,7 @@ static PLpgSQL_expr *make_tupret_expr(PLpgSQL_row *row);
%token K_THEN
%token K_TO
%token K_TYPE
%token K_WARNING
%token K_WHEN
%token K_WHILE
...
...
@@ -1201,10 +1204,22 @@ raise_level : K_EXCEPTION
{
$$ = ERROR;
}
| K_WARNING
{
$$ = WARNING;
}
| K_NOTICE
{
$$ = NOTICE;
}
| K_INFO
{
$$ = INFO;
}
| K_LOG
{
$$ = LOG;
}
| K_DEBUG
{
$$ = DEBUG5;
...
...
src/pl/plpgsql/src/scan.l
浏览文件 @
7d5edf2b
...
...
@@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.1
6 2001/10/09 15:59:56 tgl
Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.1
7 2002/03/06 18:50:29 momjian
Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
@@ -117,8 +117,10 @@ from { return K_FROM; }
get { return K_GET; }
if { return K_IF; }
in { return K_IN; }
info { return K_INFO; }
into { return K_INTO; }
is { return K_IS; }
log { return K_LOG; }
loop { return K_LOOP; }
not { return K_NOT; }
notice { return K_NOTICE; }
...
...
@@ -136,6 +138,7 @@ select { return K_SELECT; }
then { return K_THEN; }
to { return K_TO; }
type { return K_TYPE; }
warning { return K_WARNING; }
when { return K_WHEN; }
while { return K_WHILE; }
...
...
src/pl/plpython/error.expected
浏览文件 @
7d5edf2b
SELECT invalid_type_uncaught('rick');
NOTICE
: plpython: in function __plpython_procedure_invalid_type_uncaught_49801:
WARNING
: plpython: in function __plpython_procedure_invalid_type_uncaught_49801:
plpy.SPIError: Cache lookup for type `test' failed.
SELECT invalid_type_caught('rick');
NOTICE
: plpython: in function __plpython_procedure_invalid_type_caught_49802:
WARNING
: plpython: in function __plpython_procedure_invalid_type_caught_49802:
plpy.SPIError: Cache lookup for type `test' failed.
SELECT invalid_type_reraised('rick');
NOTICE
: plpython: in function __plpython_procedure_invalid_type_reraised_49803:
WARNING
: plpython: in function __plpython_procedure_invalid_type_reraised_49803:
plpy.SPIError: Cache lookup for type `test' failed.
SELECT valid_type('rick');
valid_type
...
...
src/pl/plpython/feature.expected
浏览文件 @
7d5edf2b
...
...
@@ -29,7 +29,7 @@ SELECT global_test_two();
(1 row)
SELECT import_fail();
NOTICE
: ('import socket failed -- untrusted dynamic module: _socket',)
WARNING
: ('import socket failed -- untrusted dynamic module: _socket',)
import_fail
--------------------
failed as expected
...
...
src/pl/plpython/plpython.c
浏览文件 @
7d5edf2b
...
...
@@ -29,7 +29,7 @@
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.1
5 2002/03/06 06:10:47
momjian Exp $
* $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.1
6 2002/03/06 18:50:32
momjian Exp $
*
*********************************************************************
*/
...
...
@@ -1658,9 +1658,12 @@ PLyDict_FromTuple(PLyTypeInfo * info, HeapTuple tuple, TupleDesc desc)
/* interface to postgresql elog
*/
static
PyObject
*
PLy_debug
(
PyObject
*
,
PyObject
*
);
static
PyObject
*
PLy_log
(
PyObject
*
,
PyObject
*
);
static
PyObject
*
PLy_info
(
PyObject
*
,
PyObject
*
);
static
PyObject
*
PLy_notice
(
PyObject
*
,
PyObject
*
);
static
PyObject
*
PLy_warning
(
PyObject
*
,
PyObject
*
);
static
PyObject
*
PLy_error
(
PyObject
*
,
PyObject
*
);
static
PyObject
*
PLy_fatal
(
PyObject
*
,
PyObject
*
);
static
PyObject
*
PLy_notice
(
PyObject
*
,
PyObject
*
);
/* PLyPlanObject, PLyResultObject and SPI interface
*/
...
...
@@ -1782,9 +1785,12 @@ static PyMethodDef PLy_methods[] = {
* logging methods
*/
{
"debug"
,
PLy_debug
,
METH_VARARGS
,
NULL
},
{
"log"
,
PLy_log
,
METH_VARARGS
,
NULL
},
{
"info"
,
PLy_info
,
METH_VARARGS
,
NULL
},
{
"notice"
,
PLy_notice
,
METH_VARARGS
,
NULL
},
{
"warning"
,
PLy_warning
,
METH_VARARGS
,
NULL
},
{
"error"
,
PLy_error
,
METH_VARARGS
,
NULL
},
{
"fatal"
,
PLy_fatal
,
METH_VARARGS
,
NULL
},
{
"notice"
,
PLy_notice
,
METH_VARARGS
,
NULL
},
/*
* create a stored plan
...
...
@@ -2627,35 +2633,53 @@ populate_methods(PyObject *klass, PyMethodDef *methods)
/* the python interface to the elog function
* don't confuse these with PLy_elog
*/
static
PyObject
*
PLy_
log
(
int
,
PyObject
*
,
PyObject
*
);
static
PyObject
*
PLy_
output
(
int
,
PyObject
*
,
PyObject
*
);
PyObject
*
PLy_debug
(
PyObject
*
self
,
PyObject
*
args
)
{
return
PLy_
log
(
LOG
,
self
,
args
);
return
PLy_
output
(
DEBUG1
,
self
,
args
);
}
PyObject
*
PLy_
error
(
PyObject
*
self
,
PyObject
*
args
)
PLy_
log
(
PyObject
*
self
,
PyObject
*
args
)
{
return
PLy_
log
(
ERROR
,
self
,
args
);
return
PLy_
output
(
LOG
,
self
,
args
);
}
PyObject
*
PLy_
fatal
(
PyObject
*
self
,
PyObject
*
args
)
PLy_
info
(
PyObject
*
self
,
PyObject
*
args
)
{
return
PLy_
log
(
FATAL
,
self
,
args
);
return
PLy_
output
(
INFO
,
self
,
args
);
}
PyObject
*
PLy_notice
(
PyObject
*
self
,
PyObject
*
args
)
{
return
PLy_log
(
NOTICE
,
self
,
args
);
return
PLy_output
(
NOTICE
,
self
,
args
);
}
PyObject
*
PLy_warning
(
PyObject
*
self
,
PyObject
*
args
)
{
return
PLy_output
(
WARNING
,
self
,
args
);
}
PyObject
*
PLy_error
(
PyObject
*
self
,
PyObject
*
args
)
{
return
PLy_output
(
ERROR
,
self
,
args
);
}
PyObject
*
PLy_fatal
(
PyObject
*
self
,
PyObject
*
args
)
{
return
PLy_output
(
FATAL
,
self
,
args
);
}
PyObject
*
PLy_
log
(
volatile
int
level
,
PyObject
*
self
,
PyObject
*
args
)
PLy_
output
(
volatile
int
level
,
PyObject
*
self
,
PyObject
*
args
)
{
DECLARE_EXC
();
PyObject
*
so
;
...
...
src/pl/tcl/pltcl.c
浏览文件 @
7d5edf2b
...
...
@@ -31,7 +31,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.5
1 2002/03/06 06:10:48
momjian Exp $
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.5
2 2002/03/06 18:50:33
momjian Exp $
*
**********************************************************************/
...
...
@@ -1259,7 +1259,11 @@ pltcl_elog(ClientData cdata, Tcl_Interp *interp,
return
TCL_ERROR
;
}
if
(
strcmp
(
argv
[
1
],
"INFO"
)
==
0
)
if
(
strcmp
(
argv
[
1
],
"DEBUG"
)
==
0
)
level
=
DEBUG1
;
else
if
(
strcmp
(
argv
[
1
],
"LOG"
)
==
0
)
level
=
LOG
;
else
if
(
strcmp
(
argv
[
1
],
"INFO"
)
==
0
)
level
=
INFO
;
else
if
(
strcmp
(
argv
[
1
],
"NOTICE"
)
==
0
)
level
=
NOTICE
;
...
...
@@ -1269,8 +1273,6 @@ pltcl_elog(ClientData cdata, Tcl_Interp *interp,
level
=
ERROR
;
else
if
(
strcmp
(
argv
[
1
],
"FATAL"
)
==
0
)
level
=
FATAL
;
else
if
(
strcmp
(
argv
[
1
],
"DEBUG"
)
==
0
)
level
=
DEBUG1
;
else
{
Tcl_AppendResult
(
interp
,
"Unknown elog level '"
,
argv
[
1
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录