Allow debugging of functions in packages. Fixes #1948

This commit is contained in:
Murtuza Zabuawala 2017-07-03 16:30:12 +01:00 committed by Dave Page
parent 070a9c077e
commit 5c7dcaba81
6 changed files with 19 additions and 7 deletions

View File

@ -291,7 +291,8 @@ class EdbFuncView(PGChildNodeView, DataTypeReader):
row['oid'],
pkgid,
row['name'],
icon="icon-" + self.node_type
icon="icon-" + self.node_type,
funcowner=row['funcowner']
),
status=200
)
@ -302,7 +303,8 @@ class EdbFuncView(PGChildNodeView, DataTypeReader):
row['oid'],
pkgid,
row['name'],
icon="icon-" + self.node_type
icon="icon-" + self.node_type,
funcowner=row['funcowner']
))
return make_json_response(

View File

@ -1,5 +1,6 @@
SELECT pg_proc.oid,
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name,
pg_get_userbyid(proowner) AS funcowner
FROM pg_proc, pg_namespace
WHERE format_type(prorettype, NULL) != 'void'
{% if fnid %}

View File

@ -1,5 +1,6 @@
SELECT pg_proc.oid,
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name,
pg_get_userbyid(proowner) AS funcowner
FROM pg_proc, pg_namespace
WHERE format_type(prorettype, NULL) != 'void'
{% if fnid %}

View File

@ -1,5 +1,6 @@
SELECT pg_proc.oid,
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name,
pg_get_userbyid(proowner) AS funcowner
FROM pg_proc, pg_namespace
WHERE format_type(prorettype, NULL) = 'void'
{% if fnid %}

View File

@ -1,5 +1,6 @@
SELECT pg_proc.oid,
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name,
pg_get_userbyid(proowner) AS funcowner
FROM pg_proc, pg_namespace
WHERE format_type(prorettype, NULL) = 'void'
{% if fnid %}

View File

@ -126,8 +126,14 @@ define([
&& !treeInfo.server.user.is_superuser)
return false;
// Fetch object owner
var obj_owner = treeInfo.function && treeInfo.function.funcowner ||
treeInfo.procedure && treeInfo.procedure.funcowner ||
treeInfo.edbfunc && treeInfo.edbfunc.funcowner ||
treeInfo.edbproc && treeInfo.edbproc.funcowner;
// Must be a super user or object owner to create breakpoints of any kind
if (!(treeInfo.server.user.is_superuser || treeInfo.function.funcowner == treeInfo.server.user.name))
if (!(treeInfo.server.user.is_superuser || obj_owner == treeInfo.server.user.name))
return false;
// For trigger node, language will be undefined - we should allow indirect debugging for trigger node