summaryrefslogtreecommitdiff
path: root/src/backend/optimizer
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-12-18 18:56:29 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-12-18 18:56:29 +0000
commit93b4f0ff7711d42b8c10e48b0a7575e2847e30b3 (patch)
tree407a0358962555c7dd1bc475671eb1d1a977137e /src/backend/optimizer
parent6b4fe0460cac52973c16c279cfc5d89b066c1fe0 (diff)
Set pg_am.amstrategies to zero for index AMs that don't have fixed
operator strategy numbers, ie, GiST and GIN. This is almost cosmetic enough to not need a catversion bump, but since the opr_sanity regression test has to change in sync with the catalog entry, I figured I'd better do one.
Diffstat (limited to 'src/backend/optimizer')
-rw-r--r--src/backend/optimizer/util/plancat.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index de14ddd2dc0..70a77bd3bd8 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.127 2006/10/04 00:29:55 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.128 2006/12/18 18:56:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -190,10 +190,17 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent,
* Fetch the ordering operators associated with the index, if any.
*/
amorderstrategy = indexRelation->rd_am->amorderstrategy;
- if (amorderstrategy != 0)
+ if (amorderstrategy > 0)
{
int oprindex = amorderstrategy - 1;
+ /*
+ * Index AM must have a fixed set of strategies for it to
+ * make sense to specify amorderstrategy, so we need not
+ * allow the case amstrategies == 0.
+ */
+ Assert(oprindex < indexRelation->rd_am->amstrategies);
+
for (i = 0; i < ncolumns; i++)
{
info->ordering[i] = indexRelation->rd_operator[oprindex];