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) {
|
||||
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] = ' ';
|
||||
} else {
|
||||
modvalues[i] = InputFunctionCall(&proc->result.out.r.atts[atti].typfunc,
|
||||
NULL,
|
||||
proc->result.out.r.atts[atti].typioparam,
|
||||
tupdesc->attrs[atti]->atttypmod);
|
||||
tupdesc->attrs[atti].atttypmod);
|
||||
modnulls[i] = 'n';
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "executor/spi.h"
|
||||
#include "executor/executor.h"
|
||||
#include "miscadmin.h"
|
||||
#include "auditfuncs.h"
|
||||
#include "pgaudit.h"
|
||||
#include "utils/guc.h"
|
||||
#include "utils/memutils.h"
|
||||
|
@ -29,7 +30,6 @@
|
|||
#include "plpy_plpymodule.h"
|
||||
#include "plpy_procedure.h"
|
||||
|
||||
const int PGAUDIT_MAXLENGTH = 1024;
|
||||
|
||||
/* exported functions */
|
||||
#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);
|
||||
/* Disallow pseudotype result, except for void or record */
|
||||
if (rvTypeStruct->typtype == TYPTYPE_PSEUDO) {
|
||||
if (procStruct->prorettype == TRIGGEROID || rettype == EVTTRIGGEROID) {
|
||||
if (procStruct->prorettype == TRIGGEROID || procStruct->prorettype == EVTTRIGGEROID) {
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("trigger functions can only be called as triggers")));
|
||||
|
|
|
@ -6244,7 +6244,7 @@ ProcessUtilitySlow(Node *parse_tree,
|
|||
break;
|
||||
|
||||
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.")));
|
||||
address = CreateProceduralLanguage((CreatePLangStmt*)parse_tree);
|
||||
#ifdef PGXC
|
||||
|
|
Loading…
Reference in New Issue