From 625681aa6505edce3d230ea0c68b2f55df5de0eb Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 16 Dec 2020 14:24:18 +0800 Subject: [PATCH] [TD-225] fix bug found in regression test. --- src/client/src/tscServer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index d5c1e6130f..92afbbfd6f 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -1268,14 +1268,14 @@ int32_t tscBuildKillMsg(SSqlObj *pSql, SSqlInfo *pInfo) { return TSDB_CODE_SUCCESS; } -// TODO update it int tscEstimateCreateTableMsgLength(SSqlObj *pSql, SSqlInfo *pInfo) { SSqlCmd *pCmd = &(pSql->cmd); - int32_t size = minMsgSize() + sizeof(SCMCreateTableMsg) + sizeof(SCreatedTableInfo); + int32_t size = minMsgSize() + sizeof(SCMCreateTableMsg) + sizeof(SCreateTableMsg); SCreateTableSQL *pCreateTableInfo = pInfo->pCreateTableInfo; if (pCreateTableInfo->type == TSQL_CREATE_TABLE_FROM_STABLE) { - size += sizeof(STagData); + int32_t numOfTables = (int32_t)taosArrayGetSize(pInfo->pCreateTableInfo->childTableInfo); + size += numOfTables * (sizeof(SCreateTableMsg) + TSDB_MAX_TAGS_LEN); } else { size += sizeof(SSchema) * (pCmd->numOfCols + pCmd->count); } -- GitLab