Commit 8acc1e0f authored by Alvaro Herrera's avatar Alvaro Herrera

Fix printf format to use %zd when printing sizes

Using %ld as we were doing raises compiler warnings on 32 bit platforms.

Reported by Andres Freund.
Discussion: https://postgr.es/m/20170407214022.fidezl2e6rk3tuiz@alap3.anarazel.de
parent 8bf74967
...@@ -511,7 +511,7 @@ statext_dependencies_deserialize(bytea *data) ...@@ -511,7 +511,7 @@ statext_dependencies_deserialize(bytea *data)
return NULL; return NULL;
if (VARSIZE_ANY_EXHDR(data) < SizeOfDependencies) if (VARSIZE_ANY_EXHDR(data) < SizeOfDependencies)
elog(ERROR, "invalid MVDependencies size %ld (expected at least %ld)", elog(ERROR, "invalid MVDependencies size %zd (expected at least %zd)",
VARSIZE_ANY_EXHDR(data), SizeOfDependencies); VARSIZE_ANY_EXHDR(data), SizeOfDependencies);
/* read the MVDependencies header */ /* read the MVDependencies header */
...@@ -547,7 +547,7 @@ statext_dependencies_deserialize(bytea *data) ...@@ -547,7 +547,7 @@ statext_dependencies_deserialize(bytea *data)
sizeof(AttrNumber) * 2); sizeof(AttrNumber) * 2);
if (VARSIZE_ANY_EXHDR(data) < min_expected_size) if (VARSIZE_ANY_EXHDR(data) < min_expected_size)
elog(ERROR, "invalid dependencies size %ld (expected at least %ld)", elog(ERROR, "invalid dependencies size %zd (expected at least %zd)",
VARSIZE_ANY_EXHDR(data), min_expected_size); VARSIZE_ANY_EXHDR(data), min_expected_size);
/* allocate space for the MCV items */ /* allocate space for the MCV items */
......
...@@ -238,7 +238,7 @@ statext_ndistinct_deserialize(bytea *data) ...@@ -238,7 +238,7 @@ statext_ndistinct_deserialize(bytea *data)
/* we expect at least the basic fields of MVNDistinct struct */ /* we expect at least the basic fields of MVNDistinct struct */
if (VARSIZE_ANY_EXHDR(data) < SizeOfMVNDistinct) if (VARSIZE_ANY_EXHDR(data) < SizeOfMVNDistinct)
elog(ERROR, "invalid MVNDistinct size %ld (expected at least %ld)", elog(ERROR, "invalid MVNDistinct size %zd (expected at least %zd)",
VARSIZE_ANY_EXHDR(data), SizeOfMVNDistinct); VARSIZE_ANY_EXHDR(data), SizeOfMVNDistinct);
/* initialize pointer to the data part (skip the varlena header) */ /* initialize pointer to the data part (skip the varlena header) */
...@@ -274,7 +274,7 @@ statext_ndistinct_deserialize(bytea *data) ...@@ -274,7 +274,7 @@ statext_ndistinct_deserialize(bytea *data)
if (VARSIZE_ANY_EXHDR(data) < minimum_size) if (VARSIZE_ANY_EXHDR(data) < minimum_size)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_DATA_CORRUPTED), (errcode(ERRCODE_DATA_CORRUPTED),
errmsg("invalid MVNDistinct size %ld (expected at least %ld)", errmsg("invalid MVNDistinct size %zd (expected at least %zd)",
VARSIZE_ANY_EXHDR(data), minimum_size))); VARSIZE_ANY_EXHDR(data), minimum_size)));
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment