aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-07-19 16:16:57 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-07-19 16:16:57 -0400
commit3cb29c42f990522131535eea75c691fb23191685 (patch)
tree8535509f2ff02f2a82b3135c9d74eaa0ece233d9 /src/backend/parser
parent5752dcd45bd8b9a9115d4be12b9a391464884a39 (diff)
downloadpostgresql-3cb29c42f990522131535eea75c691fb23191685.tar.gz
postgresql-3cb29c42f990522131535eea75c691fb23191685.zip
Add static assertions about pg_control fitting into one disk sector.
When pg_control was first designed, sizeof(ControlFileData) was small enough that a comment seemed like plenty to document the assumption that it'd fit into one disk sector. Now it's nearly 300 bytes, raising the possibility that somebody would carelessly add enough stuff to create a problem. Let's add a StaticAssertStmt() to ensure that the situation doesn't pass unnoticed if it ever occurs. While at it, rename PG_CONTROL_SIZE to PG_CONTROL_FILE_SIZE to make it clearer what that symbol means, and convert the existing runtime comparisons of sizeof(ControlFileData) vs. PG_CONTROL_FILE_SIZE to be static asserts --- we didn't have that technology when this code was first written. Discussion: https://postgr.es/m/9192.1500490591@sss.pgh.pa.us
Diffstat (limited to 'src/backend/parser')
0 files changed, 0 insertions, 0 deletions