mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Fix EXPLAIN and EXECUTE commands to pass portal parameters through to
the executor. This allows, for example, JDBC clients to use '?' bound parameters in these commands. Per gripe from Virag Saksena.
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
* Copyright (c) 2002-2005, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.42 2005/10/21 16:43:33 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.43 2005/11/29 01:25:49 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -121,7 +121,8 @@ PrepareQuery(PrepareStmt *stmt)
|
||||
* Implements the 'EXECUTE' utility statement.
|
||||
*/
|
||||
void
|
||||
ExecuteQuery(ExecuteStmt *stmt, DestReceiver *dest, char *completionTag)
|
||||
ExecuteQuery(ExecuteStmt *stmt, ParamListInfo params,
|
||||
DestReceiver *dest, char *completionTag)
|
||||
{
|
||||
PreparedStatement *entry;
|
||||
char *query_string;
|
||||
@ -150,6 +151,7 @@ ExecuteQuery(ExecuteStmt *stmt, DestReceiver *dest, char *completionTag)
|
||||
* of query, in case parameters are pass-by-reference.
|
||||
*/
|
||||
estate = CreateExecutorState();
|
||||
estate->es_param_list_info = params;
|
||||
paramLI = EvaluateParams(estate, stmt->params, entry->argtype_list);
|
||||
}
|
||||
|
||||
@ -538,7 +540,8 @@ DropPreparedStatement(const char *stmt_name, bool showError)
|
||||
* Implements the 'EXPLAIN EXECUTE' utility statement.
|
||||
*/
|
||||
void
|
||||
ExplainExecuteQuery(ExplainStmt *stmt, TupOutputState *tstate)
|
||||
ExplainExecuteQuery(ExplainStmt *stmt, ParamListInfo params,
|
||||
TupOutputState *tstate)
|
||||
{
|
||||
ExecuteStmt *execstmt = (ExecuteStmt *) stmt->query->utilityStmt;
|
||||
PreparedStatement *entry;
|
||||
@ -568,6 +571,7 @@ ExplainExecuteQuery(ExplainStmt *stmt, TupOutputState *tstate)
|
||||
* of query, in case parameters are pass-by-reference.
|
||||
*/
|
||||
estate = CreateExecutorState();
|
||||
estate->es_param_list_info = params;
|
||||
paramLI = EvaluateParams(estate, execstmt->params,
|
||||
entry->argtype_list);
|
||||
}
|
||||
|
Reference in New Issue
Block a user