postgresql/src/backend/utils
Tom Lane b23af45875 Fix erroneous hash calculations in gin_extract_jsonb_path().
The jsonb_path_ops code calculated hash values inconsistently in some cases
involving nested arrays and objects.  This would result in queries possibly
not finding entries that they should find, when using a jsonb_path_ops GIN
index for the search.  The problem cases involve JSONB values that contain
both scalars and sub-objects at the same nesting level, for example an
array containing both scalars and sub-arrays.  To fix, reset the current
stack->hash after processing each value or sub-object, not before; and
don't try to be cute about the outermost level's initial hash.

Correcting this means that existing jsonb_path_ops indexes may now be
inconsistent with the new hash calculation code.  The symptom is the same
--- searches not finding entries they should find --- but the specific
rows affected are likely to be different.  Users will need to REINDEX
jsonb_path_ops indexes to make sure that all searches work as expected.

Per bug #13756 from Daniel Cheng.  Back-patch to 9.4 where the faulty
logic was introduced.
2015-11-05 18:15:48 -05:00
..
adt Fix erroneous hash calculations in gin_extract_jsonb_path(). 2015-11-05 18:15:48 -05:00
cache Remove the SECURITY_ROW_LEVEL_DISABLED security context bit. 2015-09-20 20:47:17 -04:00
error Coordinate log_line_prefix options 'm' and 'n' to share a timeval. 2015-09-07 15:40:49 -07:00
fmgr pgindent run for 9.5 2015-05-23 21:35:49 -04:00
hash Remove volatile qualifiers from dynahash.c, shmem.c, and sinvaladt.c 2015-10-16 14:14:15 -04:00
init Perform an immediate shutdown if the postmaster.pid file is removed. 2015-10-06 17:15:52 -04:00
mb Remove redundant CREATEUSER/NOCREATEUSER options in CREATE ROLE et al. 2015-10-22 09:34:03 -07:00
misc Put back ssl_renegotiation_limit parameter, but only allow 0. 2015-10-20 09:56:04 -04:00
mmgr Fix subtransaction cleanup after an outer-subtransaction portal fails. 2015-09-04 13:37:14 -04:00
resowner Update copyright for 2015 2015-01-06 11:43:47 -05:00
sort Improve comments about abbreviation abort. 2015-11-03 14:11:49 -05:00
time Speed up HeapTupleSatisfiesMVCC() by replacing the XID-in-progress test. 2015-08-26 18:19:07 -04:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
Gen_dummy_probes.sed Update copyright for 2015 2015-01-06 11:43:47 -05:00
Gen_fmgrtab.pl Allow forcing nullness of columns during bootstrap. 2015-02-21 22:31:54 +01:00
generate-errcodes.pl Update copyright for 2015 2015-01-06 11:43:47 -05:00
Makefile Make handling of errcodes.h more consistent with other generated headers. 2011-02-04 09:29:10 -05:00
probes.d Update copyright for 2015 2015-01-06 11:43:47 -05:00