添加结构体成员对应的cpp函数修改,增加TIMESCALE_DB_VERSION_NUM=92901,添加版本号判断

修改缩进
This commit is contained in:
08ming
2023-05-30 10:05:29 +08:00
parent 9e93c91d9d
commit 39011270c9
10 changed files with 52 additions and 3 deletions

View File

@ -2576,6 +2576,9 @@ static Aggref* _copyAggref(const Aggref* from)
COPY_SCALAR_FIELD(aggkind);
COPY_SCALAR_FIELD(agglevelsup);
COPY_LOCATION_FIELD(location);
COPY_NODE_FIELD(aggargtypes);
COPY_SCALAR_FIELD(aggsplit);
COPY_SCALAR_FIELD(aggtranstype);
return newnode;
}

View File

@ -233,6 +233,8 @@ static bool _equalAggref(const Aggref* a, const Aggref* b)
COMPARE_SCALAR_FIELD(aggkind);
COMPARE_SCALAR_FIELD(agglevelsup);
COMPARE_LOCATION_FIELD(location);
COMPARE_NODE_FIELD(aggargtypes);
COMPARE_SCALAR_FIELD(aggsplit);
return true;
}

View File

@ -2384,6 +2384,11 @@ static void _outAggref(StringInfo str, Aggref* node)
WRITE_TYPEINFO_FIELD(aggtype);
WRITE_TYPEINFO_FIELD(aggtrantype);
if (t_thrd.proc->workingVersionNum >= TIMESCALE_DB_VERSION_NUM){
WRITE_NODE_FIELD(aggargtypes);
WRITE_INT_FIELD(aggsplit);
WRITE_OID_FIELD(aggtranstype);
}
}
static void _outGroupingFunc(StringInfo str, const GroupingFunc* node)
@ -3450,6 +3455,9 @@ static void _outRelOptInfo(StringInfo str, RelOptInfo* node)
WRITE_NODE_FIELD(joininfo);
WRITE_BOOL_FIELD(has_eclass_joins);
WRITE_UINT_FIELD(num_data_nodes);
if (t_thrd.proc->workingVersionNum >= TIMESCALE_DB_VERSION_NUM){
WRITE_NODE_FIELD(partial_pathlist);
}
}
static void _outIndexOptInfo(StringInfo str, IndexOptInfo* node)
@ -3472,6 +3480,9 @@ static void _outIndexOptInfo(StringInfo str, IndexOptInfo* node)
WRITE_BOOL_FIELD(unique);
WRITE_BOOL_FIELD(immediate);
WRITE_BOOL_FIELD(hypothetical);
if (t_thrd.proc->workingVersionNum >= TIMESCALE_DB_VERSION_NUM){
WRITE_NODE_FIELD(indrestrictinfo);
}
}
static void _outEquivalenceClass(StringInfo str, EquivalenceClass* node)

View File

@ -2227,6 +2227,18 @@ static Aggref* _readAggref(void)
READ_LOCATION_FIELD(location);
READ_TYPEINFO_FIELD(aggtype);
READ_TYPEINFO_FIELD(aggtrantype);
IF_EXIST(aggargtypes)
{
READ_NODE_FIELD(aggargtypes);
}
IF_EXIST(aggsplit)
{
READ_INT_FIELD(aggsplit);
}
IF_EXIST(aggtranstype)
{
READ_OID_FIELD(aggtranstype);
}
READ_DONE();
}

View File

@ -75,7 +75,7 @@ bool will_shutdown = false;
* NEXT | 92899 | ? | ?
*
********************************************/
const uint32 GRAND_VERSION_NUM = 92900;
const uint32 GRAND_VERSION_NUM = 92901;
/********************************************
* 2.VERSION NUM FOR EACH FEATURE
@ -183,6 +183,7 @@ const uint32 GTMLITE_VERSION_NUM = 92110;
const uint32 PREDPUSH_VERSION_NUM = 92096;
const uint32 SUBLINKPULLUP_VERSION_NUM = 92094;
const uint32 PARTIALPUSH_VERSION_NUM = 92087;
const uint32 TIMESCALE_DB_VERSION_NUM = 92901;
/* This variable indicates wheather the instance is in progress of upgrade as a whole */
uint32 volatile WorkingGrandVersionNum = GRAND_VERSION_NUM;

View File

@ -128,6 +128,7 @@ extern const uint32 CREATE_INDEX_IF_NOT_EXISTS_VERSION_NUM;
extern const uint32 SLOW_SQL_VERSION_NUM;
extern const uint32 INDEX_HINT_VERSION_NUM;
extern const uint32 CREATE_TABLE_AS_VERSION_NUM;
extern const uint32 TIMESCALE_DB_VERSION_NUM;
extern void register_backend_version(uint32 backend_version);
extern bool contain_backend_version(uint32 version_number);

View File

@ -581,6 +581,8 @@ typedef struct ResultRelInfo {
int ri_NumUpdatedNeeded;
List* ri_WithCheckOptions;
List* ri_WithCheckOptionExprs;
ProjectionInfo* ri_updateWhere; /* list of ON CONFLICT DO UPDATE exprs (qual)*/
} ResultRelInfo;
/* bloom filter controller */

View File

@ -830,9 +830,20 @@ typedef enum NodeTag {
T_UserVar,
T_CharsetCollateOptions,
T_FunctionSources,
/* ndpplugin tag */
T_NdpScanCondition
T_NdpScanCondition,
/* timescaledb plugin tag */
T_ModifyTablePath,
T_AggPath,
T_WindowAggPath,
T_SortPath,
T_MinMaxAggPath,
T_GatherPath,
T_ForeignKeyCacheInfo,
T_Gather
} NodeTag;
/* if you add to NodeTag also need to add nodeTagToString */

View File

@ -294,6 +294,9 @@ typedef struct Aggref {
char aggkind; /* aggregate kind (see pg_aggregate.h) */
Index agglevelsup; /* > 0 if agg belongs to outer query */
int location; /* token location, or -1 if unknown */
List* aggargtypes; /* type Oids of direct and aggregated args */
int aggsplit; /* expected agg-splitting mode of parent Agg */
Oid aggtranstype; /* type Oid of aggregate's transition value */
} Aggref;
/*

View File

@ -811,6 +811,8 @@ typedef struct RelOptInfo {
RelOptInfo* base_rel;
unsigned int num_data_nodes = 0; //number of distributing data nodes
List* partial_pathlist; /* partial Paths */
} RelOptInfo;
/*
@ -884,6 +886,7 @@ typedef struct IndexOptInfo {
bool amsearchnulls; /* can AM search for NULL/NOT NULL entries? */
bool amhasgettuple; /* does AM have amgettuple interface? */
bool amhasgetbitmap; /* does AM have amgetbitmap interface? */
List* indrestrictinfo;/* parent relation's baserestrictinfo list */
} IndexOptInfo;
/*