From 81b4e5ceb6904f3d689a694eb72a90b7ea6cd961 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 16 Feb 2012 20:00:29 -0500 Subject: 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. --- contrib/intarray/sql/_int.sql | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/intarray/sql') diff --git a/contrib/intarray/sql/_int.sql b/contrib/intarray/sql/_int.sql index 1588e3b5145..d020c5fa8e3 100644 --- a/contrib/intarray/sql/_int.sql +++ b/contrib/intarray/sql/_int.sql @@ -32,6 +32,7 @@ SELECT '{123,623,445}'::int[] | 623; SELECT '{123,623,445}'::int[] | 1623; SELECT '{123,623,445}'::int[] | '{1623,623}'; SELECT '{123,623,445}'::int[] & '{1623,623}'; +SELECT '{-1,3,1}'::int[] & '{1,2}'; --test query_int -- cgit v1.2.3