OSDN Git Service

Revise int2/int4/int8/float4/float8 input routines to allow for
authorNeil Conway <neilc@samurai.com>
Thu, 11 Mar 2004 02:11:14 +0000 (02:11 +0000)
committerNeil Conway <neilc@samurai.com>
Thu, 11 Mar 2004 02:11:14 +0000 (02:11 +0000)
commite2ded829f6b672529d072620e43de65466286b59
tree9ffc21ade136f5e667fb41dbd2e8b1c56436b3e5
parent0b86ade1c2f3dcd2407e535baad1654e65252316
Revise int2/int4/int8/float4/float8 input routines to allow for
any amount of leading or trailing whitespace (where "whitespace"
is defined by isspace()). This is for SQL conformance, as well
as consistency with other numeric types (e.g. oid, numeric).

Also refactor pg_atoi() to avoid looking at errno where not
necessary, and add a bunch of regression tests for the input
to these types.
19 files changed:
src/backend/utils/adt/float.c
src/backend/utils/adt/int8.c
src/backend/utils/adt/numutils.c
src/backend/utils/adt/oid.c
src/test/regress/expected/float4.out
src/test/regress/expected/float8.out
src/test/regress/expected/int2.out
src/test/regress/expected/int4.out
src/test/regress/expected/int8.out
src/test/regress/expected/numeric.out
src/test/regress/expected/oid.out
src/test/regress/output/misc.source
src/test/regress/sql/float4.sql
src/test/regress/sql/float8.sql
src/test/regress/sql/int2.sql
src/test/regress/sql/int4.sql
src/test/regress/sql/int8.sql
src/test/regress/sql/numeric.sql
src/test/regress/sql/oid.sql