diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-02-26 22:47:12 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-02-26 22:47:12 +0000 |
commit | 56ee2ecba96a742bb6e18dfe8ee48054e90ebaa9 (patch) | |
tree | 905c72dc3db475d47d04472a1de7ab715b5725c7 /src/backend/tcop/dest.c | |
parent | f71dc6d0e28a855f2d782ec48f950ffeaca1307d (diff) |
Restructure command-completion-report code so that there is just one
report for each received SQL command, regardless of rewriting activity.
Also ensure that this report comes from the 'original' command, not the
last command generated by rewrite; this fixes 7.2 breakage for INSERT
commands that have actions added by rules. Fernando Nasser and Tom Lane.
Diffstat (limited to 'src/backend/tcop/dest.c')
-rw-r--r-- | src/backend/tcop/dest.c | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/src/backend/tcop/dest.c b/src/backend/tcop/dest.c index 5ed8896938a..f055bc3137b 100644 --- a/src/backend/tcop/dest.c +++ b/src/backend/tcop/dest.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/dest.c,v 1.46 2001/10/28 06:25:51 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/dest.c,v 1.47 2002/02/26 22:47:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -41,8 +41,6 @@ #include "libpq/pqformat.h" -static char CommandInfo[32] = {0}; - /* ---------------- * dummy DestReceiver functions * ---------------- @@ -102,7 +100,6 @@ BeginCommand(char *pname, * if this is a "retrieve into portal" query, done because * nothing needs to be sent to the fe. */ - CommandInfo[0] = '\0'; if (isIntoPortal) break; @@ -198,30 +195,22 @@ DestToFunction(CommandDest dest) } /* ---------------- - * EndCommand - tell destination that no more tuples will arrive + * EndCommand - tell destination that query is complete * ---------------- */ void -EndCommand(char *commandTag, CommandDest dest) +EndCommand(const char *commandTag, CommandDest dest) { - char buf[64]; - switch (dest) { case Remote: case RemoteInternal: - - /* - * tell the fe that the query is over - */ - sprintf(buf, "%s%s", commandTag, CommandInfo); - pq_puttextmessage('C', buf); - CommandInfo[0] = '\0'; + pq_puttextmessage('C', commandTag); break; - case Debug: case None: - default: + case Debug: + case SPI: break; } } @@ -317,23 +306,3 @@ ReadyForQuery(CommandDest dest) break; } } - -void -UpdateCommandInfo(int operation, Oid lastoid, uint32 tuples) -{ - switch (operation) - { - case CMD_INSERT: - if (tuples > 1) - lastoid = InvalidOid; - sprintf(CommandInfo, " %u %u", lastoid, tuples); - break; - case CMD_DELETE: - case CMD_UPDATE: - sprintf(CommandInfo, " %u", tuples); - break; - default: - CommandInfo[0] = '\0'; - break; - } -} |