aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execMain.c39
-rw-r--r--src/backend/executor/execQual.c2
-rw-r--r--src/backend/executor/functions.c4
-rw-r--r--src/backend/executor/nodeLockRows.c3
-rw-r--r--src/backend/executor/nodeModifyTable.c36
-rw-r--r--src/backend/executor/nodeSeqscan.c2
-rw-r--r--src/backend/executor/spi.c8
7 files changed, 50 insertions, 44 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index e1b280a065c..9b0cd8c2070 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -959,12 +959,13 @@ CheckValidResultRel(Relation resultRel, CmdType operation)
RelationGetRelationName(resultRel))));
break;
case RELKIND_VIEW:
+
/*
* Okay only if there's a suitable INSTEAD OF trigger. Messages
* here should match rewriteHandler.c's rewriteTargetView, except
* that we omit errdetail because we haven't got the information
- * handy (and given that we really shouldn't get here anyway,
- * it's not worth great exertion to get).
+ * handy (and given that we really shouldn't get here anyway, it's
+ * not worth great exertion to get).
*/
switch (operation)
{
@@ -1012,8 +1013,8 @@ CheckValidResultRel(Relation resultRel, CmdType operation)
if (fdwroutine->ExecForeignInsert == NULL)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot insert into foreign table \"%s\"",
- RelationGetRelationName(resultRel))));
+ errmsg("cannot insert into foreign table \"%s\"",
+ RelationGetRelationName(resultRel))));
break;
case CMD_UPDATE:
if (fdwroutine->ExecForeignUpdate == NULL)
@@ -1026,8 +1027,8 @@ CheckValidResultRel(Relation resultRel, CmdType operation)
if (fdwroutine->ExecForeignDelete == NULL)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot delete from foreign table \"%s\"",
- RelationGetRelationName(resultRel))));
+ errmsg("cannot delete from foreign table \"%s\"",
+ RelationGetRelationName(resultRel))));
break;
default:
elog(ERROR, "unrecognized CmdType: %d", (int) operation);
@@ -1391,7 +1392,8 @@ ExecEndPlan(PlanState *planstate, EState *estate)
}
/*
- * close any relations selected FOR [KEY] UPDATE/SHARE, again keeping locks
+ * close any relations selected FOR [KEY] UPDATE/SHARE, again keeping
+ * locks
*/
foreach(l, estate->es_rowMarks)
{
@@ -1546,9 +1548,9 @@ ExecRelCheck(ResultRelInfo *resultRelInfo,
qual = resultRelInfo->ri_ConstraintExprs[i];
/*
- * NOTE: SQL specifies that a NULL result from a constraint
- * expression is not to be treated as a failure. Therefore, tell
- * ExecQual to return TRUE for NULL.
+ * NOTE: SQL specifies that a NULL result from a constraint expression
+ * is not to be treated as a failure. Therefore, tell ExecQual to
+ * return TRUE for NULL.
*/
if (!ExecQual(qual, econtext, true))
return check[i].ccname;
@@ -1901,13 +1903,13 @@ EvalPlanQualFetch(EState *estate, Relation relation, int lockmode,
/*
* If tuple was inserted by our own transaction, we have to check
* cmin against es_output_cid: cmin >= current CID means our
- * command cannot see the tuple, so we should ignore it.
- * Otherwise heap_lock_tuple() will throw an error, and so would
- * any later attempt to update or delete the tuple. (We need not
- * check cmax because HeapTupleSatisfiesDirty will consider a
- * tuple deleted by our transaction dead, regardless of cmax.)
- * Wee just checked that priorXmax == xmin, so we can test that
- * variable instead of doing HeapTupleHeaderGetXmin again.
+ * command cannot see the tuple, so we should ignore it. Otherwise
+ * heap_lock_tuple() will throw an error, and so would any later
+ * attempt to update or delete the tuple. (We need not check cmax
+ * because HeapTupleSatisfiesDirty will consider a tuple deleted
+ * by our transaction dead, regardless of cmax.) Wee just checked
+ * that priorXmax == xmin, so we can test that variable instead of
+ * doing HeapTupleHeaderGetXmin again.
*/
if (TransactionIdIsCurrentTransactionId(priorXmax) &&
HeapTupleHeaderGetCmin(tuple.t_data) >= estate->es_output_cid)
@@ -1921,7 +1923,7 @@ EvalPlanQualFetch(EState *estate, Relation relation, int lockmode,
*/
test = heap_lock_tuple(relation, &tuple,
estate->es_output_cid,
- lockmode, false /* wait */,
+ lockmode, false /* wait */ ,
false, &buffer, &hufd);
/* We now have two pins on the buffer, get rid of one */
ReleaseBuffer(buffer);
@@ -1929,6 +1931,7 @@ EvalPlanQualFetch(EState *estate, Relation relation, int lockmode,
switch (test)
{
case HeapTupleSelfUpdated:
+
/*
* The target tuple was already updated or deleted by the
* current command, or by a later command in the current
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index 494208a0320..138818313b7 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -4278,7 +4278,7 @@ ExecEvalCurrentOfExpr(ExprState *exprstate, ExprContext *econtext,
{
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("WHERE CURRENT OF is not supported for this table type")));
+ errmsg("WHERE CURRENT OF is not supported for this table type")));
return 0; /* keep compiler quiet */
}
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c
index dbb4805ae2c..12e1b8ef599 100644
--- a/src/backend/executor/functions.c
+++ b/src/backend/executor/functions.c
@@ -1682,7 +1682,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
rettype,
-1,
get_typcollation(rettype),
- COERCE_IMPLICIT_CAST);
+ COERCE_IMPLICIT_CAST);
/* Relabel is dangerous if sort/group or setop column */
if (tle->ressortgroupref != 0 || parse->setOperations)
*modifyTargetList = true;
@@ -1786,7 +1786,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
atttype,
-1,
get_typcollation(atttype),
- COERCE_IMPLICIT_CAST);
+ COERCE_IMPLICIT_CAST);
/* Relabel is dangerous if sort/group or setop column */
if (tle->ressortgroupref != 0 || parse->setOperations)
*modifyTargetList = true;
diff --git a/src/backend/executor/nodeLockRows.c b/src/backend/executor/nodeLockRows.c
index ae2d26b48b4..5b5c705a96d 100644
--- a/src/backend/executor/nodeLockRows.c
+++ b/src/backend/executor/nodeLockRows.c
@@ -127,7 +127,7 @@ lnext:
break;
default:
elog(ERROR, "unsupported rowmark type");
- lockmode = LockTupleNoKeyExclusive; /* keep compiler quiet */
+ lockmode = LockTupleNoKeyExclusive; /* keep compiler quiet */
break;
}
@@ -139,6 +139,7 @@ lnext:
switch (test)
{
case HeapTupleSelfUpdated:
+
/*
* The target tuple was already updated or deleted by the
* current command, or by a later command in the current
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
index a6f247e1bc3..e934c7b9ab9 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -392,18 +392,19 @@ ldelete:;
result = heap_delete(resultRelationDesc, tupleid,
estate->es_output_cid,
estate->es_crosscheck_snapshot,
- true /* wait for commit */,
+ true /* wait for commit */ ,
&hufd);
switch (result)
{
case HeapTupleSelfUpdated:
+
/*
* The target tuple was already updated or deleted by the
* current command, or by a later command in the current
* transaction. The former case is possible in a join DELETE
- * where multiple tuples join to the same target tuple.
- * This is somewhat questionable, but Postgres has always
- * allowed it: we just ignore additional deletion attempts.
+ * where multiple tuples join to the same target tuple. This
+ * is somewhat questionable, but Postgres has always allowed
+ * it: we just ignore additional deletion attempts.
*
* The latter case arises if the tuple is modified by a
* command in a BEFORE trigger, or perhaps by a command in a
@@ -412,14 +413,14 @@ ldelete:;
* proceed. We don't want to discard the original DELETE
* while keeping the triggered actions based on its deletion;
* and it would be no better to allow the original DELETE
- * while discarding updates that it triggered. The row update
+ * while discarding updates that it triggered. The row update
* carries some information that might be important according
* to business rules; so throwing an error is the only safe
* course.
*
- * If a trigger actually intends this type of interaction,
- * it can re-execute the DELETE and then return NULL to
- * cancel the outer delete.
+ * If a trigger actually intends this type of interaction, it
+ * can re-execute the DELETE and then return NULL to cancel
+ * the outer delete.
*/
if (hufd.cmax != estate->es_output_cid)
ereport(ERROR,
@@ -646,7 +647,7 @@ ExecUpdate(ItemPointer tupleid,
}
else
{
- LockTupleMode lockmode;
+ LockTupleMode lockmode;
/*
* Check the constraints of the tuple
@@ -673,19 +674,20 @@ lreplace:;
result = heap_update(resultRelationDesc, tupleid, tuple,
estate->es_output_cid,
estate->es_crosscheck_snapshot,
- true /* wait for commit */,
+ true /* wait for commit */ ,
&hufd, &lockmode);
switch (result)
{
case HeapTupleSelfUpdated:
+
/*
* The target tuple was already updated or deleted by the
* current command, or by a later command in the current
* transaction. The former case is possible in a join UPDATE
- * where multiple tuples join to the same target tuple.
- * This is pretty questionable, but Postgres has always
- * allowed it: we just execute the first update action and
- * ignore additional update attempts.
+ * where multiple tuples join to the same target tuple. This
+ * is pretty questionable, but Postgres has always allowed it:
+ * we just execute the first update action and ignore
+ * additional update attempts.
*
* The latter case arises if the tuple is modified by a
* command in a BEFORE trigger, or perhaps by a command in a
@@ -697,9 +699,9 @@ lreplace:;
* previous ones. So throwing an error is the only safe
* course.
*
- * If a trigger actually intends this type of interaction,
- * it can re-execute the UPDATE (assuming it can figure out
- * how) and then return NULL to cancel the outer update.
+ * If a trigger actually intends this type of interaction, it
+ * can re-execute the UPDATE (assuming it can figure out how)
+ * and then return NULL to cancel the outer update.
*/
if (hufd.cmax != estate->es_output_cid)
ereport(ERROR,
diff --git a/src/backend/executor/nodeSeqscan.c b/src/backend/executor/nodeSeqscan.c
index c4edec0750b..366e784bb0d 100644
--- a/src/backend/executor/nodeSeqscan.c
+++ b/src/backend/executor/nodeSeqscan.c
@@ -132,7 +132,7 @@ InitScanRelation(SeqScanState *node, EState *estate, int eflags)
* open that relation and acquire appropriate lock on it.
*/
currentRelation = ExecOpenScanRelation(estate,
- ((SeqScan *) node->ps.plan)->scanrelid,
+ ((SeqScan *) node->ps.plan)->scanrelid,
eflags);
/* initialize a heapscan */
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c
index ca0d05d2cc0..2f9a94d01e5 100644
--- a/src/backend/executor/spi.c
+++ b/src/backend/executor/spi.c
@@ -1570,7 +1570,7 @@ SPI_result_code_string(int code)
* CachedPlanSources.
*
* This is exported so that pl/pgsql can use it (this beats letting pl/pgsql
- * look directly into the SPIPlan for itself). It's not documented in
+ * look directly into the SPIPlan for itself). It's not documented in
* spi.sgml because we'd just as soon not have too many places using this.
*/
List *
@@ -1586,7 +1586,7 @@ SPI_plan_get_plan_sources(SPIPlanPtr plan)
* return NULL. Caller is responsible for doing ReleaseCachedPlan().
*
* This is exported so that pl/pgsql can use it (this beats letting pl/pgsql
- * look directly into the SPIPlan for itself). It's not documented in
+ * look directly into the SPIPlan for itself). It's not documented in
* spi.sgml because we'd just as soon not have too many places using this.
*/
CachedPlan *
@@ -1971,7 +1971,7 @@ _SPI_execute_plan(SPIPlanPtr plan, ParamListInfo paramLI,
stmt_list = pg_analyze_and_rewrite_params(parsetree,
src,
plan->parserSetup,
- plan->parserSetupArg);
+ plan->parserSetupArg);
}
else
{
@@ -1990,7 +1990,7 @@ _SPI_execute_plan(SPIPlanPtr plan, ParamListInfo paramLI,
plan->parserSetup,
plan->parserSetupArg,
plan->cursor_options,
- false); /* not fixed result */
+ false); /* not fixed result */
}
/*