Bug in comparison of empty jsonb arrays to scalars - Mailing list pgsql-hackers

From Nikita Glukhov
Subject Bug in comparison of empty jsonb arrays to scalars
Date
Msg-id 6ca2551e-95af-928a-a3d9-33f6e06d6b6f@postgrespro.ru
Whole thread Raw
Responses Re: Bug in comparison of empty jsonb arrays to scalars  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Hi hackers.

While working on jsonbstatistics, I found the following bug:
an empty jsonb array is considered to be lesser than any scalar,
but it is expected that objects > arrays > scalars.

# select '[]'::jsonb < 'null'::jsonb;
  ?column?
----------
  t
(1 row)

Attached patch contains:
  1. bug fix (added the missing "else" in compareJsonbContainers())
  2. regression test
  3. pg_upgrade: invalidation of btree indexes on jsonb columns and
REINDEX-script generation

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: commitfest 2016-11 status summary
Next
From: Michael Paquier
Date:
Subject: Re: commitfest 2016-11 status summary