Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit972e20b

Browse files
committed
exec_parse_message neglected to copy parameter type array into the
required memory context when handling client-specified parameter typesfor an unnamed statement. Per report from Kris Jurka.
1 parent96b1719 commit972e20b

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

‎src/backend/tcop/postgres.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* 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 $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1239,12 +1239,24 @@ exec_parse_message(const char *query_string,/* string to execute */
12391239
}
12401240
else
12411241
{
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+
12441256
unnamed_stmt_psrc=FastCreateCachedPlan(raw_parse_tree,
12451257
pstrdup(query_string),
12461258
commandTag,
1247-
paramTypes,
1259+
newParamTypes,
12481260
numParams,
12491261
stmt_list,
12501262
fully_planned,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp