Re: BUG #5034: plperlu problem with gethostbyname

Lists: pgsql-bugs
From: "Diego de Lima" <diego_de_lima(at)hotmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5034: plperlu problem with gethostbyname
Date: 2009-09-03 21:21:38
Message-ID: 200909032121.n83LLc4U007457@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5034
Logged by: Diego de Lima
Email address: diego_de_lima(at)hotmail(dot)com
PostgreSQL version: 8.3.7
Operating system: Linux Fedora 10
Description: plperlu problem with gethostbyname
Details:

The gethostbyname Perl internal function doesn't work properly on 8.3.7,
returning "1" instead of the desired data array.

On Postgres 8.2.x it works perfectly.

Using Perl v5.10.0.

Using Fedora 10 default rpm packages, all updated last month via yum.


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Diego de Lima <diego_de_lima(at)hotmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5034: plperlu problem with gethostbyname
Date: 2009-09-05 03:27:16
Message-ID: 603c8f070909042027u7860d858y2c78b48c8c9bb390@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On Thu, Sep 3, 2009 at 5:21 PM, Diego de Lima<diego_de_lima(at)hotmail(dot)com> wrote:
>
> The following bug has been logged online:
>
> Bug reference:      5034
> Logged by:          Diego de Lima
> Email address:      diego_de_lima(at)hotmail(dot)com
> PostgreSQL version: 8.3.7
> Operating system:   Linux Fedora 10
> Description:        plperlu problem with gethostbyname
> Details:
>
> The gethostbyname Perl internal function doesn't work properly on 8.3.7,
> returning "1" instead of the desired data array.
>
> On Postgres 8.2.x it works perfectly.
>
> Using Perl v5.10.0.
>
> Using Fedora 10 default rpm packages, all updated last month via yum.

I can't reproduce this on a clean build of 8.3.7 or on a clean build
of CVS HEAD, both against perl 5.10.0, so I don't think this is a
PostgreSQL bug. I'm guessing you have a bug in your code someplace.
Here's the test case I used.

create or replace function test() returns varchar as $$use
Data::Dumper; Dumper(gethostbyname("www.google.com"));$$ language
plperlu;

select test();

...Robert


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Diego de Lima <diego_de_lima(at)hotmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5034: plperlu problem with gethostbyname
Date: 2009-09-05 22:52:12
Message-ID: 9085.1252191132@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Thu, Sep 3, 2009 at 5:21 PM, Diego de Lima<diego_de_lima(at)hotmail(dot)com> wrote:
>> Using Fedora 10 default rpm packages, all updated last month via yum.

> I can't reproduce this on a clean build of 8.3.7 or on a clean build
> of CVS HEAD, both against perl 5.10.0, so I don't think this is a
> PostgreSQL bug. I'm guessing you have a bug in your code someplace.
> Here's the test case I used.

> create or replace function test() returns varchar as $$use
> Data::Dumper; Dumper(gethostbyname("www.google.com"));$$ language
> plperlu;

> select test();

Don't have Fedora 10 installed anymore, but the F-11 packages should
be equivalent, and on F-11 I get this:

test
-----------------------------
$VAR1 = 'www.l.google.com';
$VAR2 = 'www.google.com';
$VAR3 = 2;
$VAR4 = 4;
$VAR5 = 'J}';
$VAR6 = 'J}c';
$VAR7 = 'J}g';
$VAR8 = 'J}h';
$VAR9 = 'J}i';
$VAR10 = 'J}j';

(1 row)

I don't know enough about either gethostbyname or Data::Dumper
to figure out if this is sane or not.

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Diego de Lima <diego_de_lima(at)hotmail(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #5034: plperlu problem with gethostbyname
Date: 2009-09-06 15:58:26
Message-ID: E18D24D9-FDA9-4106-97C5-6DF1674A65B6@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On Sep 5, 2009, at 6:52 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Thu, Sep 3, 2009 at 5:21 PM, Diego de Lima<diego_de_lima(at)hotmail(dot)com
>> > wrote:
>>> Using Fedora 10 default rpm packages, all updated last month via
>>> yum.
>
>> I can't reproduce this on a clean build of 8.3.7 or on a clean build
>> of CVS HEAD, both against perl 5.10.0, so I don't think this is a
>> PostgreSQL bug. I'm guessing you have a bug in your code someplace.
>> Here's the test case I used.
>
>> create or replace function test() returns varchar as $$use
>> Data::Dumper; Dumper(gethostbyname("www.google.com"));$$ language
>> plperlu;
>
>> select test();
>
> Don't have Fedora 10 installed anymore, but the F-11 packages should
> be equivalent, and on F-11 I get this:
>
> test
> -----------------------------
> $VAR1 = 'www.l.google.com';
> $VAR2 = 'www.google.com';
> $VAR3 = 2;
> $VAR4 = 4;
> $VAR5 = 'J}';
> $VAR6 = 'J}c';
> $VAR7 = 'J}g';
> $VAR8 = 'J}h';
> $VAR9 = 'J}i';
> $VAR10 = 'J}j';
>
> (1 row)
>
> I don't know enough about either gethostbyname or Data::Dumper
> to figure out if this is sane or not.

I think so. It's certainly an array rather than just the scalar 1, as
the OP alleged we were producing.

...Robert