aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2019-07-05 18:06:02 +0200
committerTomas Vondra <tomas.vondra@postgresql.org>2019-07-05 18:52:31 +0200
commita5dc37866add6552834ec5af6a0053f521fbcc62 (patch)
tree5091b771ed59a6bb510c5791e12c25e8cf4ab48f /src
parente74d141d0d97a7a9f059cdb3cd91ff52599a629b (diff)
downloadpostgresql-a5dc37866add6552834ec5af6a0053f521fbcc62.tar.gz
postgresql-a5dc37866add6552834ec5af6a0053f521fbcc62.zip
Remove unused variable in statext_mcv_serialize()
The itemlen variable used to be referenced in multiple places, but since reworking the serialization code it's used only in one assert. Fixed by removing the variable and calling the macro from the assert directly. Backpatch to 12, where this code was introduced. Reported-by: Jeff Janes Discussion: https://postgr.es/m/CAMkU=1zc_ovH9NZd_9ovuiEWkF9yX06URUDdXCmgDydf-bqB5A@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/statistics/mcv.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/statistics/mcv.c b/src/backend/statistics/mcv.c
index 136ebddc460..913a72ff673 100644
--- a/src/backend/statistics/mcv.c
+++ b/src/backend/statistics/mcv.c
@@ -911,10 +911,9 @@ statext_mcv_serialize(MCVList *mcvlist, VacAttrStats **stats)
for (i = 0; i < mcvlist->nitems; i++)
{
MCVItem *mcvitem = &mcvlist->items[i];
- int itemlen = ITEM_SIZE(dim);
/* don't write beyond the allocated space */
- Assert(ptr <= (endptr - itemlen));
+ Assert(ptr <= (endptr - ITEM_SIZE(dim)));
/* copy NULL and frequency flags into the serialized MCV */
memcpy(ptr, mcvitem->isnull, sizeof(bool) * ndims);