aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/datetime.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 452eb8532dd..a3be406b684 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -2877,19 +2877,18 @@ DecodeInterval(char **field, int *ftype, int nf, int range,
case DTK_TZ:
/*
- * Timezone is a token with a leading sign character and at
+ * Timezone means a token with a leading sign character and at
* least one digit; there could be ':', '.', '-' embedded in
* it as well.
*/
Assert(*field[i] == '-' || *field[i] == '+');
/*
- * Try for hh:mm or hh:mm:ss. If not, fall through to
- * DTK_NUMBER case, which can handle signed float numbers and
- * signed year-month values.
+ * Check for signed hh:mm or hh:mm:ss. If so, process exactly
+ * like DTK_TIME case above, plus handling the sign.
*/
if (strchr(field[i] + 1, ':') != NULL &&
- DecodeTime(field[i] + 1, fmask, INTERVAL_FULL_RANGE,
+ DecodeTime(field[i] + 1, fmask, range,
&tmask, tm, fsec) == 0)
{
if (*field[i] == '-')
@@ -2907,9 +2906,14 @@ DecodeInterval(char **field, int *ftype, int nf, int range,
* are reading right to left.
*/
type = DTK_DAY;
- tmask = DTK_M(TZ);
break;
}
+
+ /*
+ * Otherwise, fall through to DTK_NUMBER case, which can
+ * handle signed float numbers and signed year-month values.
+ */
+
/* FALL THROUGH */
case DTK_DATE: