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

Commit43a9a2f

Browse files
committed
Make fixed_paramref_hook behave properly when there are 'unused' slots
in the parameter array. Noted while experimenting with an examplefrom Pavel. This wouldn't come up in normal use, but it ought to honorthe specification that a parameter array can have unused slots.
1 parentb2aab42 commit43a9a2f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/backend/parser/parse_param.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
*
1919
* IDENTIFICATION
20-
* $PostgreSQL: pgsql/src/backend/parser/parse_param.c,v 2.2 2010/01/02 16:57:50 momjian Exp $
20+
* $PostgreSQL: pgsql/src/backend/parser/parse_param.c,v 2.3 2010/01/13 01:17:07 tgl Exp $
2121
*
2222
*-------------------------------------------------------------------------
2323
*/
@@ -100,8 +100,9 @@ fixed_paramref_hook(ParseState *pstate, ParamRef *pref)
100100
intparamno=pref->number;
101101
Param*param;
102102

103-
/* Check parameter number is in range */
104-
if (paramno <=0||paramno>parstate->numParams)
103+
/* Check parameter number is valid */
104+
if (paramno <=0||paramno>parstate->numParams||
105+
!OidIsValid(parstate->paramTypes[paramno-1]))
105106
ereport(ERROR,
106107
(errcode(ERRCODE_UNDEFINED_PARAMETER),
107108
errmsg("there is no parameter $%d",paramno),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp