diff options
Diffstat (limited to 'src/interfaces/ecpg/compatlib/informix.c')
-rw-r--r-- | src/interfaces/ecpg/compatlib/informix.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c index 157809de22f..985704393c9 100644 --- a/src/interfaces/ecpg/compatlib/informix.c +++ b/src/interfaces/ecpg/compatlib/informix.c @@ -8,6 +8,7 @@ #include <ecpg_informix.h> #include <pgtypes_error.h> #include <pgtypes_date.h> +#include <sqltypes.h> char * ECPGalloc(long, int); @@ -147,8 +148,13 @@ deccvasc(char *cp, int len, Decimal *np) char *str = strndup(cp, len); /* Decimal_in always converts the complete string */ int ret = 0; Numeric *result; - - + + if (risnull(CSTRINGTYPE, cp)) + { + rsetnull(CDECIMALTYPE, (char *)np); + return 0; + } + if (!str) ret = -1201; else @@ -292,6 +298,12 @@ dectoasc(Decimal *np, char *cp, int len, int right) if (nres == NULL) return -1211; + if (risnull(CDECIMALTYPE, (char *)np)) + { + rsetnull(CSTRINGTYPE, (char *)cp); + return 0; + } + if (PGTYPESnumeric_from_decimal(np, nres) != 0) return -1211; |