diff options
author | Michael Meskes <meskes@postgresql.org> | 2003-07-01 12:40:52 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2003-07-01 12:40:52 +0000 |
commit | 2bdd2e5dcff20e4cf5987c901a71b794808d582b (patch) | |
tree | e158aaeb7ac2ab4db9e2e738e6be2aefa9cf4a50 /src/interfaces/ecpg/ecpglib/data.c | |
parent | f973b74583c24e28ff8977d0fdd455474705604a (diff) |
Use ISO dates in pgtypeslib by default.
Applied patch by Philip Yarra to fix some thread issues.
Added a new data type "decimal" which is mostly the same as our
"numeric" but uses a fixed length array to store the digits. This is
for compatibility with Informix and maybe others.
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/data.c')
-rw-r--r-- | src/interfaces/ecpg/ecpglib/data.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c index 77f35e639e0..c9da13794df 100644 --- a/src/interfaces/ecpg/ecpglib/data.c +++ b/src/interfaces/ecpg/ecpglib/data.c @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.9 2003/06/26 11:37:05 meskes Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.10 2003/07/01 12:40:51 meskes Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -398,6 +398,7 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, } break; + case ECPGt_decimal: case ECPGt_numeric: if (pval) { @@ -419,7 +420,10 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, else nres = PGTYPESnumeric_from_asc("0.0", &scan_length); - PGTYPESnumeric_copy(nres, (Numeric *)(var + offset * act_tuple)); + if (type == ECPGt_numeric) + PGTYPESnumeric_copy(nres, (Numeric *)(var + offset * act_tuple)); + else + PGTYPESnumeric_to_decimal(nres, (Decimal *)(var + offset * act_tuple)); break; case ECPGt_interval: |