diff options
author | Michael Meskes <meskes@postgresql.org> | 2010-02-16 18:41:23 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2010-02-16 18:41:23 +0000 |
commit | 492eaefb90b9e60b608a1a4b2e3e68ce7c6c7c69 (patch) | |
tree | c431067ae16a1105afe7ee0ab10f9425b7bc6a5f /src/interfaces/ecpg/test | |
parent | 3d4a2cea57582ec191a0e14b3c80ac8618e02331 (diff) | |
download | postgresql-492eaefb90b9e60b608a1a4b2e3e68ce7c6c7c69.tar.gz postgresql-492eaefb90b9e60b608a1a4b2e3e68ce7c6c7c69.zip |
Do not check nan values for infinity. Some system are not able to handle this.
By Zoltán Böszörményi
Diffstat (limited to 'src/interfaces/ecpg/test')
-rw-r--r-- | src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c | 4 | ||||
-rw-r--r-- | src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c b/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c index 6b15abe8f10..d8c654f1430 100644 --- a/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c +++ b/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c @@ -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), diff --git a/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc b/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc index 7aa99b00d12..a136867bbdc 100644 --- a/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc +++ b/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc @@ -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); |