Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ad3107b

Browse files
committed
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
1 parent ea4e1c0 commit ad3107b

File tree

1 file changed

+3
-4
lines changed
  • src/backend/statistics

1 file changed

+3
-4
lines changed

src/backend/statistics/mcv.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,6 @@ statext_mcv_serialize(MCVList * mcvlist, VacAttrStats **stats)
740740
ITEM_INDEXES(item)[dim] = (uint16) (value - values[dim]);
741741

742742
/* check the index is within expected bounds */
743-
Assert(ITEM_INDEXES(item)[dim] >= 0);
744743
Assert(ITEM_INDEXES(item)[dim] < info[dim].nvalues);
745744
}
746745

@@ -814,7 +813,7 @@ statext_mcv_deserialize(bytea *data)
814813
* header.
815814
*/
816815
if (VARSIZE_ANY_EXHDR(data) < offsetof(MCVList, items))
817-
elog(ERROR, "invalid MCV size %ld (expected at least %zu)",
816+
elog(ERROR, "invalid MCV size %zd (expected at least %zu)",
818817
VARSIZE_ANY_EXHDR(data), offsetof(MCVList, items));
819818

820819
/* read the MCV list header */
@@ -870,7 +869,7 @@ statext_mcv_deserialize(bytea *data)
870869
* to do this check first, before accessing the dimension info.
871870
*/
872871
if (VARSIZE_ANY_EXHDR(data) < expected_size)
873-
elog(ERROR, "invalid MCV size %ld (expected %zu)",
872+
elog(ERROR, "invalid MCV size %zd (expected %zu)",
874873
VARSIZE_ANY_EXHDR(data), expected_size);
875874

876875
/* Now it's safe to access the dimension info. */
@@ -896,7 +895,7 @@ statext_mcv_deserialize(bytea *data)
896895
* check on size.
897896
*/
898897
if (VARSIZE_ANY_EXHDR(data) != expected_size)
899-
elog(ERROR, "invalid MCV size %ld (expected %zu)",
898+
elog(ERROR, "invalid MCV size %zd (expected %zu)",
900899
VARSIZE_ANY_EXHDR(data), expected_size);
901900

902901
/*

0 commit comments

Comments
 (0)