mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-05 19:09:58 +08:00
Check SELECT permissions in subqueries.
This commit is contained in:
parent
472d802ced
commit
1a6de0760d
@ -26,7 +26,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.44 1998/02/26 04:31:09 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.45 1998/02/27 08:43:52 vadim Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -54,12 +54,12 @@
|
||||
#include "catalog/heap.h"
|
||||
#include "commands/trigger.h"
|
||||
|
||||
void
|
||||
ExecCheckPerms(CmdType operation, int resultRelation, List *rangeTable,
|
||||
Query *parseTree);
|
||||
|
||||
|
||||
/* decls for local routines only used within this module */
|
||||
static void
|
||||
ExecCheckPerms(CmdType operation, int resultRelation, List *rangeTable,
|
||||
Query *parseTree);
|
||||
static TupleDesc
|
||||
InitPlan(CmdType operation, Query *parseTree,
|
||||
Plan *plan, EState *estate);
|
||||
@ -273,14 +273,7 @@ ExecutorEnd(QueryDesc *queryDesc, EState *estate)
|
||||
BufferRefCountRestore(estate->es_refcount);
|
||||
}
|
||||
|
||||
/* ===============================================================
|
||||
* ===============================================================
|
||||
static routines follow
|
||||
* ===============================================================
|
||||
* ===============================================================
|
||||
*/
|
||||
|
||||
static void
|
||||
void
|
||||
ExecCheckPerms(CmdType operation,
|
||||
int resultRelation,
|
||||
List *rangeTable,
|
||||
@ -376,6 +369,13 @@ ExecCheckPerms(CmdType operation,
|
||||
}
|
||||
}
|
||||
|
||||
/* ===============================================================
|
||||
* ===============================================================
|
||||
static routines follow
|
||||
* ===============================================================
|
||||
* ===============================================================
|
||||
*/
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* InitPlan
|
||||
|
@ -106,11 +106,14 @@ ExecSubPlan(SubPlan *node, List *pvar, ExprContext *econtext)
|
||||
*
|
||||
* ----------------------------------------------------------------
|
||||
*/
|
||||
extern void ExecCheckPerms(CmdType op, int resRel, List *rtable, Query *q);
|
||||
bool
|
||||
ExecInitSubPlan(SubPlan *node, EState *estate, Plan *parent)
|
||||
{
|
||||
EState *sp_estate = CreateExecutorState();
|
||||
|
||||
ExecCheckPerms (CMD_SELECT, 0, node->rtable, (Query*) NULL);
|
||||
|
||||
sp_estate->es_range_table = node->rtable;
|
||||
sp_estate->es_param_list_info = estate->es_param_list_info;
|
||||
sp_estate->es_param_exec_vals = estate->es_param_exec_vals;
|
||||
|
Loading…
Reference in New Issue
Block a user