diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 9947faf0524c6c3af090f78fb1d3c284cb61e754..fdf5ff3a2acc221c20fdb6ed2676933696aee544 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -2813,7 +2813,11 @@ static int32_t getTableMetaFromMnode(SSqlObj *pSql, STableMetaInfo *pTableMetaIn tscAddQueryInfo(&pNew->cmd); SQueryInfo *pNewQueryInfo = tscGetQueryInfoS(&pNew->cmd); - if (TSDB_CODE_SUCCESS != tscAllocPayload(&pNew->cmd, TSDB_DEFAULT_PAYLOAD_SIZE + pSql->cmd.payloadLen)) { + int payLoadLen = TSDB_DEFAULT_PAYLOAD_SIZE + pSql->cmd.payloadLen; + if (autocreate && pSql->cmd.insertParam.tagData.dataLen != 0) { + payLoadLen += pSql->cmd.insertParam.tagData.dataLen; + } + if (TSDB_CODE_SUCCESS != tscAllocPayload(&pNew->cmd, payLoadLen)) { tscError("0x%"PRIx64" malloc failed for payload to get table meta", pSql->self); tscFreeSqlObj(pNew);