feat:add logic for ttl
This commit is contained in:
parent
dd520bdde3
commit
174ae5ee6b
|
@ -121,6 +121,7 @@ typedef struct SCreateSubTableClause {
|
|||
bool ignoreExists;
|
||||
SNodeList* pSpecificTags;
|
||||
SNodeList* pValsOfTags;
|
||||
STableOptions* pOptions;
|
||||
} SCreateSubTableClause;
|
||||
|
||||
typedef struct SCreateMultiTableStmt {
|
||||
|
|
|
@ -508,6 +508,7 @@ void nodesDestroyNode(SNode* pNode) {
|
|||
SCreateSubTableClause* pStmt = (SCreateSubTableClause*)pNode;
|
||||
nodesDestroyList(pStmt->pSpecificTags);
|
||||
nodesDestroyList(pStmt->pValsOfTags);
|
||||
nodesDestroyNode((SNode*)pStmt->pOptions);
|
||||
break;
|
||||
}
|
||||
case QUERY_NODE_CREATE_MULTI_TABLE_STMT:
|
||||
|
|
|
@ -957,9 +957,9 @@ SNode* createCreateSubTableClause(SAstCreateContext* pCxt, bool ignoreExists, SN
|
|||
pStmt->ignoreExists = ignoreExists;
|
||||
pStmt->pSpecificTags = pSpecificTags;
|
||||
pStmt->pValsOfTags = pValsOfTags;
|
||||
pStmt->pOptions = (STableOptions*)pOptions;
|
||||
nodesDestroyNode(pRealTable);
|
||||
nodesDestroyNode(pUseRealTable);
|
||||
nodesDestroyNode(pOptions);
|
||||
return (SNode*)pStmt;
|
||||
}
|
||||
|
||||
|
|
|
@ -4252,6 +4252,7 @@ static int32_t buildNormalTableBatchReq(int32_t acctId, const SCreateTableStmt*
|
|||
SVCreateTbReq req = {0};
|
||||
req.type = TD_NORMAL_TABLE;
|
||||
req.name = strdup(pStmt->tableName);
|
||||
req.ttl = pStmt->pOptions->ttl;
|
||||
req.ntb.schemaRow.nCols = LIST_LENGTH(pStmt->pCols);
|
||||
req.ntb.schemaRow.version = 1;
|
||||
req.ntb.schemaRow.pSchema = taosMemoryCalloc(req.ntb.schemaRow.nCols, sizeof(SSchema));
|
||||
|
@ -4402,6 +4403,7 @@ static void addCreateTbReqIntoVgroup(int32_t acctId, SHashObj* pVgroupHashmap, S
|
|||
struct SVCreateTbReq req = {0};
|
||||
req.type = TD_CHILD_TABLE;
|
||||
req.name = strdup(pStmt->tableName);
|
||||
req.ttl = pStmt->pOptions->ttl;
|
||||
req.ctb.suid = suid;
|
||||
req.ctb.pTag = (uint8_t*)pTag;
|
||||
if (pStmt->ignoreExists) {
|
||||
|
|
Loading…
Reference in New Issue