Обсуждение: pgsql: Fix assorted corner-case bugs in contrib/intarray.

Поиск
Список
Период
Сортировка

pgsql: Fix assorted corner-case bugs in contrib/intarray.

От
Tom Lane
Дата:
Fix assorted corner-case bugs in contrib/intarray.

The array containment operators now behave per mathematical expectation
for empty arrays (ie, an empty array is contained in anything).
Both these operators and the query_int operators now work as expected in
GiST and GIN index searches, rather than having corner cases where the
index searches gave different answers.

Also, fix unexpected failures where the operators would claim that an array
contained nulls, when in fact there was no longer any null present (similar
to bug #5784).  The restriction to not have nulls is still there, as
removing it would take a lot of added code complexity and probably slow
things down significantly.

Also, remove the arbitrary restriction to 1-D arrays; unlike the other
restriction, this was buying us nothing performance-wise.

Assorted cosmetic improvements and marginal performance improvements, too.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=fdf2dbda3f49310b20780ad7b290da935cd2335d

Modified Files
--------------
contrib/intarray/_int.h             |   80 +++++-----
contrib/intarray/_int_bool.c        |  287 ++++++++++-------------------------
contrib/intarray/_int_gin.c         |  122 ++++++++-------
contrib/intarray/_int_gist.c        |   31 ++---
contrib/intarray/_int_op.c          |  109 ++++++--------
contrib/intarray/_int_tool.c        |  115 +++++++-------
contrib/intarray/_intbig_gist.c     |   17 +--
contrib/intarray/uninstall__int.sql |    4 +-
doc/src/sgml/intarray.sgml          |   27 +++-
9 files changed, 332 insertions(+), 460 deletions(-)