Fix broken error check in _hash_doinsert.
authorRobert Haas <[email protected]>
Thu, 22 Dec 2016 18:54:40 +0000 (13:54 -0500)
committerRobert Haas <[email protected]>
Thu, 22 Dec 2016 19:12:00 +0000 (14:12 -0500)
commit603ad8ad298315cab79fa4e1c78095e4a3eca003
tree536ec88e4351540a0cbfba8870b90a264cba76df
parent9b8507bfae9119427a5c3acf037c466a7e3d7046
Fix broken error check in _hash_doinsert.

You can't just cast a HashMetaPage to a Page, because the meta page
data is stored after the page header, not at offset 0.  Fortunately,
this didn't break anything because it happens to find hashm_bsize
at the offset at which it expects to find pd_pagesize_version, and
the values are close enough to the same that this works out.

Still, it's a bug, so back-patch to all supported versions.

Mithun Cy, revised a bit by me.
src/backend/access/hash/hashinsert.c