]> granicus.if.org Git - postgresql/commitdiff
Fixed initialization bug and added postgres_fe.h to pgtypeslib.
authorMichael Meskes <meskes@postgresql.org>
Wed, 2 Jul 2003 07:57:36 +0000 (07:57 +0000)
committerMichael Meskes <meskes@postgresql.org>
Wed, 2 Jul 2003 07:57:36 +0000 (07:57 +0000)
src/interfaces/ecpg/compatlib/informix.c
src/interfaces/ecpg/pgtypeslib/common.c
src/interfaces/ecpg/pgtypeslib/datetime.c
src/interfaces/ecpg/pgtypeslib/dt_common.c
src/interfaces/ecpg/pgtypeslib/interval.c
src/interfaces/ecpg/pgtypeslib/numeric.c
src/interfaces/ecpg/pgtypeslib/timestamp.c

index 889faf54409d9910aa397f07279acd80a63c4e53..157809de22f87e690c1c6cffdf015e09c4f44027 100644 (file)
@@ -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;
index 0be74b21df02193ee937e1a4c5ffc561efc53cf1..03a45870c02521a9d45cabe37ae361b8b5a816b5 100644 (file)
@@ -1,7 +1,4 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
+#include "postgres_fe.h"
 
 #include "extern.h"
 
index e0354abf2df203e4e683440d5b683ced8eefc04a..9811571afc15b29b7ad15b100dcd350bc7017676 100644 (file)
@@ -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"
index c610163d3b99db84646a78f5c0de093ee6863d4b..8d41d6f1e03c9a94dd669cd3146825ded362fea8 100644 (file)
@@ -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
index 361eb08610213c22bf0428a1b94ceeee34f4327f..0646f480f4613f6e4b59b6ca41e334149b38b190 100644 (file)
@@ -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
index b2b1e9e612407290774faa4c28fcbec6ffbb9ea9..2e18cffcd3280e527f7b04d23846e17f831ccd67 100644 (file)
@@ -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"
index 08d5db19e9fa8bd4385d8c6aa09c6dcda7b45c36..6bc2d5e5ad2788ed2a38ed1ebaae75b9a403bd7e 100644 (file)
@@ -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