1- /* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.48 2009/03/22 01:12:32 tgl Exp $ */
1+ /* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.49 2009/05/20 16:13:18 meskes Exp $ */
22
33#include "postgres_fe.h"
44
@@ -1132,7 +1132,7 @@ dt2time(double jd, int *hour, int *min, int *sec, fsec_t *fsec)
11321132 */
11331133static int
11341134DecodeNumberField (int len ,char * str ,int fmask ,
1135- int * tmask ,struct tm * tm ,fsec_t * fsec ,int * is2digits , bool EuroDates )
1135+ int * tmask ,struct tm * tm ,fsec_t * fsec ,int * is2digits )
11361136{
11371137char * cp ;
11381138
@@ -1258,7 +1258,7 @@ DecodeNumber(int flen, char *str, int fmask,
12581258 */
12591259if (cp - str > 2 )
12601260return DecodeNumberField (flen ,str , (fmask |DTK_DATE_M ),
1261- tmask ,tm ,fsec ,is2digits , EuroDates );
1261+ tmask ,tm ,fsec ,is2digits );
12621262
12631263* fsec = strtod (cp ,& cp );
12641264if (* cp != '\0' )
@@ -1476,7 +1476,7 @@ DecodeDate(char *str, int fmask, int *tmask, struct tm * tm, bool EuroDates)
14761476 *can be used to represent time spans.
14771477 */
14781478int
1479- DecodeTime (char * str ,int fmask , int * tmask ,struct tm * tm ,fsec_t * fsec )
1479+ DecodeTime (char * str ,int * tmask ,struct tm * tm ,fsec_t * fsec )
14801480{
14811481char * cp ;
14821482
@@ -1640,7 +1640,7 @@ DecodePosixTimezone(char *str, int *tzp)
16401640 */
16411641int
16421642ParseDateTime (char * timestr ,char * lowstr ,
1643- char * * field ,int * ftype ,int maxfields , int * numfields ,char * * endstr )
1643+ char * * field ,int * ftype ,int * numfields ,char * * endstr )
16441644{
16451645int nf = 0 ;
16461646char * lp = lowstr ;
@@ -1928,7 +1928,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
19281928 * time
19291929 */
19301930if ((ftype [i ]= DecodeNumberField (strlen (field [i ]),field [i ],fmask ,
1931- & tmask ,tm ,fsec ,& is2digits , EuroDates ))< 0 )
1931+ & tmask ,tm ,fsec ,& is2digits ))< 0 )
19321932return -1 ;
19331933
19341934/*
@@ -1951,7 +1951,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
19511951break ;
19521952
19531953case DTK_TIME :
1954- if (DecodeTime (field [i ],fmask , & tmask ,tm ,fsec )!= 0 )
1954+ if (DecodeTime (field [i ],& tmask ,tm ,fsec )!= 0 )
19551955return -1 ;
19561956
19571957/*
@@ -2116,7 +2116,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
21162116case DTK_TIME :
21172117/* previous field was "t" for ISO time */
21182118if ((ftype [i ]= DecodeNumberField (strlen (field [i ]),field [i ], (fmask |DTK_DATE_M ),
2119- & tmask ,tm ,fsec ,& is2digits , EuroDates ))< 0 )
2119+ & tmask ,tm ,fsec ,& is2digits ))< 0 )
21202120return -1 ;
21212121
21222122if (tmask != DTK_TIME_M )
@@ -2154,13 +2154,13 @@ DecodeDateTime(char **field, int *ftype, int nf,
21542154 * Example: 20011223 or 040506
21552155 */
21562156if ((ftype [i ]= DecodeNumberField (flen ,field [i ],fmask ,
2157- & tmask ,tm ,fsec ,& is2digits , EuroDates ))< 0 )
2157+ & tmask ,tm ,fsec ,& is2digits ))< 0 )
21582158return -1 ;
21592159}
21602160else if (flen > 4 )
21612161{
21622162if ((ftype [i ]= DecodeNumberField (flen ,field [i ],fmask ,
2163- & tmask ,tm ,fsec ,& is2digits , EuroDates ))< 0 )
2163+ & tmask ,tm ,fsec ,& is2digits ))< 0 )
21642164return -1 ;
21652165}
21662166/* otherwise it is a single date/time field... */
@@ -2580,10 +2580,10 @@ PGTYPEStimestamp_defmt_scan(char **str, char *fmt, timestamp * d,
25802580int scan_type ;
25812581
25822582char * pstr ,
2583- * pfmt ,
2584- * tmp ;
2585- int err = 1 ;
2586- int j ;
2583+ * pfmt ,
2584+ * tmp ;
2585+ int err = 1 ;
2586+ int j ;
25872587struct tm tm ;
25882588
25892589pfmt = fmt ;
@@ -2908,7 +2908,7 @@ PGTYPEStimestamp_defmt_scan(char **str, char *fmt, timestamp * d,
29082908pfmt ++ ;
29092909scan_type = PGTYPES_TYPE_UINT ;
29102910err = pgtypes_defmt_scan (& scan_val ,scan_type ,& pstr ,pfmt );
2911- if (scan_val .uint_val < 0 || scan_val . uint_val > 53 )
2911+ if (scan_val .uint_val > 53 )
29122912err = 1 ;
29132913break ;
29142914case 'V' :
@@ -2922,14 +2922,14 @@ PGTYPEStimestamp_defmt_scan(char **str, char *fmt, timestamp * d,
29222922pfmt ++ ;
29232923scan_type = PGTYPES_TYPE_UINT ;
29242924err = pgtypes_defmt_scan (& scan_val ,scan_type ,& pstr ,pfmt );
2925- if (scan_val .uint_val < 0 || scan_val . uint_val > 6 )
2925+ if (scan_val .uint_val > 6 )
29262926err = 1 ;
29272927break ;
29282928case 'W' :
29292929pfmt ++ ;
29302930scan_type = PGTYPES_TYPE_UINT ;
29312931err = pgtypes_defmt_scan (& scan_val ,scan_type ,& pstr ,pfmt );
2932- if (scan_val .uint_val < 0 || scan_val . uint_val > 53 )
2932+ if (scan_val .uint_val > 53 )
29332933err = 1 ;
29342934break ;
29352935case 'x' :