Re: BUG #18712: inet value ::2 handling goes not as expected - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18712: inet value ::2 handling goes not as expected
Date
Msg-id 3065772.1731863111@sss.pgh.pa.us
Whole thread Raw
In response to BUG #18712: inet value ::2 handling goes not as expected  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18712: inet value ::2 handling goes not as expected
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> I think that statement
> select '::0.0.0.2'::inet;
> should return '::0.0.0.2' value, not '::2'

> I think this is what was intended in the Postgres sources. But it seems that
> this line is never executed:
> https://github.com/postgres/postgres/blob/7b88529f4363994450bd4cd3c172006a8a77e222/src/port/inet_net_ntop.c#L260

Hmm ... you are right that that code doesn't do what it seems to
intend to, because by the time that we get to this logic we have
i == 7 not i == 6.  But I'm not sure if we should change it after
all this time.  We're about as likely to get complaints as kudos,
I fear.  And the output isn't incorrect, just not-per-style.

I wonder whether ISC ever changed their version?

            regards, tom lane



pgsql-bugs by date:

Previous
From: Noah Misch
Date:
Subject: Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"
Next
From: Tom Lane
Date:
Subject: Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"