Re: BUG #17795: Erroneous parsing of floating-poing components in DecodeISO8601Interval() - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17795: Erroneous parsing of floating-poing components in DecodeISO8601Interval()
Date
Msg-id 3801960.1676930364@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17795: Erroneous parsing of floating-poing components in DecodeISO8601Interval()  (Alexander Lakhin <exclusion@gmail.com>)
List pgsql-bugs
Alexander Lakhin <exclusion@gmail.com> writes:
> 20.02.2023 02:40, Tom Lane wrote:
>> There are a couple of other places where datetime.c is using strtod()
>> to parse what it expects to be a fractional value.  I'm inclined to
>> just barf if the result is out of range.  Maybe we shouldn't back-patch
>> that aspect into v15, not sure.

> I could not find a way to pass the e-notation there.

True, I was thinking of this as future-proofing not as closing any
live loophole.

> Also, the comment added makes me wonder, whether ".1e-10"
> (e.g., in "1.1e-10") can be considered bogus too. I would say so
> (if we are going to just add a fraction produced by ParseFraction()
> to some integer part later, we still get the wrong result
> (for the scientific notation)), and if we want to have
> a consistent syntax, maybe it's worth to check an input string for 'e'/'E',
> but if not, then maybe leave it alone. I would prefer the latter for now.

Fair enough.  I pushed the ParseISO8601Number fix without
touching the other two places.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Query run in 27s with 15.2 vs 37ms with 14.6
Next
From: Michael Paquier
Date:
Subject: Re: BUG #17800: ON CONFLICT DO UPDATE fails to detect incompatible fields that leads to a server crash