diff options
author | Michael Meskes <meskes@postgresql.org> | 2003-07-02 07:57:36 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2003-07-02 07:57:36 +0000 |
commit | 7b1885bf989781b12bda847b98c89476efb894c9 (patch) | |
tree | 234fa43ed5e0f2c216eec51b462e59521c28e743 /src | |
parent | b837c99210697765e9c4589755a514cf5a0a8eec (diff) | |
download | postgresql-7b1885bf989781b12bda847b98c89476efb894c9.tar.gz postgresql-7b1885bf989781b12bda847b98c89476efb894c9.zip |
Fixed initialization bug and added postgres_fe.h to pgtypeslib.
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/ecpg/compatlib/informix.c | 5 | ||||
-rw-r--r-- | src/interfaces/ecpg/pgtypeslib/common.c | 5 | ||||
-rw-r--r-- | src/interfaces/ecpg/pgtypeslib/datetime.c | 8 | ||||
-rw-r--r-- | src/interfaces/ecpg/pgtypeslib/dt_common.c | 15 | ||||
-rw-r--r-- | src/interfaces/ecpg/pgtypeslib/interval.c | 8 | ||||
-rw-r--r-- | src/interfaces/ecpg/pgtypeslib/numeric.c | 8 | ||||
-rw-r--r-- | src/interfaces/ecpg/pgtypeslib/timestamp.c | 6 |
7 files changed, 18 insertions, 37 deletions
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c index 889faf54409..157809de22f 100644 --- a/src/interfaces/ecpg/compatlib/informix.c +++ b/src/interfaces/ecpg/compatlib/informix.c @@ -287,7 +287,10 @@ int dectoasc(Decimal *np, char *cp, int len, int right) { char *str; - Numeric *nres; + Numeric *nres = PGTYPESnumeric_new(); + + if (nres == NULL) + return -1211; if (PGTYPESnumeric_from_decimal(np, nres) != 0) return -1211; diff --git a/src/interfaces/ecpg/pgtypeslib/common.c b/src/interfaces/ecpg/pgtypeslib/common.c index 0be74b21df0..03a45870c02 100644 --- a/src/interfaces/ecpg/pgtypeslib/common.c +++ b/src/interfaces/ecpg/pgtypeslib/common.c @@ -1,7 +1,4 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> +#include "postgres_fe.h" #include "extern.h" diff --git a/src/interfaces/ecpg/pgtypeslib/datetime.c b/src/interfaces/ecpg/pgtypeslib/datetime.c index e0354abf2df..9811571afc1 100644 --- a/src/interfaces/ecpg/pgtypeslib/datetime.c +++ b/src/interfaces/ecpg/pgtypeslib/datetime.c @@ -1,10 +1,8 @@ -#include <ctype.h> -#include <errno.h> +#include "postgres_fe.h" + #include <time.h> +#include <ctype.h> #include <float.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> #include "extern.h" #include "dt.h" diff --git a/src/interfaces/ecpg/pgtypeslib/dt_common.c b/src/interfaces/ecpg/pgtypeslib/dt_common.c index c610163d3b9..8d41d6f1e03 100644 --- a/src/interfaces/ecpg/pgtypeslib/dt_common.c +++ b/src/interfaces/ecpg/pgtypeslib/dt_common.c @@ -1,10 +1,7 @@ -#include <ctype.h> -#include <errno.h> +#include "postgres_fe.h" + #include <time.h> -#include <float.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> +#include <ctype.h> #include <math.h> #include "extern.h" @@ -1057,8 +1054,7 @@ abstime2tm(AbsoluteTime _time, int *tzp, struct tm * tm, char **tzn) */ StrNCpy(*tzn, tm->tm_zone, MAXTZLEN + 1); if (strlen(tm->tm_zone) > MAXTZLEN) - elog(WARNING, "Invalid timezone \'%s\'", - tm->tm_zone); + tm->tm_isdst = -1; } } else @@ -1077,8 +1073,7 @@ abstime2tm(AbsoluteTime _time, int *tzp, struct tm * tm, char **tzn) */ StrNCpy(*tzn, tzname[tm->tm_isdst], MAXTZLEN + 1); if (strlen(tzname[tm->tm_isdst]) > MAXTZLEN) - elog(WARNING, "Invalid timezone \'%s\'", - tzname[tm->tm_isdst]); + tm->tm_isdst = -1; } } else diff --git a/src/interfaces/ecpg/pgtypeslib/interval.c b/src/interfaces/ecpg/pgtypeslib/interval.c index 361eb086102..0646f480f46 100644 --- a/src/interfaces/ecpg/pgtypeslib/interval.c +++ b/src/interfaces/ecpg/pgtypeslib/interval.c @@ -1,10 +1,6 @@ -#include <math.h> +#include "postgres_fe.h" #include <time.h> -#include <string.h> -#include <errno.h> -#include <float.h> -#include <stdio.h> -#include <stdlib.h> +#include <math.h> #ifdef __FAST_MATH__ #error -ffast-math is known to break this code diff --git a/src/interfaces/ecpg/pgtypeslib/numeric.c b/src/interfaces/ecpg/pgtypeslib/numeric.c index b2b1e9e6124..2e18cffcd32 100644 --- a/src/interfaces/ecpg/pgtypeslib/numeric.c +++ b/src/interfaces/ecpg/pgtypeslib/numeric.c @@ -1,11 +1,5 @@ +#include "postgres_fe.h" #include <ctype.h> -#include <float.h> -#include <limits.h> -#include <math.h> -#include <errno.h> -#include <stdlib.h> -#include <string.h> -#include <stdio.h> #include "extern.h" #include "pgtypes_error.h" diff --git a/src/interfaces/ecpg/pgtypeslib/timestamp.c b/src/interfaces/ecpg/pgtypeslib/timestamp.c index 08d5db19e9f..6bc2d5e5ad2 100644 --- a/src/interfaces/ecpg/pgtypeslib/timestamp.c +++ b/src/interfaces/ecpg/pgtypeslib/timestamp.c @@ -1,9 +1,7 @@ -#include <math.h> +#include "postgres_fe.h" #include <time.h> -#include <string.h> -#include <errno.h> #include <float.h> -#include <stdio.h> +#include <math.h> #ifdef __FAST_MATH__ #error -ffast-math is known to break this code |