Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ad3107b

Browse filesBrowse 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
Copy full SHA for ad3107b

File tree

Expand file treeCollapse file tree

1 file changed

+3
-4
lines changed
Filter options
  • src/backend/statistics
Expand file treeCollapse file tree

1 file changed

+3
-4
lines changed

‎src/backend/statistics/mcv.c

Copy file name to clipboardExpand all lines: src/backend/statistics/mcv.c
+3-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.