Unix Technical Forum

plperl SRF sanity check fix

This is a discussion on plperl SRF sanity check fix within the Pgsql Patches forums, part of the PostgreSQL category; --> The attached patch moves a plperl sanity check into the correct position. Performing the check in the existing position ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:38 AM
Andrew Dunstan
 
Posts: n/a
Default plperl SRF sanity check fix


The attached patch moves a plperl sanity check into the correct
position. Performing the check in the existing position allows the call
to go through to perl first, possibly resulting in a SEGV.

cheers

andrew


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:49 AM
Bruce Momjian
 
Posts: n/a
Default Re: plperl SRF sanity check fix

Andrew Dunstan wrote:
>
> The attached patch moves a plperl sanity check into the correct
> position. Performing the check in the existing position allows the call
> to go through to perl first, possibly resulting in a SEGV.


OK, patch applied. Your version didn't apply cleanly so I just moved
the block manually.

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Index: src/pl/plperl/plperl.c
================================================== =================
RCS file: /cvsroot/pgsql/src/pl/plperl/plperl.c,v
retrieving revision 1.86
diff -c -c -r1.86 plperl.c
*** src/pl/plperl/plperl.c 12 Jul 2005 20:35:42 -0000 1.86
--- src/pl/plperl/plperl.c 12 Aug 2005 20:45:56 -0000
***************
*** 921,926 ****
--- 921,936 ----
plperl_current_tuple_store = 0;
plperl_current_tuple_desc = 0;

+ if (!rsi || !IsA(rsi, ReturnSetInfo) ||
+ (rsi->allowedModes & SFRM_Materialize) == 0 ||
+ rsi->expectedDesc == NULL)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("set-valued function called in context that "
+ "cannot accept a set")));
+ }
+
perlret = plperl_call_perl_func(prodesc, fcinfo);

/************************************************** **********
***************
*** 936,951 ****

if (prodesc->fn_retisset)
{
- if (!rsi || !IsA(rsi, ReturnSetInfo) ||
- (rsi->allowedModes & SFRM_Materialize) == 0 ||
- rsi->expectedDesc == NULL)
- {
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("set-valued function called in context that "
- "cannot accept a set")));
- }
-
/* If the Perl function returned an arrayref, we pretend that it
* called return_next() for each element of the array, to handle
* old SRFs that didn't know about return_next(). Any other sort
--- 946,951 ----


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:13 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com