code for Global-Partition-Index feature

Signed-off-by: xiliu <xiliu_h@163.com>
This commit is contained in:
xiliu
2020-08-25 15:10:14 +08:00
parent 339cd59f26
commit c040d78287
157 changed files with 12502 additions and 939 deletions

View File

@ -41,7 +41,6 @@
#include "gstrace/executer_gstrace.h"
static TupleTableSlot* IndexNext(IndexScanState* node);
static void ExecInitNextPartitionForIndexScan(IndexScanState* node);
/* ----------------------------------------------------------------
@ -818,7 +817,9 @@ void ExecIndexBuildScanKeys(PlanState* plan_state, Relation index, List* quals,
Expr* leftop = NULL; /* expr on lhs of operator */
Expr* rightop = NULL; /* expr on rhs ... */
AttrNumber varattno; /* att number used in scan */
int indnkeyatts;
indnkeyatts = IndexRelationGetNumberOfKeyAttributes(index);
if (IsA(clause, OpExpr)) {
/* indexkey op const or indexkey op expression */
uint32 flags = 0;
@ -839,7 +840,7 @@ void ExecIndexBuildScanKeys(PlanState* plan_state, Relation index, List* quals,
(errcode(ERRCODE_INDEX_CORRUPTED), errmsg("indexqual for OpExpr doesn't have key on left side")));
varattno = ((Var*)leftop)->varattno;
if (varattno < 1 || varattno > index->rd_index->indnatts)
if (varattno < 1 || varattno > indnkeyatts)
ereport(ERROR,
(errcode(ERRCODE_INDEX_CORRUPTED),
errmsg("bogus index qualification for OpExpr, attribute number is %d.", varattno)));
@ -1050,7 +1051,7 @@ void ExecIndexBuildScanKeys(PlanState* plan_state, Relation index, List* quals,
errmsg("indexqual for ScalarArray doesn't have key on left side")));
varattno = ((Var*)leftop)->varattno;
if (varattno < 1 || varattno > index->rd_index->indnatts)
if (varattno < 1 || varattno > indnkeyatts)
ereport(ERROR,
(errcode(ERRCODE_INDEX_CORRUPTED),
errmsg("bogus index qualification for ScalarArray, attribute number is %d.", varattno)));