agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedFrom: Paul M. Aoki <aoki@CS.Berkeley.EDU>
To: Robert Joop <rj@rainbow.in-berlin.de>
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: pgperl for 4.2?
Date: Thu, 16 Jun 94 04:40:32 -0700
Message-ID: <199406161140.EAA02368@faerie.CS.Berkeley.EDU> (raw)
In-Reply-To: <m0qBWGg-000ftAC@rainbow.in-berlin.de>
rj@rainbow.in-berlin.de (Robert Joop) writes:
> the code that's in 4.2's contrib can't be compiled because a symbol's
> name (and meaning) has changed (it is commented out in a header file,
> and substituting it with another #define that appears to have a similar
> meaning, PORTALS_INITIAL_SIZE, leads to a pgperl that gets a SEGVIOL
> during the `bmake runtest`.
this is my cheap hack for dealing with it. your actual mileage, as
always, may vary.
*** 1.5 1993/06/14 19:47:35
--- pg-libpq.mus 1994/06/16 11:41:10
***************
*** 1,7 ****
/*
* Interface to Postgres from Perl
*
! * $Header: /faerie/aoki/postgres/src/contrib/pgperl/RCS/pg-libpq.mus,v 1.5 1993/06/14 19:47:35 aoki Exp $
*/
/*
--- 1,7 ----
/*
* Interface to Postgres from Perl
*
! * $Header: /home2/aoki/master/src/contrib/pgperl/RCS/pg-libpq.mus,v 1.7 1994/06/16 11:37:21 aoki Exp $
*/
/*
***************
*** 47,52 ****
--- 47,58 ----
#include "tmp/libpq.h"
#include "tmp/libpq-fe.h" /* superset of ones also in libpq-be.h */
+ #ifdef PORTNAME_ultrix4
+ #include "config.h"
+ #undef HAS_MEMCPY
+ #undef HAS_MEMSET
+ #endif /* PORTNAME_ultrix4 */
+
#include "EXTERN.h"
#include "perl.h"
***************
*** 400,436 ****
if (items != 1)
fatal("Usage: &PQpnames($rule_p)");
else {
! int nnames;
! char portalnames[MAXPORTALS][PortalNameLength];
! char *pnames[MAXPORTALS];
! int rule_p = (int) str_gnum(st[1]);
/* Fill in the pname array */
! {
! int i;
! for (i = 0; i < MAXPORTALS; i += 1) {
! pnames[i] = portalnames[i];
! }
! }
!
! (void)PQpnames(pnames, rule_p);
!
! /* Count the number of strings */
! for (nnames = 0; pnames[nnames] != NULL; nnames += 1);
/* Return an array of strings */
if (nnames <= 0) {
st[0] = str_2mortal(str_make("",0));
! return sp;
} else {
- int i;
astore(stack, sp + nnames, NULL); /* force stack to grow */
st = stack->ary_array + sp; /* stack may have changed */
for (i = 1; i <= nnames; i++) {
st[i-1] = str_2mortal(str_make( pnames[i-1], 0 ));
}
! return sp + nnames - 1;
}
}
/*
--- 406,451 ----
if (items != 1)
fatal("Usage: &PQpnames($rule_p)");
else {
! int i, nnames, nportals;
! char *p, *portalnames, **pnames;
! int rule_p = (int) str_gnum(st[1]);
!
! /* Figure out the maximum number of portals we might have */
! nportals = PQnportals(rule_p);
! pnames = (char **) calloc(nportals, sizeof(char *));
! portalnames = (char *) calloc(nportals, PortalNameLength + 1);
/* Fill in the pname array */
! for (i = 0, p = portalnames; i < nportals;
! ++i, p += PortalNameLength + 1) {
! pnames[i] = p;
! }
!
! PQpnames(pnames, rule_p);
!
! /* Count the number of valid strings */
! nnames = 0;
! for (i = 0; i < nportals; ++i) {
! if (pnames[i] && *pnames[i])
! /* We don't care about the blank portal */
! ++nnames;
! }
/* Return an array of strings */
if (nnames <= 0) {
st[0] = str_2mortal(str_make("",0));
! i = sp;
} else {
astore(stack, sp + nnames, NULL); /* force stack to grow */
st = stack->ary_array + sp; /* stack may have changed */
for (i = 1; i <= nnames; i++) {
st[i-1] = str_2mortal(str_make( pnames[i-1], 0 ));
}
! i = sp + nnames - 1;
}
+ free(portalnames);
+ free(pnames);
+ return(i);
}
/*
--
Paul M. Aoki | CS Div., Dept. of EECS, UCB | aoki@CS.Berkeley.EDU
| Berkeley, CA 94720 | ...!uunet!ucbvax!aoki
==============================================================================
To add/remove yourself to/from the POSTGRES mailing list: send mail with
the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"
If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
a human will deal with it. DO NOT post to the "postgres" mailing list.
==============================================================================
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: postgres@postgres.berkeley.edu
Cc: aoki@CS.Berkeley.EDU, rj@rainbow.in-berlin.de
Subject: Re: pgperl for 4.2?
In-Reply-To: <199406161140.EAA02368@faerie.CS.Berkeley.EDU>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox