mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Simplify coding in ProcessQuery
The original is pretty baroque for no apparent reason; arguably, commit
2f9661311b should have done this. Noted while reviewing related code
for bug #18984. This is cosmetic (though I'm surprised that my compiler
generates shorter assembly this way), so no backpatch.
Discussion: https://postgr.es/m/18984-0f4778a6599ac3ae@postgresql.org
This commit is contained in:
@@ -165,27 +165,22 @@ ProcessQuery(PlannedStmt *plan,
|
|||||||
*/
|
*/
|
||||||
if (qc)
|
if (qc)
|
||||||
{
|
{
|
||||||
switch (queryDesc->operation)
|
CommandTag tag;
|
||||||
{
|
|
||||||
case CMD_SELECT:
|
if (queryDesc->operation == CMD_SELECT)
|
||||||
SetQueryCompletion(qc, CMDTAG_SELECT, queryDesc->estate->es_processed);
|
tag = CMDTAG_SELECT;
|
||||||
break;
|
else if (queryDesc->operation == CMD_INSERT)
|
||||||
case CMD_INSERT:
|
tag = CMDTAG_INSERT;
|
||||||
SetQueryCompletion(qc, CMDTAG_INSERT, queryDesc->estate->es_processed);
|
else if (queryDesc->operation == CMD_UPDATE)
|
||||||
break;
|
tag = CMDTAG_UPDATE;
|
||||||
case CMD_UPDATE:
|
else if (queryDesc->operation == CMD_DELETE)
|
||||||
SetQueryCompletion(qc, CMDTAG_UPDATE, queryDesc->estate->es_processed);
|
tag = CMDTAG_DELETE;
|
||||||
break;
|
else if (queryDesc->operation == CMD_MERGE)
|
||||||
case CMD_DELETE:
|
tag = CMDTAG_MERGE;
|
||||||
SetQueryCompletion(qc, CMDTAG_DELETE, queryDesc->estate->es_processed);
|
else
|
||||||
break;
|
tag = CMDTAG_UNKNOWN;
|
||||||
case CMD_MERGE:
|
|
||||||
SetQueryCompletion(qc, CMDTAG_MERGE, queryDesc->estate->es_processed);
|
SetQueryCompletion(qc, tag, queryDesc->estate->es_processed);
|
||||||
break;
|
|
||||||
default:
|
|
||||||
SetQueryCompletion(qc, CMDTAG_UNKNOWN, queryDesc->estate->es_processed);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user