Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
e2480165
Commit
e2480165
authored
Jan 11, 2005
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plperl was not being quite paranoid enough about detecting 'undef' values
returned by Perl. Per report from Nicolas Addington.
parent
6ff40870
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
src/pl/plperl/plperl.c
src/pl/plperl/plperl.c
+9
-9
No files found.
src/pl/plperl/plperl.c
View file @
e2480165
...
...
@@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.6
5 2004/11/29 20:11:0
5 tgl Exp $
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.6
6 2005/01/11 06:08:4
5 tgl Exp $
*
**********************************************************************/
...
...
@@ -295,7 +295,7 @@ plperl_build_tuple_result(HV *perlhash, AttInMetadata *attinmeta)
(
errcode
(
ERRCODE_UNDEFINED_COLUMN
),
errmsg
(
"Perl hash contains nonexistent column
\"
%s
\"
"
,
key
)));
if
(
SvTYPE
(
val
)
!=
SVt_NULL
)
if
(
Sv
OK
(
val
)
&&
Sv
TYPE
(
val
)
!=
SVt_NULL
)
values
[
attn
-
1
]
=
SvPV
(
val
,
PL_na
);
}
hv_iterinit
(
perlhash
);
...
...
@@ -446,7 +446,7 @@ plperl_modify_tuple(HV *hvTD, TriggerData *tdata, HeapTuple otup)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_UNDEFINED_COLUMN
),
errmsg
(
"$_TD->{new} does not exist"
)));
if
(
SvTYPE
(
*
svp
)
!=
SVt_RV
||
SvTYPE
(
SvRV
(
*
svp
))
!=
SVt_PVHV
)
if
(
!
SvOK
(
*
svp
)
||
SvTYPE
(
*
svp
)
!=
SVt_RV
||
SvTYPE
(
SvRV
(
*
svp
))
!=
SVt_PVHV
)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"$_TD->{new} is not a hash reference"
)));
...
...
@@ -467,7 +467,7 @@ plperl_modify_tuple(HV *hvTD, TriggerData *tdata, HeapTuple otup)
(
errcode
(
ERRCODE_UNDEFINED_COLUMN
),
errmsg
(
"Perl hash contains nonexistent column
\"
%s
\"
"
,
key
)));
if
(
SvTYPE
(
val
)
!=
SVt_NULL
)
if
(
Sv
OK
(
val
)
&&
Sv
TYPE
(
val
)
!=
SVt_NULL
)
{
Oid
typinput
;
Oid
typioparam
;
...
...
@@ -873,7 +873,7 @@ plperl_func_handler(PG_FUNCTION_ARGS)
TupleDesc
tupdesc
;
AttInMetadata
*
attinmeta
;
if
(
SvTYPE
(
perlret
)
!=
SVt_RV
||
SvTYPE
(
SvRV
(
perlret
))
!=
SVt_PVAV
)
if
(
!
SvOK
(
perlret
)
||
SvTYPE
(
perlret
)
!=
SVt_RV
||
SvTYPE
(
SvRV
(
perlret
))
!=
SVt_PVAV
)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"set-returning Perl function must return reference to array"
)));
...
...
@@ -911,7 +911,7 @@ plperl_func_handler(PG_FUNCTION_ARGS)
svp
=
av_fetch
(
ret_av
,
funcctx
->
call_cntr
,
FALSE
);
Assert
(
svp
!=
NULL
);
if
(
SvTYPE
(
*
svp
)
!=
SVt_RV
||
SvTYPE
(
SvRV
(
*
svp
))
!=
SVt_PVHV
)
if
(
!
SvOK
(
*
svp
)
||
SvTYPE
(
*
svp
)
!=
SVt_RV
||
SvTYPE
(
SvRV
(
*
svp
))
!=
SVt_PVHV
)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"elements of Perl result array must be reference to hash"
)));
...
...
@@ -933,7 +933,7 @@ plperl_func_handler(PG_FUNCTION_ARGS)
AV
*
ret_av
;
FuncCallContext
*
funcctx
;
if
(
SvTYPE
(
perlret
)
!=
SVt_RV
||
SvTYPE
(
SvRV
(
perlret
))
!=
SVt_PVAV
)
if
(
!
SvOK
(
perlret
)
||
SvTYPE
(
perlret
)
!=
SVt_RV
||
SvTYPE
(
SvRV
(
perlret
))
!=
SVt_PVAV
)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"set-returning Perl function must return reference to array"
)));
...
...
@@ -957,7 +957,7 @@ plperl_func_handler(PG_FUNCTION_ARGS)
svp
=
av_fetch
(
ret_av
,
funcctx
->
call_cntr
,
FALSE
);
Assert
(
svp
!=
NULL
);
if
(
SvTYPE
(
*
svp
)
!=
SVt_NULL
)
if
(
Sv
OK
(
*
svp
)
&&
Sv
TYPE
(
*
svp
)
!=
SVt_NULL
)
{
char
*
val
=
SvPV
(
*
svp
,
PL_na
);
...
...
@@ -988,7 +988,7 @@ plperl_func_handler(PG_FUNCTION_ARGS)
AttInMetadata
*
attinmeta
;
HeapTuple
tup
;
if
(
SvTYPE
(
perlret
)
!=
SVt_RV
||
SvTYPE
(
SvRV
(
perlret
))
!=
SVt_PVHV
)
if
(
!
SvOK
(
perlret
)
||
SvTYPE
(
perlret
)
!=
SVt_RV
||
SvTYPE
(
SvRV
(
perlret
))
!=
SVt_PVHV
)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"composite-returning Perl function must return reference to hash"
)));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment