diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index 95605f475f..7a2ca24700 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -2155,3 +2155,10 @@ We 8. Nov 10:53:42 CET 2006 - Applied patch by Peter Harris to free auto_mem struct in ECPGconnect. - Set ecpg library version to 5.2. - Set ecpg version to 4.2.1. + +Th 25. Jan 17:17:01 CET 2007 + + - Removed compiler warning due to unneeded unsigned declaration. + - Removed regression test that triggers those libc precision bugs on some archs. + - Set ecpg library version to 5.3. + - Set ecpg version to 4.3.1. diff --git a/src/interfaces/ecpg/ecpglib/extern.h b/src/interfaces/ecpg/ecpglib/extern.h index d5d44a79c0..45a182a0d4 100644 --- a/src/interfaces/ecpg/ecpglib/extern.h +++ b/src/interfaces/ecpg/ecpglib/extern.h @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/extern.h,v 1.21 2007/01/12 10:00:13 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/extern.h,v 1.22 2007/01/25 16:45:25 meskes Exp $ */ #ifndef _ECPG_LIB_EXTERN_H #define _ECPG_LIB_EXTERN_H @@ -40,7 +40,7 @@ void ECPGfree(void *); bool ECPGinit(const struct connection *, const char *, const int); char *ECPGstrdup(const char *, int); const char *ECPGtype_name(enum ECPGttype); -unsigned int ECPGDynamicType(Oid); +int ECPGDynamicType(Oid); void ECPGfree_auto_mem(void); void ECPGclear_auto_mem(void); diff --git a/src/interfaces/ecpg/ecpglib/typename.c b/src/interfaces/ecpg/ecpglib/typename.c index ebd40fece9..d83356e39d 100644 --- a/src/interfaces/ecpg/ecpglib/typename.c +++ b/src/interfaces/ecpg/ecpglib/typename.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/typename.c,v 1.10 2003/11/29 19:52:08 pgsql Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/typename.c,v 1.11 2007/01/25 16:45:25 meskes Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -66,7 +66,7 @@ ECPGtype_name(enum ECPGttype typ) return NULL; } -unsigned int +int ECPGDynamicType(Oid type) { switch (type) diff --git a/src/interfaces/ecpg/test/compat_informix/dec_test.pgc b/src/interfaces/ecpg/test/compat_informix/dec_test.pgc index 31f365d2e3..02e48b56ce 100644 --- a/src/interfaces/ecpg/test/compat_informix/dec_test.pgc +++ b/src/interfaces/ecpg/test/compat_informix/dec_test.pgc @@ -108,9 +108,14 @@ main(void) printf("dec[%d,9]: %s (r: %d - cmp: %d)\n", i, buf, r, q); } - r = dectodbl(dec, &dbl); - if (r) check_errno(); - printf("dec[%d,10]: %g (r: %d)\n", i, r?0.0:dbl, r); + if (i != 6) + { + /* underflow does not work reliable on several archs, so not testing it here */ + /* this is a libc problem since we only call strtod() */ + r = dectodbl(dec, &dbl); + if (r) check_errno(); + printf("dec[%d,10]: %g (r: %d)\n", i, r?0.0:dbl, r); + } PGTYPESdecimal_free(din); printf("\n"); diff --git a/src/interfaces/ecpg/test/expected/compat_informix-dec_test.c b/src/interfaces/ecpg/test/expected/compat_informix-dec_test.c index d71be24e4e..35cd432820 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-dec_test.c +++ b/src/interfaces/ecpg/test/expected/compat_informix-dec_test.c @@ -129,9 +129,14 @@ main(void) printf("dec[%d,9]: %s (r: %d - cmp: %d)\n", i, buf, r, q); } - r = dectodbl(dec, &dbl); - if (r) check_errno(); - printf("dec[%d,10]: %g (r: %d)\n", i, r?0.0:dbl, r); + if (i != 6) + { + /* underflow does not work reliable on several archs, so not testing it here */ + /* this is a libc problem since we only call strtod() */ + r = dectodbl(dec, &dbl); + if (r) check_errno(); + printf("dec[%d,10]: %g (r: %d)\n", i, r?0.0:dbl, r); + } PGTYPESdecimal_free(din); printf("\n"); diff --git a/src/interfaces/ecpg/test/expected/compat_informix-dec_test.stdout b/src/interfaces/ecpg/test/expected/compat_informix-dec_test.stdout index 1b52378538..1f8675b3f3 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-dec_test.stdout +++ b/src/interfaces/ecpg/test/expected/compat_informix-dec_test.stdout @@ -69,7 +69,6 @@ dec[6,6]: 0 (r: 0) dec[6,7]: 0.00 (r: 0 - cmp: 1) dec[6,8]: 0 (r: 0) dec[6,9]: 0.00 (r: 0 - cmp: 1) -(errno == PGTYPES_NUM_UNDERFLOW) - dec[6,10]: 0 (r: -1) dec[7,1]: r: 0, 0.001 dec[7,2]: r: 0, 0 diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c b/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c index 9b6bada22a..444779e811 100644 --- a/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c +++ b/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c @@ -120,9 +120,16 @@ main(void) free(text); } - r = PGTYPESnumeric_to_double(num, &d); - if (r) check_errno(); - printf("num[%d,10]: %g (r: %d)\n", i, r?0.0:d, r); + if (i != 6) + { + /* underflow does not work reliable on several archs, so not testing it here */ + /* this is a libc problem since we only call strtod() */ + + r = PGTYPESnumeric_to_double(num, &d); + if (r) check_errno(); + printf("num[%d,10]: %g (r: %d)\n", i, r?0.0:d, r); + } + /* do not test double to numeric because * - extra digits are different on different architectures * - PGTYPESnumeric_from_double internally calls PGTYPESnumeric_from_asc anyway diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.stdout b/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.stdout index 6c93632ca3..51a74594ea 100644 --- a/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.stdout +++ b/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.stdout @@ -88,7 +88,6 @@ num[6,6]: 0 (r: 0) num[6,7]: 0.00 (r: 0 - cmp: 1) num[6,8]: 0 (r: 0) num[6,9]: 0.00 (r: 0 - cmp: 1) -(errno == PGTYPES_NUM_UNDERFLOW) - num[6,10]: 0 (r: -1) num[6,11]: - (r: 0) num[6,12]: 0.00 (r: 0 - cmp: 0) diff --git a/src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc b/src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc index 5a884f1040..0b2a2e654c 100644 --- a/src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc +++ b/src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc @@ -101,9 +101,16 @@ main(void) free(text); } - r = PGTYPESnumeric_to_double(num, &d); - if (r) check_errno(); - printf("num[%d,10]: %g (r: %d)\n", i, r?0.0:d, r); + if (i != 6) + { + /* underflow does not work reliable on several archs, so not testing it here */ + /* this is a libc problem since we only call strtod() */ + + r = PGTYPESnumeric_to_double(num, &d); + if (r) check_errno(); + printf("num[%d,10]: %g (r: %d)\n", i, r?0.0:d, r); + } + /* do not test double to numeric because * - extra digits are different on different architectures * - PGTYPESnumeric_from_double internally calls PGTYPESnumeric_from_asc anyway