pg85-ecpg-fix-nan-inf-10-ctxdiff.patch
text/x-patch
Filename: pg85-ecpg-fix-nan-inf-10-ctxdiff.patch
Type: text/x-patch
Part: 0
Message:
Re: NaN/Inf fix for ECPG
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c | 2 | 2 |
| src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc | 2 | 2 |
diff -durpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
--- pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-09 11:43:57.000000000 +0100
+++ pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-16 12:10:55.000000000 +0100
@@ -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 -durpN pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc
--- pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-09 11:43:57.000000000 +0100
+++ pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-16 12:04:59.000000000 +0100
@@ -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);