diff options
| author | Neil Conway <neilc@samurai.com> | 2004-03-11 02:11:14 +0000 |
|---|---|---|
| committer | Neil Conway <neilc@samurai.com> | 2004-03-11 02:11:14 +0000 |
| commit | e2ded829f6b672529d072620e43de65466286b59 (patch) | |
| tree | 9ffc21ade136f5e667fb41dbd2e8b1c56436b3e5 /src/test/regress/sql/int8.sql | |
| parent | 0b86ade1c2f3dcd2407e535baad1654e65252316 (diff) | |
| download | postgresql-e2ded829f6b672529d072620e43de65466286b59.tar.gz | |
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.
Diffstat (limited to 'src/test/regress/sql/int8.sql')
| -rw-r--r-- | src/test/regress/sql/int8.sql | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/test/regress/sql/int8.sql b/src/test/regress/sql/int8.sql index b5cb13480b..98b1606430 100644 --- a/src/test/regress/sql/int8.sql +++ b/src/test/regress/sql/int8.sql @@ -4,12 +4,21 @@ -- CREATE TABLE INT8_TBL(q1 int8, q2 int8); -INSERT INTO INT8_TBL VALUES('123','456'); -INSERT INTO INT8_TBL VALUES('123','4567890123456789'); +INSERT INTO INT8_TBL VALUES(' 123 ',' 456'); +INSERT INTO INT8_TBL VALUES('123 ','4567890123456789'); INSERT INTO INT8_TBL VALUES('4567890123456789','123'); INSERT INTO INT8_TBL VALUES('4567890123456789','4567890123456789'); INSERT INTO INT8_TBL VALUES('4567890123456789','-4567890123456789'); +-- bad inputs +INSERT INTO INT8_TBL(q1) VALUES (' '); +INSERT INTO INT8_TBL(q1) VALUES ('xxx'); +INSERT INTO INT8_TBL(q1) VALUES ('3908203590239580293850293850329485'); +INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340329840934'); +INSERT INTO INT8_TBL(q1) VALUES ('- 123'); +INSERT INTO INT8_TBL(q1) VALUES (' 345 5'); +INSERT INTO INT8_TBL(q1) VALUES (''); + SELECT * FROM INT8_TBL; SELECT '' AS five, q1 AS plus, -q1 AS minus FROM INT8_TBL; |
