|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.529 2007/03/22 19:55:04 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.530 2007/03/29 19:10:10 tgl Exp $ |
12 | 12 | *
|
13 | 13 | * NOTES
|
14 | 14 | * this is the "main" module of the postgres backend and
|
@@ -1239,12 +1239,24 @@ exec_parse_message(const char *query_string,/* string to execute */
|
1239 | 1239 | }
|
1240 | 1240 | else
|
1241 | 1241 | {
|
1242 |
| -/* query_string needs to be copied into unnamed_stmt_context */ |
1243 |
| -/* the rest is there already */ |
| 1242 | +/* |
| 1243 | + * paramTypes and query_string need to be copied into |
| 1244 | + * unnamed_stmt_context. The rest is there already |
| 1245 | + */ |
| 1246 | +Oid*newParamTypes; |
| 1247 | + |
| 1248 | +if (numParams>0) |
| 1249 | +{ |
| 1250 | +newParamTypes= (Oid*)palloc(numParams*sizeof(Oid)); |
| 1251 | +memcpy(newParamTypes,paramTypes,numParams*sizeof(Oid)); |
| 1252 | +} |
| 1253 | +else |
| 1254 | +newParamTypes=NULL; |
| 1255 | + |
1244 | 1256 | unnamed_stmt_psrc=FastCreateCachedPlan(raw_parse_tree,
|
1245 | 1257 | pstrdup(query_string),
|
1246 | 1258 | commandTag,
|
1247 |
| -paramTypes, |
| 1259 | +newParamTypes, |
1248 | 1260 | numParams,
|
1249 | 1261 | stmt_list,
|
1250 | 1262 | fully_planned,
|
|