]> granicus.if.org Git - postgresql/commitdiff
Fix ginint4_queryextract() to actually do what it was intended to do for an
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 25 Mar 2010 15:50:10 +0000 (15:50 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 25 Mar 2010 15:50:10 +0000 (15:50 +0000)
unsatisfiable query, such as indexcol && empty_array.  It should return -1
to tell GIN no scan is required; but silly typo disabled the logic for that,
resulting in unnecessary "GIN indexes do not support whole-index scans" error.
Per bug report from Jeff Trout.

Back-patch to 8.3 where the logic was introduced.

contrib/intarray/_int_gin.c

index 2bf8fc54bb495389094a585a3e6407fb94b300c2..375ff3ae25e944a6c7f1a5b3f829f2d907911563 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/intarray/_int_gin.c,v 1.10 2009/06/11 14:48:51 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/intarray/_int_gin.c,v 1.11 2010/03/25 15:50:10 tgl Exp $
  */
 #include "postgres.h"
 
@@ -65,7 +65,7 @@ ginint4_queryextract(PG_FUNCTION_ARGS)
                }
        }
 
-       if (nentries == 0)
+       if (*nentries == 0)
        {
                switch (strategy)
                {