pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17795: Erroneous parsing of floating-poing components in DecodeISO8601Interval()
Date: Mon, 20 Feb 2023 16:59:24 -0500
Message-ID: <3801960.1676930364@sss.pgh.pa.us> (raw)
In-Reply-To: <18486f0e-cdfa-49b3-c863-bb83bdd8a097@gmail.com>
References: <17795-748d6db3ed95d313@postgresql.org>
	<3449142.1676850059@sss.pgh.pa.us>
	<18486f0e-cdfa-49b3-c863-bb83bdd8a097@gmail.com>

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





view thread (4+ messages)

Message-ID: <3801960.1676930364@sss.pgh.pa.us>
Permalink:  ../3801960.1676930364@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3801960.1676930364@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17795: Erroneous parsing of floating-poing components in DecodeISO8601Interval()
  In-Reply-To: <3801960.1676930364@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox