Return-Path: owner-postman Received: from LOCALHOST (LOCALHOST [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id EAA04904 for postgres-redist; Thu, 16 Jun 1994 04:41:24 -0700 Resent-From: POSTGRES mailing list Resent-Message-Id: <199406161141.EAA04904@nobozo.CS.Berkeley.EDU> Sender: owner-postman@postgres.Berkeley.EDU X-Return-Path: owner-postman Received: from faerie.CS.Berkeley.EDU (faerie.CS.Berkeley.EDU [128.32.149.14]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with ESMTP id EAA04894 for ; Thu, 16 Jun 1994 04:41:22 -0700 Received: from LOCALHOST (LOCALHOST [127.0.0.1]) by faerie.CS.Berkeley.EDU (8.6.4/8.1B) with SMTP id EAA02368; Thu, 16 Jun 1994 04:40:32 -0700 Message-Id: <199406161140.EAA02368@faerie.CS.Berkeley.EDU> X-Authentication-Warning: faerie.CS.Berkeley.EDU: Host LOCALHOST didn't use HELO protocol From: aoki@CS.Berkeley.EDU (Paul M. Aoki) To: rj@rainbow.in-berlin.de (Robert Joop) Cc: postgres@postgres.Berkeley.EDU Subject: Re: pgperl for 4.2? Reply-To: aoki@CS.Berkeley.EDU (Paul M. Aoki) In-reply-to: Your message of Thu, 9 Jun 1994 00:38:40 +0200 (MET DST) Date: Thu, 16 Jun 94 04:40:32 -0700 X-Sender: aoki@postgres.Berkeley.EDU Resent-To: postgres-redist@postgres.Berkeley.EDU X-Mts: smtp Resent-Date: Thu, 16 Jun 94 04:41:24 -0700 Resent-XMts: smtp 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. ==============================================================================