mirror of https://github.com/postgres/postgres
d5890f49da
Hstore data generated on pg 8.4 and pg_upgraded to current versions
remains in its original on-disk format unless modified. The same goes
for values generated by the addon hstore-new module on pre-9.0
versions. (The hstoreUpgrade function converts old values on the fly
when read in, but the on-disk value is not modified by this.)
Since old-format empty hstores (and hstore-new hstores) have
representations compatible with the new format, hstoreUpgrade thought
it could get away without modifying such values; but this breaks
hstore_hash (and the new hstore_hash_extended) which assumes
bit-perfect matching between semantically identical hstore values.
Only one bit actually differs (the "new version" flag in the count
field) but that of course is enough to break the hash.
Fix by making hstoreUpgrade unconditionally convert all old values to
new format.
Backpatch all the way, even though this changes a hash value in some
cases, because in those cases the hash value is already failing - for
example, a hash join between old- and new-format empty hstores will be
failing to match, or a hash index on an hstore column containing an
old-format empty value will be failing to find the value since it will
be searching for a hash derived from a new-format datum. (There are no
known field reports of this happening, probably because hashing of
hstores has only been useful in limited circumstances and there
probably isn't much upgraded data being used this way.)
Per concerns arising from discussion of commit
|
||
---|---|---|
.. | ||
data | ||
expected | ||
sql | ||
.gitignore | ||
Makefile | ||
hstore--1.0--1.1.sql | ||
hstore--1.1--1.2.sql | ||
hstore--1.2--1.3.sql | ||
hstore--1.3--1.4.sql | ||
hstore--1.4--1.5.sql | ||
hstore--1.4.sql | ||
hstore--1.5--1.6.sql | ||
hstore--unpackaged--1.0.sql | ||
hstore.control | ||
hstore.h | ||
hstore_compat.c | ||
hstore_gin.c | ||
hstore_gist.c | ||
hstore_io.c | ||
hstore_op.c |