summaryrefslogtreecommitdiff
path: root/contrib/intarray/sql
diff options
context:
space:
mode:
authorTom Lane2012-02-17 01:00:11 +0000
committerTom Lane2012-02-17 01:00:11 +0000
commit06d9afa6f93ec08a45da4de7afd97bbf16738739 (patch)
tree2c9776a5c070be13f4a3a0c4c61c0c935c620449 /contrib/intarray/sql
parent4767bc8ff2edc1258cf4d8a83155d4cedd724231 (diff)
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.
Diffstat (limited to 'contrib/intarray/sql')
-rw-r--r--contrib/intarray/sql/_int.sql1
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/intarray/sql/_int.sql b/contrib/intarray/sql/_int.sql
index b60e936dc5..216c5c58d6 100644
--- a/contrib/intarray/sql/_int.sql
+++ b/contrib/intarray/sql/_int.sql
@@ -24,6 +24,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