aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-10-07 20:16:57 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-10-07 20:16:57 +0000
commitdc9142f4066158a0a538c59c37dd7fdb7b1f3202 (patch)
tree43bd626ba413c8ea66ef43be13d0009cdca0207b /src/backend/tcop/postgres.c
parent71a6f8b85b9f748dc7f33c1212c4474e8beb901a (diff)
downloadpostgresql-dc9142f4066158a0a538c59c37dd7fdb7b1f3202.tar.gz
postgresql-dc9142f4066158a0a538c59c37dd7fdb7b1f3202.zip
When planning a query at Bind time, be careful to pass the correct
query_list into the Portal, ie, the one seen and possibly modified by the planner. My fault :-( Per report from Sergey Koposov.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index ee63220d956..e22445b4745 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.512 2006/10/07 19:25:28 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.513 2006/10/07 20:16:57 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -1294,6 +1294,7 @@ exec_bind_message(StringInfo input_message)
PreparedStatement *pstmt;
Portal portal;
ParamListInfo params;
+ List *query_list;
List *plan_list;
MemoryContext qContext;
bool save_log_statement_stats = log_statement_stats;
@@ -1572,13 +1573,13 @@ exec_bind_message(StringInfo input_message)
qContext = PortalGetHeapMemory(portal);
oldContext = MemoryContextSwitchTo(qContext);
- plan_list = pg_plan_queries(copyObject(pstmt->query_list),
- params,
- true);
+ query_list = copyObject(pstmt->query_list);
+ plan_list = pg_plan_queries(query_list, params, true);
MemoryContextSwitchTo(oldContext);
}
else
{
+ query_list = pstmt->query_list;
plan_list = pstmt->plan_list;
qContext = pstmt->context;
}
@@ -1590,7 +1591,7 @@ exec_bind_message(StringInfo input_message)
*pstmt->stmt_name ? pstmt->stmt_name : NULL,
pstmt->query_string,
pstmt->commandTag,
- pstmt->query_list,
+ query_list,
plan_list,
qContext);