reject empty string in float[48], oid

Started by Neil Conwayover 21 years ago5 messagespatches
Jump to latest
#1Neil Conway
neilc@samurai.com

This patch changes the input routines for float4, float8 and oid to
reject empty strings (rather than treating them as "0"). In 8.0 we issue
a warning about this behavior and indicate that the input will not be
accepted by a future release, so it seems reasonable to disallow the
input in 8.1. The patch also updates the regression tests.

Barring any objections, I'll apply this to HEAD tomorrow.

-Neil

Attachments:

float_oid_empty_string-1.patchtext/x-patch; charset=ISO-8859-1; name=float_oid_empty_string-1.patchDownload+52-50
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Neil Conway (#1)
Re: reject empty string in float[48], oid

Neil Conway <neilc@samurai.com> writes:

This patch changes the input routines for float4, float8 and oid to
reject empty strings (rather than treating them as "0"). In 8.0 we issue
a warning about this behavior and indicate that the input will not be
accepted by a future release, so it seems reasonable to disallow the
input in 8.1. The patch also updates the regression tests.

If you're going to add regression tests, how about testing the case of a
non-empty-but-all-whitespace string?

regards, tom lane

#3Neil Conway
neilc@samurai.com
In reply to: Tom Lane (#2)
Re: reject empty string in float[48], oid

On Thu, 2005-02-10 at 20:53 -0500, Tom Lane wrote:

If you're going to add regression tests, how about testing the case of a
non-empty-but-all-whitespace string?

AFAICS that is already tested for.

-Neil

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Neil Conway (#3)
Re: reject empty string in float[48], oid

Neil Conway <neilc@samurai.com> writes:

On Thu, 2005-02-10 at 20:53 -0500, Tom Lane wrote:

If you're going to add regression tests, how about testing the case of a
non-empty-but-all-whitespace string?

AFAICS that is already tested for.

[ looks again... ] Doh. Maybe you should put these tests next to those
then...

regards, tom lane

#5Neil Conway
neilc@samurai.com
In reply to: Tom Lane (#4)
Re: reject empty string in float[48], oid

On Thu, 2005-02-10 at 21:04 -0500, Tom Lane wrote:

Maybe you should put these tests next to those then...

Ok, fair enough. Patch applied to HEAD.

-Neil