【标题】:修复yat执行shrink相关语句报错的问题.
(cherry picked commit from <gitee.com//opengauss/openGauss-server/commit/41436335c8bbd805768a2a3426f169e8dc401ff9>
This commit is contained in:
@ -7815,6 +7815,14 @@ static CharsetClause *_copyCharsetClause(const CharsetClause* from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static ShrinkStmt *_copyShrinkStmt(const ShrinkStmt* from)
|
||||
{
|
||||
ShrinkStmt* newnode = makeNode(ShrinkStmt);
|
||||
COPY_NODE_FIELD(relations);
|
||||
COPY_SCALAR_FIELD(nowait);
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static PrefixKey* _copyPrefixKey(const PrefixKey* from)
|
||||
{
|
||||
PrefixKey* newnode = makeNode(PrefixKey);
|
||||
@ -9286,6 +9294,9 @@ void* copyObject(const void* from)
|
||||
case T_CharsetClause:
|
||||
retval = _copyCharsetClause((CharsetClause *)from);
|
||||
break;
|
||||
case T_ShrinkStmt:
|
||||
retval = _copyShrinkStmt((ShrinkStmt*) from);
|
||||
break;
|
||||
#ifdef USE_SPQ
|
||||
case T_Motion:
|
||||
retval = _copyMotion((Motion*)from);
|
||||
|
||||
@ -3627,6 +3627,14 @@ static bool _equalCharsetClause(const CharsetClause* a, const CharsetClause* b)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static bool _equalShrinkStmt(const ShrinkStmt* a, const ShrinkStmt* b)
|
||||
{
|
||||
COMPARE_NODE_FIELD(relations);
|
||||
COMPARE_SCALAR_FIELD(nowait);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool _equalPrefixKey(const PrefixKey* a, const PrefixKey* b)
|
||||
{
|
||||
COMPARE_NODE_FIELD(arg);
|
||||
@ -4636,6 +4644,9 @@ bool equal(const void* a, const void* b)
|
||||
case T_CharsetClause:
|
||||
retval = _equalCharsetClause((const CharsetClause*) a, (const CharsetClause*) b);
|
||||
break;
|
||||
case T_ShrinkStmt:
|
||||
retval = _equalShrinkStmt((const ShrinkStmt*)a, (const ShrinkStmt*)b);
|
||||
break;
|
||||
case T_PrefixKey:
|
||||
retval = _equalPrefixKey((PrefixKey *)a, (PrefixKey *)b);
|
||||
break;
|
||||
|
||||
@ -6384,6 +6384,14 @@ static void _outCharsetClause(StringInfo str, CharsetClause* node)
|
||||
WRITE_LOCATION_FIELD(location);
|
||||
}
|
||||
|
||||
static void _outShrinkStmt(StringInfo str, ShrinkStmt* node)
|
||||
{
|
||||
WRITE_NODE_TYPE("SHRINK");
|
||||
WRITE_NODE_FIELD(relations);
|
||||
WRITE_BOOL_FIELD(nowait);
|
||||
}
|
||||
|
||||
|
||||
static void _outPrefixKey(StringInfo str, PrefixKey* node)
|
||||
{
|
||||
WRITE_NODE_TYPE("PREFIXKEY");
|
||||
@ -7375,6 +7383,9 @@ static void _outNode(StringInfo str, const void* obj)
|
||||
case T_CharsetClause:
|
||||
_outCharsetClause(str, (CharsetClause*)obj);
|
||||
break;
|
||||
case T_ShrinkStmt:
|
||||
_outShrinkStmt(str, (ShrinkStmt*)obj);
|
||||
break;
|
||||
case T_AutoIncrement:
|
||||
_outAutoIncrement(str, (AutoIncrement*)obj);
|
||||
break;
|
||||
|
||||
@ -6471,6 +6471,16 @@ static CharsetClause* _readCharsetClause()
|
||||
READ_DONE();
|
||||
}
|
||||
|
||||
static ShrinkStmt* _readShrinkStmt()
|
||||
{
|
||||
READ_LOCALS(ShrinkStmt);
|
||||
|
||||
READ_NODE_FIELD(relations);
|
||||
READ_BOOL_FIELD(nowait);
|
||||
|
||||
READ_DONE();
|
||||
}
|
||||
|
||||
static PrefixKey* _readPrefixKey()
|
||||
{
|
||||
READ_LOCALS(PrefixKey);
|
||||
@ -7089,7 +7099,9 @@ Node* parseNodeString(void)
|
||||
return_value = _readRotateClause();
|
||||
} else if (MATCH("UNROTATEINFO", 12)) {
|
||||
return_value = _readUnrotateClause();
|
||||
} else {
|
||||
} else if (MATCH("SHRINK", 6)) {
|
||||
return_value = _readShrinkStmt();
|
||||
} else {
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_UNRECOGNIZED_NODE_TYPE),
|
||||
errmsg("parseNodeString(): badly formatted node string \"%s\"...", token)));
|
||||
|
||||
Reference in New Issue
Block a user