1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Do not check nan values for infinity. Some system are not able to handle this.

By Zoltán Böszörményi
This commit is contained in:
Michael Meskes
2010-02-16 18:41:23 +00:00
parent 3d4a2cea57
commit 492eaefb90
3 changed files with 11 additions and 11 deletions

View File

@ -104,10 +104,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
if (sqlca.sqlcode)
break;
if (isinf(d))
printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
if (isnan(d))
printf("%d NaN '%s'\n", id, val);
else if (isinf(d))
printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( $1 + 3 , $2 )",
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),

View File

@ -37,10 +37,10 @@ main(void)
exec sql fetch from cur into :id, :d, :val;
if (sqlca.sqlcode)
break;
if (isinf(d))
printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
if (isnan(d))
printf("%d NaN '%s'\n", id, val);
else if (isinf(d))
printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
exec sql insert into nantest1 (id, d) values (:id + 3, :d);
exec sql insert into nantest1 (id, d) values (:id + 6, :val);