aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r--src/backend/utils/adt/acl.c1
-rw-r--r--src/backend/utils/adt/datetime.c4
-rw-r--r--src/backend/utils/adt/numeric.c1
-rw-r--r--src/backend/utils/adt/ruleutils.c2
-rw-r--r--src/backend/utils/adt/timestamp.c19
5 files changed, 24 insertions, 3 deletions
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index 0cfc297b659..a45e093de79 100644
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -5216,6 +5216,7 @@ get_rolespec_tuple(const RoleSpec *role)
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("role \"%s\" does not exist", "public")));
tuple = NULL; /* make compiler happy */
+ break;
default:
elog(ERROR, "unexpected role type %d", role->roletype);
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 3f0f65c2956..633fb9bf541 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -3146,7 +3146,7 @@ DecodeInterval(char **field, int *ftype, int nf, int range,
* handle signed float numbers and signed year-month values.
*/
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case DTK_DATE:
case DTK_NUMBER:
@@ -3577,6 +3577,7 @@ DecodeISO8601Interval(char *str,
continue;
}
/* Else fall through to extended alternative format */
+ /* FALLTHROUGH */
case '-': /* ISO 8601 4.4.3.3 Alternative Format,
* Extended */
if (havefield)
@@ -3655,6 +3656,7 @@ DecodeISO8601Interval(char *str,
return 0;
}
/* Else fall through to extended alternative format */
+ /* FALLTHROUGH */
case ':': /* ISO 8601 4.4.3.3 Alternative Format,
* Extended */
if (havefield)
diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c
index 6f400729713..c56d5afcb3b 100644
--- a/src/backend/utils/adt/numeric.c
+++ b/src/backend/utils/adt/numeric.c
@@ -1522,6 +1522,7 @@ width_bucket_numeric(PG_FUNCTION_ARGS)
ereport(ERROR,
(errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
errmsg("lower bound cannot equal upper bound")));
+ break;
/* bound1 < bound2 */
case -1:
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 74e1cd8afb1..065238b0fe0 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -7481,8 +7481,8 @@ isSimpleNode(Node *node, Node *parentNode, int prettyFlags)
return false;
}
/* else do the same stuff as for T_SubLink et al. */
- /* FALL THROUGH */
}
+ /* FALLTHROUGH */
case T_SubLink:
case T_NullTest:
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 103f91ae624..265b1db7f60 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -3830,12 +3830,14 @@ timestamp_trunc(PG_FUNCTION_ARGS)
tm->tm_year = ((tm->tm_year + 999) / 1000) * 1000 - 999;
else
tm->tm_year = -((999 - (tm->tm_year - 1)) / 1000) * 1000 + 1;
+ /* FALL THRU */
case DTK_CENTURY:
/* see comments in timestamptz_trunc */
if (tm->tm_year > 0)
tm->tm_year = ((tm->tm_year + 99) / 100) * 100 - 99;
else
tm->tm_year = -((99 - (tm->tm_year - 1)) / 100) * 100 + 1;
+ /* FALL THRU */
case DTK_DECADE:
/* see comments in timestamptz_trunc */
if (val != DTK_MILLENNIUM && val != DTK_CENTURY)
@@ -3845,18 +3847,25 @@ timestamp_trunc(PG_FUNCTION_ARGS)
else
tm->tm_year = -((8 - (tm->tm_year - 1)) / 10) * 10;
}
+ /* FALL THRU */
case DTK_YEAR:
tm->tm_mon = 1;
+ /* FALL THRU */
case DTK_QUARTER:
tm->tm_mon = (3 * ((tm->tm_mon - 1) / 3)) + 1;
+ /* FALL THRU */
case DTK_MONTH:
tm->tm_mday = 1;
+ /* FALL THRU */
case DTK_DAY:
tm->tm_hour = 0;
+ /* FALL THRU */
case DTK_HOUR:
tm->tm_min = 0;
+ /* FALL THRU */
case DTK_MINUTE:
tm->tm_sec = 0;
+ /* FALL THRU */
case DTK_SECOND:
fsec = 0;
break;
@@ -4072,28 +4081,36 @@ interval_trunc(PG_FUNCTION_ARGS)
{
switch (val)
{
- /* fall through */
case DTK_MILLENNIUM:
/* caution: C division may have negative remainder */
tm->tm_year = (tm->tm_year / 1000) * 1000;
+ /* FALL THRU */
case DTK_CENTURY:
/* caution: C division may have negative remainder */
tm->tm_year = (tm->tm_year / 100) * 100;
+ /* FALL THRU */
case DTK_DECADE:
/* caution: C division may have negative remainder */
tm->tm_year = (tm->tm_year / 10) * 10;
+ /* FALL THRU */
case DTK_YEAR:
tm->tm_mon = 0;
+ /* FALL THRU */
case DTK_QUARTER:
tm->tm_mon = 3 * (tm->tm_mon / 3);
+ /* FALL THRU */
case DTK_MONTH:
tm->tm_mday = 0;
+ /* FALL THRU */
case DTK_DAY:
tm->tm_hour = 0;
+ /* FALL THRU */
case DTK_HOUR:
tm->tm_min = 0;
+ /* FALL THRU */
case DTK_MINUTE:
tm->tm_sec = 0;
+ /* FALL THRU */
case DTK_SECOND:
fsec = 0;
break;