Commit fbcf2cfb authored by Tom Lane's avatar Tom Lane

Fix an ancient typo that prevented the detection of conflicting fields when

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.
parent 67becf8d
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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.213 2010/08/02 01:24:53 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -3098,7 +3098,7 @@ DecodeInterval(char **field, int *ftype, int nf, int range, ...@@ -3098,7 +3098,7 @@ DecodeInterval(char **field, int *ftype, int nf, int range,
break; break;
case RESERV: case RESERV:
tmask = (DTK_DATE_M || DTK_TIME_M); tmask = (DTK_DATE_M | DTK_TIME_M);
*dtype = val; *dtype = val;
break; break;
......
/* $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.43 2010/08/02 01:24:54 tgl Exp $ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include <time.h> #include <time.h>
...@@ -606,7 +606,7 @@ DecodeInterval(char **field, int *ftype, int nf, /* int range, */ ...@@ -606,7 +606,7 @@ DecodeInterval(char **field, int *ftype, int nf, /* int range, */
break; break;
case RESERV: case RESERV:
tmask = (DTK_DATE_M || DTK_TIME_M); tmask = (DTK_DATE_M | DTK_TIME_M);
*dtype = val; *dtype = val;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment