forked from openGauss-Ecosystem/openGauss-server
!3030 放开plpython自定义语言支持
Merge pull request !3030 from zhangxubo/master-pl
This commit is contained in:
commit
946165b8cb
|
@ -657,13 +657,13 @@ static HeapTuple PLy_modify_tuple(PLyProcedure* proc, PyObject* pltd, TriggerDat
|
||||||
} else if (plval != Py_None) {
|
} else if (plval != Py_None) {
|
||||||
PLyObToDatum* att = &proc->result.out.r.atts[atti];
|
PLyObToDatum* att = &proc->result.out.r.atts[atti];
|
||||||
|
|
||||||
modvalues[i] = (att->func)(att, tupdesc->attrs[atti]->atttypmod, plval);
|
modvalues[i] = (att->func)(att, tupdesc->attrs[atti].atttypmod, plval);
|
||||||
modnulls[i] = ' ';
|
modnulls[i] = ' ';
|
||||||
} else {
|
} else {
|
||||||
modvalues[i] = InputFunctionCall(&proc->result.out.r.atts[atti].typfunc,
|
modvalues[i] = InputFunctionCall(&proc->result.out.r.atts[atti].typfunc,
|
||||||
NULL,
|
NULL,
|
||||||
proc->result.out.r.atts[atti].typioparam,
|
proc->result.out.r.atts[atti].typioparam,
|
||||||
tupdesc->attrs[atti]->atttypmod);
|
tupdesc->attrs[atti].atttypmod);
|
||||||
modnulls[i] = 'n';
|
modnulls[i] = 'n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "executor/spi.h"
|
#include "executor/spi.h"
|
||||||
#include "executor/executor.h"
|
#include "executor/executor.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
|
#include "auditfuncs.h"
|
||||||
#include "pgaudit.h"
|
#include "pgaudit.h"
|
||||||
#include "utils/guc.h"
|
#include "utils/guc.h"
|
||||||
#include "utils/memutils.h"
|
#include "utils/memutils.h"
|
||||||
|
@ -29,7 +30,6 @@
|
||||||
#include "plpy_plpymodule.h"
|
#include "plpy_plpymodule.h"
|
||||||
#include "plpy_procedure.h"
|
#include "plpy_procedure.h"
|
||||||
|
|
||||||
const int PGAUDIT_MAXLENGTH = 1024;
|
|
||||||
|
|
||||||
/* exported functions */
|
/* exported functions */
|
||||||
#if PY_MAJOR_VERSION >= 3
|
#if PY_MAJOR_VERSION >= 3
|
||||||
|
|
|
@ -191,7 +191,7 @@ static PLyProcedure* PLy_procedure_create(HeapTuple procTup, Oid fn_oid, bool is
|
||||||
rvTypeStruct = (Form_pg_type)GETSTRUCT(rvTypeTup);
|
rvTypeStruct = (Form_pg_type)GETSTRUCT(rvTypeTup);
|
||||||
/* Disallow pseudotype result, except for void or record */
|
/* Disallow pseudotype result, except for void or record */
|
||||||
if (rvTypeStruct->typtype == TYPTYPE_PSEUDO) {
|
if (rvTypeStruct->typtype == TYPTYPE_PSEUDO) {
|
||||||
if (procStruct->prorettype == TRIGGEROID || rettype == EVTTRIGGEROID) {
|
if (procStruct->prorettype == TRIGGEROID || procStruct->prorettype == EVTTRIGGEROID) {
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("trigger functions can only be called as triggers")));
|
errmsg("trigger functions can only be called as triggers")));
|
||||||
|
|
|
@ -6244,7 +6244,7 @@ ProcessUtilitySlow(Node *parse_tree,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_CreatePLangStmt:
|
case T_CreatePLangStmt:
|
||||||
if (!IsInitdb)
|
if (!IsInitdb && strncmp(((CreatePLangStmt*)parse_tree)->plname, "plpython", strlen("plpython")) != 0)
|
||||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("new language is not yet supported.")));
|
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("new language is not yet supported.")));
|
||||||
address = CreateProceduralLanguage((CreatePLangStmt*)parse_tree);
|
address = CreateProceduralLanguage((CreatePLangStmt*)parse_tree);
|
||||||
#ifdef PGXC
|
#ifdef PGXC
|
||||||
|
|
Loading…
Reference in New Issue