fix issue
This commit is contained in:
parent
d7fe41d05f
commit
ffeabb132a
|
@ -5861,12 +5861,17 @@ static int32_t translateTrimDatabase(STranslateContext* pCxt, STrimDatabaseStmt*
|
|||
return buildCmdMsg(pCxt, TDMT_MND_TRIM_DB, (FSerializeFunc)tSerializeSTrimDbReq, &req);
|
||||
}
|
||||
|
||||
static int32_t columnDefNodeToField(SNodeList* pList, SArray** pArray) {
|
||||
static int32_t columnDefNodeToField(SNodeList* pList, SArray** pArray, bool calBytes) {
|
||||
*pArray = taosArrayInit(LIST_LENGTH(pList), sizeof(SField));
|
||||
SNode* pNode;
|
||||
FOREACH(pNode, pList) {
|
||||
SColumnDefNode* pCol = (SColumnDefNode*)pNode;
|
||||
SField field = {.type = pCol->dataType.type, .bytes = calcTypeBytes(pCol->dataType)};
|
||||
SField field = {.type = pCol->dataType.type,};
|
||||
if (calBytes) {
|
||||
field.bytes = calcTypeBytes(pCol->dataType);
|
||||
} else {
|
||||
field.bytes = pCol->dataType.bytes;
|
||||
}
|
||||
strcpy(field.name, pCol->colName);
|
||||
if (pCol->sma) {
|
||||
field.flags |= COL_SMA_ON;
|
||||
|
@ -6575,8 +6580,8 @@ static int32_t buildCreateStbReq(STranslateContext* pCxt, SCreateTableStmt* pStm
|
|||
pReq->colVer = 1;
|
||||
pReq->tagVer = 1;
|
||||
pReq->source = TD_REQ_FROM_APP;
|
||||
columnDefNodeToField(pStmt->pCols, &pReq->pColumns);
|
||||
columnDefNodeToField(pStmt->pTags, &pReq->pTags);
|
||||
columnDefNodeToField(pStmt->pCols, &pReq->pColumns, true);
|
||||
columnDefNodeToField(pStmt->pTags, &pReq->pTags, true);
|
||||
pReq->numOfColumns = LIST_LENGTH(pStmt->pCols);
|
||||
pReq->numOfTags = LIST_LENGTH(pStmt->pTags);
|
||||
if (pStmt->pOptions->commentNull == false) {
|
||||
|
@ -8640,10 +8645,10 @@ static int32_t buildCreateStreamReq(STranslateContext* pCxt, SCreateStreamStmt*
|
|||
pReq->fillHistory = pStmt->pOptions->fillHistory;
|
||||
pReq->igExpired = pStmt->pOptions->ignoreExpired;
|
||||
if (pReq->createStb) {
|
||||
columnDefNodeToField(pStmt->pTags, &pReq->pTags);
|
||||
columnDefNodeToField(pStmt->pTags, &pReq->pTags, true);
|
||||
pReq->numOfTags = LIST_LENGTH(pStmt->pTags);
|
||||
}
|
||||
columnDefNodeToField(pStmt->pCols, &pReq->pCols);
|
||||
columnDefNodeToField(pStmt->pCols, &pReq->pCols, false);
|
||||
pReq->igUpdate = pStmt->pOptions->ignoreUpdate;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue