Handle hypothetical object size greater than 2^32B.

hypopg_relation_size wasn't careful when converting the number of blocks to
bytes, as the result can overflow an int32.

Per report from Jan Koßmann.
This commit is contained in:
Julien Rouhaud 2020-02-20 21:49:15 +01:00
parent 8827086cb2
commit b41bd64e69
2 changed files with 2 additions and 1 deletions

View file

@ -12,3 +12,4 @@ People who contributed to hypopg:
* Joel Van Horn
* Michael Lroll
* Godwottery
* Jan Koßmann

View file

@ -1500,7 +1500,7 @@ hypopg_relation_size(PG_FUNCTION_ARGS)
}
}
PG_RETURN_INT64(pages * BLCKSZ);
PG_RETURN_INT64(pages * 1.0L * BLCKSZ);
}
/*