aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2019-03-30 18:43:16 +0100
committerTomas Vondra <tomas.vondra@postgresql.org>2019-03-30 18:43:16 +0100
commitad3107b97324e0c8cf65932294115b6af9db8ded (patch)
treefa93bf4793015b3bf1e85e1e4c0a857be35c8b02 /src
parentea4e1c0e8f583f99c8caab5bcdfbbbaaed0685c0 (diff)
downloadpostgresql-ad3107b97324e0c8cf65932294115b6af9db8ded.tar.gz
postgresql-ad3107b97324e0c8cf65932294115b6af9db8ded.zip
Fix compiler warnings in multivariate MCV code
Compiler warnings were observed on gcc 3.4.6 (on gaur). The assert is unnecessary, as the indexes are uint16 and so always >= 0. Reported-by: Tom Lane
Diffstat (limited to 'src')
-rw-r--r--src/backend/statistics/mcv.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/statistics/mcv.c b/src/backend/statistics/mcv.c
index c5288b42d6f..3e9d39c25a3 100644
--- a/src/backend/statistics/mcv.c
+++ b/src/backend/statistics/mcv.c
@@ -740,7 +740,6 @@ statext_mcv_serialize(MCVList * mcvlist, VacAttrStats **stats)
ITEM_INDEXES(item)[dim] = (uint16) (value - values[dim]);
/* check the index is within expected bounds */
- Assert(ITEM_INDEXES(item)[dim] >= 0);
Assert(ITEM_INDEXES(item)[dim] < info[dim].nvalues);
}
@@ -814,7 +813,7 @@ statext_mcv_deserialize(bytea *data)
* header.
*/
if (VARSIZE_ANY_EXHDR(data) < offsetof(MCVList, items))
- elog(ERROR, "invalid MCV size %ld (expected at least %zu)",
+ elog(ERROR, "invalid MCV size %zd (expected at least %zu)",
VARSIZE_ANY_EXHDR(data), offsetof(MCVList, items));
/* read the MCV list header */
@@ -870,7 +869,7 @@ statext_mcv_deserialize(bytea *data)
* to do this check first, before accessing the dimension info.
*/
if (VARSIZE_ANY_EXHDR(data) < expected_size)
- elog(ERROR, "invalid MCV size %ld (expected %zu)",
+ elog(ERROR, "invalid MCV size %zd (expected %zu)",
VARSIZE_ANY_EXHDR(data), expected_size);
/* Now it's safe to access the dimension info. */
@@ -896,7 +895,7 @@ statext_mcv_deserialize(bytea *data)
* check on size.
*/
if (VARSIZE_ANY_EXHDR(data) != expected_size)
- elog(ERROR, "invalid MCV size %ld (expected %zu)",
+ elog(ERROR, "invalid MCV size %zd (expected %zu)",
VARSIZE_ANY_EXHDR(data), expected_size);
/*