Re: [GENERAL] int2/int4 Failure with 6.5.1 and SlackWare 4.0

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: Charles Tassell <ctassell(at)isn(dot)net>, "'pgsql-general(at)hub(dot)org'" <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] int2/int4 Failure with 6.5.1 and SlackWare 4.0
Date: 1999-07-28 16:35:30
Message-ID: l03130302b3c4e0ddfd2b@[147.233.159.109]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

At 19:16 +0300 on 28/07/1999, Charles Tassell wrote:

> Here is the error from int2.out:
>
> QUERY: CREATE TABLE INT2_TBL(f1 int2);
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('0');
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('1234');
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-1234');
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('34.5');
> ERROR: pg_atoi: error in "34.5": can't parse ".5"
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('32767');
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-32767');
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('100000');
> ERROR: pg_atoi: error reading "100000": Math result not representable
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('asdf');
> ERROR: pg_atoi: error in "asdf": can't parse "asdf"
> QUERY: SELECT '' AS five, INT2_TBL.*;
>
>
> Any ideas what is causing this? It seems to be a problem with the pg_atoi
> function giving a fatal error on any data that is not formatted exactly
> right, or too large for it's return type.

You are looking in the wrong direction. Some of the regression tests
actually produce errors, and the regression test runs the same test, and is
supposed to produce the same errors.

In this test, 34.5 is not a valid integer. 100000 is an integer, but
outside the 2-byte range (which goes -32768 to 32767). And 'asdf' is simply
not a number. So, all these error messages are good and right.

In a regression test, always look at the *diff* files. They tell you what
the differences were between the original and your test, whether the
original result was a normal one or a deliberate error.

My guess is that in your case, you will simply find that the difference
results from some different error message. Perhaps your system would say
"out of range" instead of "Math result not representable". Check the diff.
If this is true, then you have nothing to worry about.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 1999-07-28 17:43:03 Access problems on temp tables
Previous Message Charles Tassell 1999-07-28 16:16:40 int2/int4 Failure with 6.5.1 and SlackWare 4.0