Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 914042f

Browse files
committed
This patch makes the EXECUTE command's completion tag return the
completion tag of the actual statement executed. This allows the correct update count to be returned for UPDATE/INSERT/DELETE statements. Kris Jurka
1 parent ec7c4c1 commit 914042f

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/backend/commands/prepare.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Copyright (c) 2002-2003, PostgreSQL Global Development Group
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.25 2004/01/07 18:56:25 neilc Exp $
13+
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.26 2004/04/22 02:58:20 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -106,7 +106,7 @@ PrepareQuery(PrepareStmt *stmt)
106106
* Implements the 'EXECUTE' utility statement.
107107
*/
108108
void
109-
ExecuteQuery(ExecuteStmt *stmt, DestReceiver *dest)
109+
ExecuteQuery(ExecuteStmt *stmt, DestReceiver *dest, char *completionTag)
110110
{
111111
PreparedStatement *entry;
112112
char *query_string;
@@ -188,7 +188,7 @@ ExecuteQuery(ExecuteStmt *stmt, DestReceiver *dest)
188188
*/
189189
PortalStart(portal, paramLI);
190190

191-
(void) PortalRun(portal, FETCH_ALL, dest, dest, NULL);
191+
(void) PortalRun(portal, FETCH_ALL, dest, dest, completionTag);
192192

193193
PortalDrop(portal, false);
194194

src/backend/tcop/utility.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.212 2004/04/19 21:21:33 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.213 2004/04/22 02:58:20 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -483,7 +483,7 @@ ProcessUtility(Node *parsetree,
483483
break;
484484

485485
case T_ExecuteStmt:
486-
ExecuteQuery((ExecuteStmt *) parsetree, dest);
486+
ExecuteQuery((ExecuteStmt *) parsetree, dest, completionTag);
487487
break;
488488

489489
case T_DeallocateStmt:

src/include/commands/prepare.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 2002-2003, PostgreSQL Global Development Group
88
*
9-
* $PostgreSQL: pgsql/src/include/commands/prepare.h,v 1.9 2003/11/29 22:40:59 pgsql Exp $
9+
* $PostgreSQL: pgsql/src/include/commands/prepare.h,v 1.10 2004/04/22 02:58:21 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -42,7 +42,8 @@ typedef struct
4242

4343
/* Utility statements PREPARE, EXECUTE, DEALLOCATE, EXPLAIN EXECUTE */
4444
extern void PrepareQuery(PrepareStmt *stmt);
45-
extern void ExecuteQuery(ExecuteStmt *stmt, DestReceiver *dest);
45+
extern void ExecuteQuery(ExecuteStmt *stmt, DestReceiver *dest,
46+
char *completionTag);
4647
extern void DeallocateQuery(DeallocateStmt *stmt);
4748
extern void ExplainExecuteQuery(ExplainStmt *stmt, TupOutputState *tstate);
4849

0 commit comments

Comments
 (0)