aboutsummaryrefslogtreecommitdiff
path: root/src/backend/rewrite
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2005-11-22 18:23:31 +0000
committerBruce Momjian <bruce@momjian.us>2005-11-22 18:23:31 +0000
commitbef7764835725e5d8468da1c139e9020be689b95 (patch)
tree71075b16ab6ed5152b31757e5dd65cd2b9383ba0 /src/backend/rewrite
parentc8de36352fe72ae2265eb53a6e1bf334e4f24888 (diff)
downloadpostgresql-bef7764835725e5d8468da1c139e9020be689b95.tar.gz
postgresql-bef7764835725e5d8468da1c139e9020be689b95.zip
Re-run pgindent, fixing a problem where comment lines after a blank
comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
Diffstat (limited to 'src/backend/rewrite')
-rw-r--r--src/backend/rewrite/rewriteDefine.c7
-rw-r--r--src/backend/rewrite/rewriteHandler.c55
-rw-r--r--src/backend/rewrite/rewriteManip.c12
3 files changed, 38 insertions, 36 deletions
diff --git a/src/backend/rewrite/rewriteDefine.c b/src/backend/rewrite/rewriteDefine.c
index 483afd395f1..55c6cc5345c 100644
--- a/src/backend/rewrite/rewriteDefine.c
+++ b/src/backend/rewrite/rewriteDefine.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.107 2005/10/18 01:06:24 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.107.2.1 2005/11/22 18:23:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -462,8 +462,9 @@ DefineQueryRewrite(RuleStmt *stmt)
* appropriate, also modify the 'relkind' field to show that the
* relation is now a view.
*
- * Important side effect: an SI notice is broadcast to force all backends
- * (including me!) to update relcache entries with the new rule.
+ * Important side effect: an SI notice is broadcast to force all
+ * backends (including me!) to update relcache entries with the new
+ * rule.
*/
SetRelationRuleStatus(ev_relid, true, RelisBecomingView);
}
diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c
index 3513cf67c4b..c10d4c923c4 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
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteHandler.c,v 1.158 2005/10/15 02:49:24 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteHandler.c,v 1.158.2.1 2005/11/22 18:23:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -121,11 +121,12 @@ AcquireRewriteLocks(Query *parsetree)
* release it until end of transaction. This protects the
* rewriter and planner against schema changes mid-query.
*
- * If the relation is the query's result relation, then we need
- * RowExclusiveLock. Otherwise, check to see if the relation
- * is accessed FOR UPDATE/SHARE or not. We can't just grab
- * AccessShareLock because then the executor would be trying
- * to upgrade the lock, leading to possible deadlocks.
+ * If the relation is the query's result relation, then we
+ * need RowExclusiveLock. Otherwise, check to see if the
+ * relation is accessed FOR UPDATE/SHARE or not. We can't
+ * just grab AccessShareLock because then the executor would
+ * be trying to upgrade the lock, leading to possible
+ * deadlocks.
*/
if (rt_index == parsetree->resultRelation)
lockmode = RowExclusiveLock;
@@ -288,8 +289,8 @@ rewriteRuleAction(Query *parsetree,
* Adjust rule action and qual to offset its varnos, so that we can merge
* its rtable with the main parsetree's rtable.
*
- * If the rule action is an INSERT...SELECT, the OLD/NEW rtable entries will
- * be in the SELECT part, and we have to modify that rather than the
+ * If the rule action is an INSERT...SELECT, the OLD/NEW rtable entries
+ * will be in the SELECT part, and we have to modify that rather than the
* top-level INSERT (kluge!).
*/
sub_action = getInsertSelectQuery(rule_action, &sub_action_ptr);
@@ -308,12 +309,12 @@ rewriteRuleAction(Query *parsetree,
* action. Some of the entries may be unused after we finish rewriting,
* but we leave them all in place for two reasons:
*
- * We'd have a much harder job to adjust the query's varnos if we selectively
- * removed RT entries.
+ * We'd have a much harder job to adjust the query's varnos if we
+ * selectively removed RT entries.
*
- * If the rule is INSTEAD, then the original query won't be executed at all,
- * and so its rtable must be preserved so that the executor will do the
- * correct permissions checks on it.
+ * If the rule is INSTEAD, then the original query won't be executed at
+ * all, and so its rtable must be preserved so that the executor will do
+ * the correct permissions checks on it.
*
* RT entries that are not referenced in the completed jointree will be
* ignored by the planner, so they do not affect query semantics. But any
@@ -322,13 +323,13 @@ rewriteRuleAction(Query *parsetree,
* caller has, say, insert-permission on a view, when the view is not
* semantically referenced at all in the resulting query.
*
- * When a rule is not INSTEAD, the permissions checks done on its copied RT
- * entries will be redundant with those done during execution of the
+ * When a rule is not INSTEAD, the permissions checks done on its copied
+ * RT entries will be redundant with those done during execution of the
* original query, but we don't bother to treat that case differently.
*
- * 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.
+ * 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.
*/
sub_action->rtable = list_concat((List *) copyObject(parsetree->rtable),
sub_action->rtable);
@@ -344,8 +345,8 @@ rewriteRuleAction(Query *parsetree,
* don't want the original rtindex to be joined twice, however, so avoid
* keeping it if the rule action mentions it.
*
- * As above, the action's jointree must not share substructure with the main
- * parsetree's.
+ * As above, the action's jointree must not share substructure with the
+ * main parsetree's.
*/
if (sub_action->commandType != CMD_UTILITY)
{
@@ -389,9 +390,9 @@ rewriteRuleAction(Query *parsetree,
* Rewrite new.attribute w/ right hand side of target-list entry for
* appropriate field name in insert/update.
*
- * KLUGE ALERT: since ResolveNew returns a mutated copy, we can't just apply
- * it to sub_action; we have to remember to update the sublink inside
- * rule_action, too.
+ * KLUGE ALERT: since ResolveNew returns a mutated copy, we can't just
+ * apply it to sub_action; we have to remember to update the sublink
+ * inside rule_action, too.
*/
if ((event == CMD_INSERT || event == CMD_UPDATE) &&
sub_action->commandType != CMD_UTILITY)
@@ -532,8 +533,8 @@ rewriteTargetList(Query *parsetree, Relation target_relation)
* Copy all resjunk tlist entries to junk_tlist, and assign them
* resnos above the last real resno.
*
- * Typical junk entries include ORDER BY or GROUP BY expressions (are
- * these actually possible in an INSERT or UPDATE?), system
+ * Typical junk entries include ORDER BY or GROUP BY expressions
+ * (are these actually possible in an INSERT or UPDATE?), system
* attribute references, etc.
*/
@@ -1561,8 +1562,8 @@ QueryRewrite(Query *parsetree)
/*
* Step 3
*
- * Determine which, if any, of the resulting queries is supposed to set the
- * command-result tag; and update the canSetTag fields accordingly.
+ * Determine which, if any, of the resulting queries is supposed to set
+ * the command-result tag; and update the canSetTag fields accordingly.
*
* If the original query is still in the list, it sets the command tag.
* Otherwise, the last INSTEAD query of the same kind as the original is
diff --git a/src/backend/rewrite/rewriteManip.c b/src/backend/rewrite/rewriteManip.c
index 9e6bc4808e7..9d1d1d3acbe 100644
--- a/src/backend/rewrite/rewriteManip.c
+++ b/src/backend/rewrite/rewriteManip.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteManip.c,v 1.92 2005/10/15 02:49:24 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteManip.c,v 1.92.2.1 2005/11/22 18:23:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -715,11 +715,11 @@ AddQual(Query *parsetree, Node *qual)
/*
* There's noplace to put the qual on a utility statement.
*
- * If it's a NOTIFY, silently ignore the qual; this means that the NOTIFY
- * will execute, whether or not there are any qualifying rows. While
- * clearly wrong, this is much more useful than refusing to execute
- * the rule at all, and extra NOTIFY events are harmless for typical
- * uses of NOTIFY.
+ * If it's a NOTIFY, silently ignore the qual; this means that the
+ * NOTIFY will execute, whether or not there are any qualifying rows.
+ * While clearly wrong, this is much more useful than refusing to
+ * execute the rule at all, and extra NOTIFY events are harmless for
+ * typical uses of NOTIFY.
*
* If it isn't a NOTIFY, error out, since unconditional execution of
* other utility stmts is unlikely to be wanted. (This case is not