OSDN Git Service

Fix an ancient typo that prevented the detection of conflicting fields when
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 2 Aug 2010 01:25:02 +0000 (01:25 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 2 Aug 2010 01:25:02 +0000 (01:25 +0000)
interval input "invalid" was specified together with other fields.  Spotted
by Neil Conway with the help of a clang warning.  Although this has been
wrong since the interval code was written more than 10 years ago, it doesn't
affect anything beyond which error message you get for a wrong input, so not
worth back-patching very far.

src/backend/utils/adt/datetime.c
src/interfaces/ecpg/pgtypeslib/interval.c

index 65d2b87..8e342a9 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.212 2010/05/09 02:15:59 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.212.2.1 2010/08/02 01:25:02 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -3098,7 +3098,7 @@ DecodeInterval(char **field, int *ftype, int nf, int range,
                                                break;
 
                                        case RESERV:
-                                               tmask = (DTK_DATE_M || DTK_TIME_M);
+                                               tmask = (DTK_DATE_M | DTK_TIME_M);
                                                *dtype = val;
                                                break;
 
index b9894d7..b382cc4 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/interval.c,v 1.42 2009/09/03 09:59:20 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/interval.c,v 1.42.10.1 2010/08/02 01:25:02 tgl Exp $ */
 
 #include "postgres_fe.h"
 #include <time.h>
@@ -606,7 +606,7 @@ DecodeInterval(char **field, int *ftype, int nf,            /* int range, */
                                                break;
 
                                        case RESERV:
-                                               tmask = (DTK_DATE_M || DTK_TIME_M);
+                                               tmask = (DTK_DATE_M | DTK_TIME_M);
                                                *dtype = val;
                                                break;