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

Commit21f0db9

Browse files
committed
Back-patch critical fixes for NUMERIC values in plpgsql functions.
1 parent8d018f9 commit21f0db9

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

‎src/pl/plpgsql/src/pl_exec.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* procedural language
44
*
55
* IDENTIFICATION
6-
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.12 1999/07/04 01:03:01 tgl Exp $
6+
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.12.2.1 2000/01/16 00:45:33 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -130,7 +130,7 @@ static void exec_move_row(PLpgSQL_execstate * estate,
130130
staticDatumexec_cast_value(Datumvalue,Oidvaltype,
131131
Oidreqtype,
132132
FmgrInfo*reqinput,
133-
int16reqtypmod,
133+
int32reqtypmod,
134134
bool*isnull);
135135
staticvoidexec_set_found(PLpgSQL_execstate*estate,boolstate);
136136

@@ -1561,7 +1561,7 @@ exec_stmt_raise(PLpgSQL_execstate * estate, PLpgSQL_stmt_raise * stmt)
15611561
typeStruct= (Form_pg_type)GETSTRUCT(typetup);
15621562

15631563
fmgr_info(typeStruct->typoutput,&finfo_output);
1564-
extval= (char*) (*fmgr_faddr(&finfo_output)) (var->value,&(var->isnull),var->datatype->atttypmod);
1564+
extval= (char*) (*fmgr_faddr(&finfo_output)) (var->value,InvalidOid,var->datatype->atttypmod);
15651565
}
15661566
plpgsql_dstring_append(&ds,extval);
15671567
break;
@@ -1874,7 +1874,7 @@ exec_assign_value(PLpgSQL_execstate * estate,
18741874
char*nulls;
18751875
boolattisnull;
18761876
Oidatttype;
1877-
int4atttypmod;
1877+
int32atttypmod;
18781878
HeapTupletypetup;
18791879
Form_pg_typetypeStruct;
18801880
FmgrInfofinfo_input;
@@ -2373,7 +2373,7 @@ static Datum
23732373
exec_cast_value(Datumvalue,Oidvaltype,
23742374
Oidreqtype,
23752375
FmgrInfo*reqinput,
2376-
int16reqtypmod,
2376+
int32reqtypmod,
23772377
bool*isnull)
23782378
{
23792379
if (!*isnull)
@@ -2383,7 +2383,7 @@ exec_cast_value(Datum value, Oid valtype,
23832383
* that of the variable, convert it.
23842384
* ----------
23852385
*/
2386-
if (valtype!=reqtype||reqtypmod>0)
2386+
if (valtype!=reqtype||reqtypmod!=-1)
23872387
{
23882388
HeapTupletypetup;
23892389
Form_pg_typetypeStruct;
@@ -2397,8 +2397,8 @@ exec_cast_value(Datum value, Oid valtype,
23972397
typeStruct= (Form_pg_type)GETSTRUCT(typetup);
23982398

23992399
fmgr_info(typeStruct->typoutput,&finfo_output);
2400-
extval= (char*) (*fmgr_faddr(&finfo_output)) (value,&isnull,-1);
2401-
value= (Datum) (*fmgr_faddr(reqinput)) (extval,&isnull,reqtypmod);
2400+
extval= (char*) (*fmgr_faddr(&finfo_output)) (value,InvalidOid,-1);
2401+
value= (Datum) (*fmgr_faddr(reqinput)) (extval,InvalidOid,reqtypmod);
24022402
}
24032403
}
24042404

‎src/pl/plpgsql/src/plpgsql.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* procedural language
44
*
55
* IDENTIFICATION
6-
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/plpgsql.h,v 1.3 1999/01/27 16:15:22 wieck Exp $
6+
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/plpgsql.h,v 1.3.2.1 2000/01/16 00:45:33 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -126,7 +126,7 @@ typedef struct
126126
Oidtypoid;
127127
FmgrInfotypinput;
128128
booltypbyval;
129-
int16atttypmod;
129+
int32atttypmod;
130130
}PLpgSQL_type;
131131

132132

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp