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); }
}