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

Lines changed: 3 additions & 4 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy