aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/compatlib/informix.c
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2003-07-08 12:11:35 +0000
committerMichael Meskes <meskes@postgresql.org>2003-07-08 12:11:35 +0000
commitf207718b0cf52dbc080c8856b448e23fea4f8b26 (patch)
tree5b004ed9912a63646dd9412fc06e341431ae24c0 /src/interfaces/ecpg/compatlib/informix.c
parentfee6fd7f65a0281bbb20161ba522df80f8a3d05f (diff)
downloadpostgresql-f207718b0cf52dbc080c8856b448e23fea4f8b26.tar.gz
postgresql-f207718b0cf52dbc080c8856b448e23fea4f8b26.zip
More informix fixes.
Diffstat (limited to 'src/interfaces/ecpg/compatlib/informix.c')
-rw-r--r--src/interfaces/ecpg/compatlib/informix.c16
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;