同步关键字降级需求

This commit is contained in:
wuyuechuan
2023-11-23 19:23:48 +08:00
parent 8b0bc8d3fe
commit 5c2cc9f3a9
7 changed files with 11 additions and 0 deletions

View File

@ -3774,6 +3774,7 @@ static UpsertClause* _copyUpsertClause(const UpsertClause* from)
UpsertClause* newnode = makeNode(UpsertClause);
COPY_NODE_FIELD(targetList);
COPY_NODE_FIELD(aliasName);
COPY_LOCATION_FIELD(location);
COPY_NODE_FIELD(whereClause);

View File

@ -3043,6 +3043,7 @@ static bool _equalStartWithClause(const StartWithClause * a, const StartWithClau
static bool _equalUpsertClause(const UpsertClause* a, const UpsertClause* b)
{
COMPARE_NODE_FIELD(targetList);
COMPARE_NODE_FIELD(aliasName);
COMPARE_LOCATION_FIELD(location);
COMPARE_NODE_FIELD(whereClause);

View File

@ -870,6 +870,9 @@ static void _outUpsertClause(StringInfo str, const UpsertClause* node)
WRITE_NODE_TYPE("UPSERTCLAUSE");
WRITE_NODE_FIELD(targetList);
if (t_thrd.proc->workingVersionNum >= UPSERT_ALIAS_VERSION_NUM) {
WRITE_NODE_FIELD(aliasName);
}
WRITE_INT_FIELD(location);
if (t_thrd.proc->workingVersionNum >= UPSERT_WHERE_VERSION_NUM) {
WRITE_NODE_FIELD(whereClause);

View File

@ -4307,6 +4307,9 @@ static UpsertClause* _readUpsertClause(void)
READ_LOCALS(UpsertClause);
READ_NODE_FIELD(targetList);
IF_EXIST(aliasName) {
READ_NODE_FIELD(aliasName);
}
READ_INT_FIELD(location);
IF_EXIST(whereClause) {
READ_NODE_FIELD(whereClause);

View File

@ -80,6 +80,7 @@ const uint32 GRAND_VERSION_NUM = 92856;
* 2.VERSION NUM FOR EACH FEATURE
* Please write indescending order.
********************************************/
const uint32 UPSERT_ALIAS_VERSION_NUM = 92856;
const uint32 MULTI_CHARSET_VERSION_NUM = 92856;
const uint32 SRF_FUSION_VERSION_NUM = 92847;
const uint32 INNER_UNIQUE_VERSION_NUM = 92845;

View File

@ -129,6 +129,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 UPSERT_ALIAS_VERSION_NUM;
extern void register_backend_version(uint32 backend_version);
extern bool contain_backend_version(uint32 version_number);

View File

@ -451,6 +451,7 @@ typedef struct HintState {
typedef struct UpsertClause {
NodeTag type;
List *targetList;
Alias *aliasName;
Node *whereClause;
int location;
} UpsertClause;