aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-03-25 15:50:15 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-03-25 15:50:15 +0000
commit3c6dc48ce4fa90ebaaf332d0f8cb77adbe3d5950 (patch)
tree432f81665faafe75283767199a04a6e976cb5645
parent08729b4e8aa3a27bf9b43a2dae6b962405f63222 (diff)
downloadpostgresql-3c6dc48ce4fa90ebaaf332d0f8cb77adbe3d5950.tar.gz
postgresql-3c6dc48ce4fa90ebaaf332d0f8cb77adbe3d5950.zip
Fix ginint4_queryextract() to actually do what it was intended to do for an
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.
-rw-r--r--contrib/intarray/_int_gin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/intarray/_int_gin.c b/contrib/intarray/_int_gin.c
index 2bf8fc54bb4..4607cbeafe2 100644
--- a/contrib/intarray/_int_gin.c
+++ b/contrib/intarray/_int_gin.c
@@ -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.10.2.1 2010/03/25 15:50:15 tgl Exp $
*/
#include "postgres.h"
@@ -65,7 +65,7 @@ ginint4_queryextract(PG_FUNCTION_ARGS)
}
}
- if (nentries == 0)
+ if (*nentries == 0)
{
switch (strategy)
{