]> 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:22 +0000 (15:50 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 25 Mar 2010 15:50:22 +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 6856a68e03835ba7af33be65f4069f3391210e09..37ea55b8d1f903098520faa979cbb19dc77ba0e7 100644 (file)
@@ -57,7 +57,7 @@ ginint4_queryextract(PG_FUNCTION_ARGS)
                }
        }
 
-       if (nentries == 0)
+       if (*nentries == 0)
        {
                switch (strategy)
                {