Re: Building DBD::Pg

From: "Peter Haworth" <pmh(at)edison(dot)ioppublishing(dot)com>
To: "Simon Crute" <simon-news(at)nospam(dot)geordie(dot)demon(dot)co(dot)uk>, pgsql-general(at)postgresql(dot)org
Subject: Re: Building DBD::Pg
Date: 2001-05-08 10:11:26
Message-ID: PGM.20010508101126.11356.390@edison.ioppublishing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 3 May 2001 23:03:57 +0100, Simon Crute wrote:
> [simon(at)sunshine DBD-Pg-0.98]$ make test
> PERL_DL_NONLAZY=1
> /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.0/i686-linux
> -I/usr/local/lib/perl5/5.6.0 test.pl
> OS: linux
> Use of uninitialized value in join at test.pl line 53.
> DBI->data_sources .......... not ok:
> DBI->connect(dbname=template1) failed: No pg_hb at test.pl line 59
> DBI->connect ............... not ok: No pg_hb at test.pl line 59.
> make: *** [test_dynamic] Error 255

One problem is that the error message is being truncated. This patch to DBD::Pg fixes that. The other problem is indicated by the truncated error message, which I guess is complaining about pg_hba.conf

--- dbdimp.c.orig Tue May 1 11:46:47 2001
+++ dbdimp.c Tue May 1 11:55:26 2001
@@ -72,18 +72,21 @@
char *error_msg;
{
D_imp_xxh(h);
- char *err, *src, *dst;
+ char *err, *src, *dst, *end;
int len = strlen(error_msg);

- err = (char *)malloc(strlen(error_msg + 1));
+ err = (char *)malloc(len + 1);
if (!err) {
return;
}
+ /* Remove trailing newlines, allowing for multi-line messages */
+ for(end = error_msg + len; end > error_msg && end[-1] == '\n'; --end);
+
src = error_msg;
dst = err;

/* copy error message without trailing newlines */
- while (*dst != '\0' && *dst != '\n') {
+ while (src < end){
*dst++ = *src++;
}
*dst = '\0';

--
Peter Haworth pmh(at)edison(dot)ioppublishing(dot)com
"It's gotten to the point where the only place you can get work done is at
home, because no one bugs you, and the best place to entertain yourself is
at work, because the Internet connections are faster." -- Scott Adams

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Justin Clift 2001-05-08 11:02:37 Re: Re: Database Recovery Help...
Previous Message Michael Ansley (UK) 2001-05-08 09:23:11 RE: OODBMS vs. RDBMS