aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-01-14 03:39:36 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-01-14 03:39:36 +0000
commit15ae5d26a009f7c46fe9ca67a0bf8caedd83b58c (patch)
treebb25d91e470d1d72010cf3b5d276e2722804448d
parentc9eb11935360ba64d8c2ef373c9426a3cb810f68 (diff)
downloadpostgresql-15ae5d26a009f7c46fe9ca67a0bf8caedd83b58c.tar.gz
postgresql-15ae5d26a009f7c46fe9ca67a0bf8caedd83b58c.zip
Revert ill-starred change of 13-Feb-02: it appeared to fix a problem of
incorrect permissions checking, but in fact disabled most all permissions checks for view updates. This corrects problems reported by Sergey Yatskevich among others, at the cost of re-introducing the problem previously reported by Tim Burgess. However, since we'd lived with that problem for quite awhile without knowing it, we can live with it awhile longer until a proper fix can be made in 7.5.
-rw-r--r--src/backend/rewrite/rewriteHandler.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c
index f88938656e2..eed72700776 100644
--- a/src/backend/rewrite/rewriteHandler.c
+++ b/src/backend/rewrite/rewriteHandler.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.113.2.1 2003/02/13 21:40:00 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.113.2.2 2004/01/14 03:39:36 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -62,11 +62,9 @@ rewriteRuleAction(Query *parsetree,
{
int current_varno,
new_varno;
- List *main_rtable;
int rt_length;
Query *sub_action;
Query **sub_action_ptr;
- List *rt;
/*
* Make modifiable copies of rule action and qual (what we're passed
@@ -108,24 +106,9 @@ rewriteRuleAction(Query *parsetree,
* NOTE: because planner will destructively alter rtable, we must ensure
* that rule action's rtable is separate and shares no substructure
* with the main rtable. Hence do a deep copy here.
- *
- * Also, we must disable write-access checking in all the RT entries
- * copied from the main query. This is safe since in fact the rule action
- * won't write on them, and it's necessary because the rule action may
- * have a different commandType than the main query, causing
- * ExecCheckRTEPerms() to make an inappropriate check. The read-access
- * checks can be left enabled, although they're probably redundant.
*/
- main_rtable = (List *) copyObject(parsetree->rtable);
-
- foreach(rt, main_rtable)
- {
- RangeTblEntry *rte = (RangeTblEntry *) lfirst(rt);
-
- rte->checkForWrite = false;
- }
-
- sub_action->rtable = nconc(main_rtable, sub_action->rtable);
+ sub_action->rtable = nconc((List *) copyObject(parsetree->rtable),
+ sub_action->rtable);
/*
* Each rule action's jointree should be the main parsetree's jointree