diff options
author | Michael Meskes <meskes@postgresql.org> | 2003-07-09 13:49:38 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2003-07-09 13:49:38 +0000 |
commit | abfa8ae54f41acc173faf6cd0ac1ade88bca2df0 (patch) | |
tree | 4a94e53db8a70903c98e9f23f6378ca21ba11f3a | |
parent | 4afcba05deee3bb2b0281608b2c1235607b38515 (diff) | |
download | postgresql-abfa8ae54f41acc173faf6cd0ac1ade88bca2df0.tar.gz postgresql-abfa8ae54f41acc173faf6cd0ac1ade88bca2df0.zip |
Fixed some Informix compat functions so they handle NULL resp. indicators better.
-rw-r--r-- | src/interfaces/ecpg/ChangeLog | 6 | ||||
-rw-r--r-- | src/interfaces/ecpg/compatlib/informix.c | 24 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index c42a6b2599f..93622d5142e 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -1563,6 +1563,12 @@ Tue Jul 8 12:34:00 CEST 2003 - Made Informix decimal-ascii conversion honor Informix NULLs. - Informix variable handling didn't cope well with arrays. + +Wed Jul 9 11:45:02 CEST 2003 + + - Made all Informix functions honor Informix NULLs. + - Extended compatibility functions for INFORMIX handling of DECLARE + statement to work with indicators. - Set ecpg version to 3.0.0 - Set ecpg library to 4.0.0 - Set pgtypes library to 1.0.0 diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c index 985704393c9..d8bbd0d434e 100644 --- a/src/interfaces/ecpg/compatlib/informix.c +++ b/src/interfaces/ecpg/compatlib/informix.c @@ -55,6 +55,12 @@ deccall3(Decimal *arg1, Decimal *arg2, Decimal *result, int (*ptr)(Numeric *, Nu Numeric *a1, *a2, *nres; int i; + if (risnull(CDECIMALTYPE, (char *)arg1) || risnull(CDECIMALTYPE, (char *)arg2)) + { + rsetnull(CDECIMALTYPE, (char *)result); + return 0; + } + if ((a1 = PGTYPESnumeric_new()) == NULL) return -1211; @@ -191,6 +197,12 @@ deccvdbl(double dbl, Decimal *np) Numeric *nres = PGTYPESnumeric_new(); int result = 1; + if (risnull(CDOUBLETYPE, (char *)&dbl)) + { + rsetnull(CDECIMALTYPE, (char *)np); + return 0; + } + if (nres == NULL) return -1211; @@ -208,6 +220,12 @@ deccvint(int in, Decimal *np) Numeric *nres = PGTYPESnumeric_new(); int result = 1; + if (risnull(CINTTYPE, (char *)&in)) + { + rsetnull(CDECIMALTYPE, (char *)np); + return 0; + } + if (nres == NULL) return -1211; @@ -225,6 +243,12 @@ deccvlong(long lng, Decimal *np) Numeric *nres = PGTYPESnumeric_new(); int result = 1; + if (risnull(CLONGTYPE, (char *)&lng)) + { + rsetnull(CDECIMALTYPE, (char *)np); + return 0; + } + if (nres == NULL) return -1211; |