!3030 放开plpython自定义语言支持

Merge pull request !3030 from zhangxubo/master-pl
This commit is contained in:
opengauss-bot 2023-03-07 07:24:27 +00:00 committed by Gitee
commit 946165b8cb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 5 additions and 5 deletions

View File

@ -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';
}

View File

@ -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

View File

@ -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")));

View File

@ -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