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