Re: [HACKERS] PostgreSQL 6.5.2 - Mailing list pgsql-hackers

From Keith Parks
Subject Re: [HACKERS] PostgreSQL 6.5.2
Date
Msg-id 199910011902.UAA28875@mtcc.demon.co.uk
Whole thread Raw
Responses Re: [HACKERS] PostgreSQL 6.5.2  (Bruce Momjian <maillist@candle.pha.pa.us>)
Re: [HACKERS] PostgreSQL 6.5.2  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
wieck@debis.com
>[pgsql@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@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);       }
 
}  



pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Rexx interface po postgres ?
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] PostgreSQL 6.5.2