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

Commit 8f6a6b7

Browse files
committed
Ensure that an Execute operation can't send tuples in cases where
Describe would claim that no tuples will be returned. Only affects SELECTs added to non-SELECT base queries by rewrite rules. If you want to see the output of such a select, you gotta use 'simple Query' protocol.
1 parent 7991391 commit 8f6a6b7

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/backend/tcop/pquery.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.62 2003/05/06 20:26:27 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.63 2003/05/06 21:01:04 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -727,6 +727,23 @@ PortalRunMulti(Portal portal,
727727
List *plantree_list = portal->planTrees;
728728
List *querylist_item;
729729

730+
/*
731+
* If the destination is RemoteExecute, change to None. The reason
732+
* is that the client won't be expecting any tuples, and indeed has no
733+
* way to know what they are, since there is no provision for Describe
734+
* to send a RowDescription message when this portal execution strategy
735+
* is in effect. This presently will only affect SELECT commands added
736+
* to non-SELECT queries by rewrite rules: such commands will be executed,
737+
* but the results will be discarded unless you use "simple Query"
738+
* protocol.
739+
*/
740+
if (dest->mydest == RemoteExecute ||
741+
dest->mydest == RemoteExecuteInternal)
742+
dest = None_Receiver;
743+
if (altdest->mydest == RemoteExecute ||
744+
altdest->mydest == RemoteExecuteInternal)
745+
altdest = None_Receiver;
746+
730747
/*
731748
* Loop to handle the individual queries generated from a
732749
* single parsetree by analysis and rewrite.

0 commit comments

Comments
 (0)