diff options
author | Michael Paquier <michael@paquier.xyz> | 2024-06-04 07:15:10 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2024-06-04 07:15:10 +0900 |
commit | f04d1c1db01199f02b0914a7ca2962c531935717 (patch) | |
tree | 21e8e8a7e1dd0e327e7f93f9ba14594422915aa4 /src/backend/utils/adt/ruleutils.c | |
parent | 4ebe51a5fbc3e08861db85fe3868c31c6bc8ed59 (diff) | |
download | postgresql-f04d1c1db01199f02b0914a7ca2962c531935717.tar.gz postgresql-f04d1c1db01199f02b0914a7ca2962c531935717.zip |
Improve assertion in mdwritev()
The assertion used at the beginning of mdwritev(), that is not enabled
except by defining -DCHECK_WRITE_VS_EXTEND as mdnblocks() is costly,
forgot about the total number of blocks to write at location specified
by the caller. The calculation is fixed to count for that, and uses
casts to uint64 to ensure a proper check should the number of blocks
overflow.
Using a cast is a suggestion from Tom Lane.
Oversight in 4908c5872059.
Author: Xing Guo
Discussion: https://postgr.es/m/CACpMh+BM-VgKeO7suPG-VHTtpzJ+zsbDPwVHu42PLp-iTk0z+A@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
0 files changed, 0 insertions, 0 deletions