Re: [HACKERS] PostgreSQL 6.5.2

From: Keith Parks <emkxp01(at)mtcc(dot)demon(dot)co(dot)uk>
To: wieck(at)debis(dot)com
Cc: hackers(at)postgresql(dot)org, maillist(at)candle(dot)pha(dot)pa(dot)us
Subject: Re: [HACKERS] PostgreSQL 6.5.2
Date: 1999-10-01 19:02:54
Message-ID: 199910011902.UAA28875@mtcc.demon.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

wieck(at)debis(dot)com
>[pgsql(at)hot] ~/devel/src/test/regress > ./checkresults
>====== int2 ======
>10c10
>< ERROR: pg_atoi: error reading "100000": Numerical result out of range
>---
>> ERROR: pg_atoi: error reading "100000": Math result not representable
>====== int4 ======
>10c10
>< ERROR: pg_atoi: error reading "1000000000000": Numerical result out of range
>---
>> ERROR: pg_atoi: error reading "1000000000000": Math result not representable
>[pgsql(at)hot] ~/devel/src/test/regress >
>
>
>
> Such a regression result while we're in the middle of feature
> development.
>
> I'm really impressed - if we only can keep it on this level!
>

I'm sure we could get rid of even those errors if we were to
incorporate some test like the following and then mangle the
expected results accordingly.

Trouble is I'm not sure how portable the code is:-

SPARCLinux compiles and gives "Math result not representable"
Solaris7 compiles and gives "Result too large"

Comments?

#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
int main(void)
{
char *s = "10000000000000000000000000000000000000000000000000";
long l = 0;
char *badp = (char *) NULL;

errno = 0;

l = strtol(s, &badp, 10);
if (errno) {
printf("%s\n",strerror(errno));
exit(0);
} else {
printf("Error - No Error.");
exit(1);
}
}

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-10-01 20:11:28 Re: [HACKERS] PostgreSQL 6.5.2
Previous Message Oleg Bartunov 1999-10-01 18:16:44 Rexx interface po postgres ?