diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index 11aa61d448e3788a014e702d3c75c60fc52976b1..f2af4f1d32b3de2ff8e65994c7199f522ff2f634 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -1035,10 +1035,9 @@ int tsParseInsertSql(SSqlObj *pSql) { pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); } - // TODO: 2048 is added because TSDB_MAX_TAGS_LEN now is 65536, but TSDB_PAYLOAD_SIZE is 65380 -// if ((code = tscAllocPayload(pCmd, TSDB_PAYLOAD_SIZE + 2048)) != TSDB_CODE_SUCCESS) { -// return code; -// } + if ((code = tscAllocPayload(pCmd, TSDB_DEFAULT_PAYLOAD_SIZE)) != TSDB_CODE_SUCCESS) { + return code; + } if (NULL == pCmd->pTableList) { pCmd->pTableList = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false); diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index d875a8590593b86e4837eb7de43585a94d54c9ac..631a9b5eb3f6c41a7e74e606f2d8f239cfc6479d 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -824,7 +824,9 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) { tscError("%p: fseek failed: %s", pSql, tstrerror(code)); return code; } - if (fread(pMsg, pBlockInfo->compLen, 1, pQueryInfo->tsBuf->f) != pBlockInfo->compLen) { + + size_t s = fread(pMsg, 1, pBlockInfo->compLen, pQueryInfo->tsBuf->f); + if (s != pBlockInfo->compLen) { int code = TAOS_SYSTEM_ERROR(ferror(pQueryInfo->tsBuf->f)); tscError("%p: fread didn't return expected data: %s", pSql, tstrerror(code)); return code;