Fix incorrect format placeholders

pull/131/head
Peter Eisentraut 3 years ago
parent 4fc53819a4
commit 318b1c0cc1
  1. 4
      src/backend/statistics/dependencies.c
  2. 6
      src/backend/statistics/mcv.c
  3. 4
      src/backend/statistics/mvdistinct.c

@ -509,7 +509,7 @@ statext_dependencies_deserialize(bytea *data)
return NULL;
if (VARSIZE_ANY_EXHDR(data) < SizeOfHeader)
elog(ERROR, "invalid MVDependencies size %zd (expected at least %zd)",
elog(ERROR, "invalid MVDependencies size %zu (expected at least %zu)",
VARSIZE_ANY_EXHDR(data), SizeOfHeader);
/* read the MVDependencies header */
@ -541,7 +541,7 @@ statext_dependencies_deserialize(bytea *data)
min_expected_size = SizeOfItem(dependencies->ndeps);
if (VARSIZE_ANY_EXHDR(data) < min_expected_size)
elog(ERROR, "invalid dependencies size %zd (expected at least %zd)",
elog(ERROR, "invalid dependencies size %zu (expected at least %zu)",
VARSIZE_ANY_EXHDR(data), min_expected_size);
/* allocate space for the MCV items */

@ -1032,7 +1032,7 @@ statext_mcv_deserialize(bytea *data)
* header fields one by one, so we need to ignore struct alignment.
*/
if (VARSIZE_ANY(data) < MinSizeOfMCVList)
elog(ERROR, "invalid MCV size %zd (expected at least %zu)",
elog(ERROR, "invalid MCV size %zu (expected at least %zu)",
VARSIZE_ANY(data), MinSizeOfMCVList);
/* read the MCV list header */
@ -1093,7 +1093,7 @@ statext_mcv_deserialize(bytea *data)
* to do this check first, before accessing the dimension info.
*/
if (VARSIZE_ANY(data) < expected_size)
elog(ERROR, "invalid MCV size %zd (expected %zu)",
elog(ERROR, "invalid MCV size %zu (expected %zu)",
VARSIZE_ANY(data), expected_size);
/* Now copy the array of type Oids. */
@ -1125,7 +1125,7 @@ statext_mcv_deserialize(bytea *data)
* check on size.
*/
if (VARSIZE_ANY(data) != expected_size)
elog(ERROR, "invalid MCV size %zd (expected %zu)",
elog(ERROR, "invalid MCV size %zu (expected %zu)",
VARSIZE_ANY(data), expected_size);
/*

@ -261,7 +261,7 @@ statext_ndistinct_deserialize(bytea *data)
/* we expect at least the basic fields of MVNDistinct struct */
if (VARSIZE_ANY_EXHDR(data) < SizeOfHeader)
elog(ERROR, "invalid MVNDistinct size %zd (expected at least %zd)",
elog(ERROR, "invalid MVNDistinct size %zu (expected at least %zu)",
VARSIZE_ANY_EXHDR(data), SizeOfHeader);
/* initialize pointer to the data part (skip the varlena header) */
@ -287,7 +287,7 @@ statext_ndistinct_deserialize(bytea *data)
/* what minimum bytea size do we expect for those parameters */
minimum_size = MinSizeOfItems(ndist.nitems);
if (VARSIZE_ANY_EXHDR(data) < minimum_size)
elog(ERROR, "invalid MVNDistinct size %zd (expected at least %zd)",
elog(ERROR, "invalid MVNDistinct size %zu (expected at least %zu)",
VARSIZE_ANY_EXHDR(data), minimum_size);
/*

Loading…
Cancel
Save