Fix longstanding error in contrib/intarray's int[] & int[] operator.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 81b4e5ceb6904f3d689a694eb72a90b7ea6cd961
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2012-02-17T01:00:29Z
Releases: 8.4.11
Fix longstanding error in contrib/intarray's int[] & int[] operator.

The array intersection code would give wrong results if the first entry of
the correct output array would be "1".  (I think only this value could be
at risk, since the previous word would always be a lower-bound entry with
that fixed value.)

Problem spotted by Julien Rouhaud, initial patch by Guillaume Lelarge,
cosmetic improvements by me.

Files

PathChange+/−
contrib/intarray/expected/_int.out modified +6 −0
contrib/intarray/_int_tool.c modified +9 −6
contrib/intarray/sql/_int.sql modified +1 −0