Merge branch '3.0' into enh/TD-32413/snprintf
This commit is contained in:
commit
dff505b87d
|
@ -234,6 +234,7 @@ static int32_t doSetUpdateTaskAction(SMnode *pMnode, STrans *pTrans, SStreamTask
|
||||||
code = extractNodeEpset(pMnode, &epset, &hasEpset, pTask->id.taskId, pTask->info.nodeId);
|
code = extractNodeEpset(pMnode, &epset, &hasEpset, pTask->id.taskId, pTask->info.nodeId);
|
||||||
if (code != TSDB_CODE_SUCCESS || !hasEpset) {
|
if (code != TSDB_CODE_SUCCESS || !hasEpset) {
|
||||||
mError("failed to extract epset during create update epset, code:%s", tstrerror(code));
|
mError("failed to extract epset during create update epset, code:%s", tstrerror(code));
|
||||||
|
taosMemoryFree(pBuf);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -237,7 +237,7 @@ static int32_t addTimezoneParam(SNodeList* pList) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
varDataSetLen(pVal->datum.p, len);
|
varDataSetLen(pVal->datum.p, len);
|
||||||
(void)strncpy(varDataVal(pVal->datum.p), pVal->literal, len);
|
tstrncpy(varDataVal(pVal->datum.p), pVal->literal, len + 1);
|
||||||
|
|
||||||
code = nodesListAppend(pList, (SNode*)pVal);
|
code = nodesListAppend(pList, (SNode*)pVal);
|
||||||
if (TSDB_CODE_SUCCESS != code) {
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
|
|
|
@ -4970,10 +4970,10 @@ int32_t histogramFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
|
||||||
int32_t len;
|
int32_t len;
|
||||||
char buf[512] = {0};
|
char buf[512] = {0};
|
||||||
if (!pInfo->normalized) {
|
if (!pInfo->normalized) {
|
||||||
len = sprintf(varDataVal(buf), "{\"lower_bin\":%g, \"upper_bin\":%g, \"count\":%" PRId64 "}",
|
len = snprintf(varDataVal(buf), sizeof(buf) - VARSTR_HEADER_SIZE, "{\"lower_bin\":%g, \"upper_bin\":%g, \"count\":%" PRId64 "}",
|
||||||
pInfo->bins[i].lower, pInfo->bins[i].upper, pInfo->bins[i].count);
|
pInfo->bins[i].lower, pInfo->bins[i].upper, pInfo->bins[i].count);
|
||||||
} else {
|
} else {
|
||||||
len = sprintf(varDataVal(buf), "{\"lower_bin\":%g, \"upper_bin\":%g, \"count\":%lf}", pInfo->bins[i].lower,
|
len = snprintf(varDataVal(buf), sizeof(buf) - VARSTR_HEADER_SIZE, "{\"lower_bin\":%g, \"upper_bin\":%g, \"count\":%lf}", pInfo->bins[i].lower,
|
||||||
pInfo->bins[i].upper, pInfo->bins[i].percentage);
|
pInfo->bins[i].upper, pInfo->bins[i].percentage);
|
||||||
}
|
}
|
||||||
varDataSetLen(buf, len);
|
varDataSetLen(buf, len);
|
||||||
|
@ -6601,7 +6601,7 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
|
||||||
compRatio = pData->totalSize * 100 / (double)totalRawSize;
|
compRatio = pData->totalSize * 100 / (double)totalRawSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t len = sprintf(st + VARSTR_HEADER_SIZE,
|
int32_t len = snprintf(varDataVal(st), sizeof(st) - VARSTR_HEADER_SIZE,
|
||||||
"Total_Blocks=[%d] Total_Size=[%.2f KiB] Average_size=[%.2f KiB] Compression_Ratio=[%.2f %c]",
|
"Total_Blocks=[%d] Total_Size=[%.2f KiB] Average_size=[%.2f KiB] Compression_Ratio=[%.2f %c]",
|
||||||
pData->numOfBlocks, pData->totalSize / 1024.0, averageSize / 1024.0, compRatio, '%');
|
pData->numOfBlocks, pData->totalSize / 1024.0, averageSize / 1024.0, compRatio, '%');
|
||||||
|
|
||||||
|
@ -6616,7 +6616,7 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
|
||||||
avgRows = pData->totalRows / pData->numOfBlocks;
|
avgRows = pData->totalRows / pData->numOfBlocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = sprintf(st + VARSTR_HEADER_SIZE, "Block_Rows=[%" PRId64 "] MinRows=[%d] MaxRows=[%d] AvgRows=[%" PRId64 "]",
|
len = snprintf(varDataVal(st), sizeof(st) - VARSTR_HEADER_SIZE, "Block_Rows=[%" PRId64 "] MinRows=[%d] MaxRows=[%d] AvgRows=[%" PRId64 "]",
|
||||||
pData->totalRows, pData->minRows, pData->maxRows, avgRows);
|
pData->totalRows, pData->minRows, pData->maxRows, avgRows);
|
||||||
varDataSetLen(st, len);
|
varDataSetLen(st, len);
|
||||||
code = colDataSetVal(pColInfo, row++, st, false);
|
code = colDataSetVal(pColInfo, row++, st, false);
|
||||||
|
@ -6624,14 +6624,14 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = sprintf(st + VARSTR_HEADER_SIZE, "Inmem_Rows=[%d] Stt_Rows=[%d] ", pData->numOfInmemRows, pData->numOfSttRows);
|
len = snprintf(varDataVal(st), sizeof(st) - VARSTR_HEADER_SIZE, "Inmem_Rows=[%d] Stt_Rows=[%d] ", pData->numOfInmemRows, pData->numOfSttRows);
|
||||||
varDataSetLen(st, len);
|
varDataSetLen(st, len);
|
||||||
code = colDataSetVal(pColInfo, row++, st, false);
|
code = colDataSetVal(pColInfo, row++, st, false);
|
||||||
if (TSDB_CODE_SUCCESS != code) {
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = sprintf(st + VARSTR_HEADER_SIZE, "Total_Tables=[%d] Total_Filesets=[%d] Total_Vgroups=[%d]", pData->numOfTables,
|
len = snprintf(varDataVal(st), sizeof(st) - VARSTR_HEADER_SIZE, "Total_Tables=[%d] Total_Filesets=[%d] Total_Vgroups=[%d]", pData->numOfTables,
|
||||||
pData->numOfFiles, pData->numOfVgroups);
|
pData->numOfFiles, pData->numOfVgroups);
|
||||||
|
|
||||||
varDataSetLen(st, len);
|
varDataSetLen(st, len);
|
||||||
|
@ -6640,7 +6640,7 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = sprintf(st + VARSTR_HEADER_SIZE,
|
len = snprintf(varDataVal(st), sizeof(st) - VARSTR_HEADER_SIZE,
|
||||||
"--------------------------------------------------------------------------------");
|
"--------------------------------------------------------------------------------");
|
||||||
varDataSetLen(st, len);
|
varDataSetLen(st, len);
|
||||||
code = colDataSetVal(pColInfo, row++, st, false);
|
code = colDataSetVal(pColInfo, row++, st, false);
|
||||||
|
@ -6667,7 +6667,7 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
|
||||||
int32_t bucketRange = ceil(((double) (pData->defMaxRows - pData->defMinRows)) / numOfBuckets);
|
int32_t bucketRange = ceil(((double) (pData->defMaxRows - pData->defMinRows)) / numOfBuckets);
|
||||||
|
|
||||||
for (int32_t i = 0; i < tListLen(pData->blockRowsHisto); ++i) {
|
for (int32_t i = 0; i < tListLen(pData->blockRowsHisto); ++i) {
|
||||||
len = sprintf(st + VARSTR_HEADER_SIZE, "%04d |", pData->defMinRows + bucketRange * (i + 1));
|
len = snprintf(varDataVal(st), sizeof(st) - VARSTR_HEADER_SIZE, "%04d |", pData->defMinRows + bucketRange * (i + 1));
|
||||||
|
|
||||||
int32_t num = 0;
|
int32_t num = 0;
|
||||||
if (pData->blockRowsHisto[i] > 0) {
|
if (pData->blockRowsHisto[i] > 0) {
|
||||||
|
@ -6675,13 +6675,13 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t j = 0; j < num; ++j) {
|
for (int32_t j = 0; j < num; ++j) {
|
||||||
int32_t x = sprintf(st + VARSTR_HEADER_SIZE + len, "%c", '|');
|
int32_t x = snprintf(varDataVal(st) + len, sizeof(st) - VARSTR_HEADER_SIZE - len, "%c", '|');
|
||||||
len += x;
|
len += x;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pData->blockRowsHisto[i] > 0) {
|
if (pData->blockRowsHisto[i] > 0) {
|
||||||
double v = pData->blockRowsHisto[i] * 100.0 / pData->numOfBlocks;
|
double v = pData->blockRowsHisto[i] * 100.0 / pData->numOfBlocks;
|
||||||
len += sprintf(st + VARSTR_HEADER_SIZE + len, " %d (%.2f%c)", pData->blockRowsHisto[i], v, '%');
|
len += snprintf(varDataVal(st) + len, sizeof(st) - VARSTR_HEADER_SIZE - len, " %d (%.2f%c)", pData->blockRowsHisto[i], v, '%');
|
||||||
}
|
}
|
||||||
|
|
||||||
varDataSetLen(st, len);
|
varDataSetLen(st, len);
|
||||||
|
|
|
@ -408,7 +408,7 @@ static int32_t createColumnByFunc(const SFunctionNode* pFunc, SColumnNode** ppCo
|
||||||
if (NULL == *ppCol) {
|
if (NULL == *ppCol) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
(void)strcpy((*ppCol)->colName, pFunc->node.aliasName);
|
tstrncpy((*ppCol)->colName, pFunc->node.aliasName, TSDB_COL_NAME_LEN);
|
||||||
(*ppCol)->node.resType = pFunc->node.resType;
|
(*ppCol)->node.resType = pFunc->node.resType;
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -437,11 +437,12 @@ static int32_t createPartialFunction(const SFunctionNode* pSrcFunc, SFunctionNod
|
||||||
(*pPartialFunc)->hasOriginalFunc = true;
|
(*pPartialFunc)->hasOriginalFunc = true;
|
||||||
(*pPartialFunc)->originalFuncId = pSrcFunc->hasOriginalFunc ? pSrcFunc->originalFuncId : pSrcFunc->funcId;
|
(*pPartialFunc)->originalFuncId = pSrcFunc->hasOriginalFunc ? pSrcFunc->originalFuncId : pSrcFunc->funcId;
|
||||||
char name[TSDB_FUNC_NAME_LEN + TSDB_NAME_DELIMITER_LEN + TSDB_POINTER_PRINT_BYTES + 1] = {0};
|
char name[TSDB_FUNC_NAME_LEN + TSDB_NAME_DELIMITER_LEN + TSDB_POINTER_PRINT_BYTES + 1] = {0};
|
||||||
int32_t len = tsnprintf(name, sizeof(name) - 1, "%s.%p", (*pPartialFunc)->functionName, pSrcFunc);
|
|
||||||
|
int32_t len = tsnprintf(name, sizeof(name), "%s.%p", (*pPartialFunc)->functionName, pSrcFunc);
|
||||||
if (taosHashBinary(name, len) < 0) {
|
if (taosHashBinary(name, len) < 0) {
|
||||||
return TSDB_CODE_FAILED;
|
return TSDB_CODE_FAILED;
|
||||||
}
|
}
|
||||||
(void)strncpy((*pPartialFunc)->node.aliasName, name, TSDB_COL_NAME_LEN - 1);
|
tstrncpy((*pPartialFunc)->node.aliasName, name, TSDB_COL_NAME_LEN);
|
||||||
(*pPartialFunc)->hasPk = pSrcFunc->hasPk;
|
(*pPartialFunc)->hasPk = pSrcFunc->hasPk;
|
||||||
(*pPartialFunc)->pkBytes = pSrcFunc->pkBytes;
|
(*pPartialFunc)->pkBytes = pSrcFunc->pkBytes;
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -475,7 +476,7 @@ static int32_t createMidFunction(const SFunctionNode* pSrcFunc, const SFunctionN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
(void)strcpy(pFunc->node.aliasName, pPartialFunc->node.aliasName);
|
tstrncpy(pFunc->node.aliasName, pPartialFunc->node.aliasName, TSDB_COL_NAME_LEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
@ -504,7 +505,7 @@ static int32_t createMergeFunction(const SFunctionNode* pSrcFunc, const SFunctio
|
||||||
if (fmIsSameInOutType(pSrcFunc->funcId)) {
|
if (fmIsSameInOutType(pSrcFunc->funcId)) {
|
||||||
pFunc->node.resType = pSrcFunc->node.resType;
|
pFunc->node.resType = pSrcFunc->node.resType;
|
||||||
}
|
}
|
||||||
(void)strcpy(pFunc->node.aliasName, pSrcFunc->node.aliasName);
|
tstrncpy(pFunc->node.aliasName, pSrcFunc->node.aliasName, TSDB_COL_NAME_LEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
@ -558,8 +559,8 @@ static int32_t fmCreateStateFunc(const SFunctionNode* pFunc, SFunctionNode** pSt
|
||||||
nodesDestroyList(pParams);
|
nodesDestroyList(pParams);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
(void)strcpy((*pStateFunc)->node.aliasName, pFunc->node.aliasName);
|
tstrncpy((*pStateFunc)->node.aliasName, pFunc->node.aliasName, TSDB_COL_NAME_LEN);
|
||||||
(void)strcpy((*pStateFunc)->node.userAlias, pFunc->node.userAlias);
|
tstrncpy((*pStateFunc)->node.userAlias, pFunc->node.userAlias, TSDB_COL_NAME_LEN);
|
||||||
}
|
}
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -605,8 +606,8 @@ static int32_t fmCreateStateMergeFunc(SFunctionNode* pFunc, SFunctionNode** pSta
|
||||||
nodesDestroyList(pParams);
|
nodesDestroyList(pParams);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
(void)strcpy((*pStateMergeFunc)->node.aliasName, pFunc->node.aliasName);
|
tstrncpy((*pStateMergeFunc)->node.aliasName, pFunc->node.aliasName, TSDB_COL_NAME_LEN);
|
||||||
(void)strcpy((*pStateMergeFunc)->node.userAlias, pFunc->node.userAlias);
|
tstrncpy((*pStateMergeFunc)->node.userAlias, pFunc->node.userAlias, TSDB_COL_NAME_LEN);
|
||||||
}
|
}
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ void taosValueToLuaType(lua_State *lua, int32_t type, char *val) {
|
||||||
int taosLoadScriptInit(void* pInit) {
|
int taosLoadScriptInit(void* pInit) {
|
||||||
ScriptCtx *pCtx = pInit;
|
ScriptCtx *pCtx = pInit;
|
||||||
char funcName[MAX_FUNC_NAME] = {0};
|
char funcName[MAX_FUNC_NAME] = {0};
|
||||||
sprintf(funcName, "%s_init", pCtx->funcName);
|
snprintf(funcName, MAX_FUNC_NAME, "%s_init", pCtx->funcName);
|
||||||
|
|
||||||
lua_State* lua = pCtx->pEnv->lua_state;
|
lua_State* lua = pCtx->pEnv->lua_state;
|
||||||
lua_getglobal(lua, funcName);
|
lua_getglobal(lua, funcName);
|
||||||
|
@ -106,7 +106,7 @@ void taosLoadScriptNormal(void *pInit, char *pInput, int16_t iType, int16_t iByt
|
||||||
int64_t *ptsList, int64_t key, char* pOutput, char *ptsOutput, int32_t *numOfOutput, int16_t oType, int16_t oBytes) {
|
int64_t *ptsList, int64_t key, char* pOutput, char *ptsOutput, int32_t *numOfOutput, int16_t oType, int16_t oBytes) {
|
||||||
ScriptCtx* pCtx = pInit;
|
ScriptCtx* pCtx = pInit;
|
||||||
char funcName[MAX_FUNC_NAME] = {0};
|
char funcName[MAX_FUNC_NAME] = {0};
|
||||||
sprintf(funcName, "%s_add", pCtx->funcName);
|
snprintf(funcName, MAX_FUNC_NAME, "%s_add", pCtx->funcName);
|
||||||
|
|
||||||
lua_State* lua = pCtx->pEnv->lua_state;
|
lua_State* lua = pCtx->pEnv->lua_state;
|
||||||
lua_getglobal(lua, funcName);
|
lua_getglobal(lua, funcName);
|
||||||
|
@ -143,7 +143,7 @@ void taosLoadScriptNormal(void *pInit, char *pInput, int16_t iType, int16_t iByt
|
||||||
void taosLoadScriptMerge(void *pInit, char* data, int32_t numOfRows, char* pOutput, int32_t* numOfOutput) {
|
void taosLoadScriptMerge(void *pInit, char* data, int32_t numOfRows, char* pOutput, int32_t* numOfOutput) {
|
||||||
ScriptCtx *pCtx = pInit;
|
ScriptCtx *pCtx = pInit;
|
||||||
char funcName[MAX_FUNC_NAME] = {0};
|
char funcName[MAX_FUNC_NAME] = {0};
|
||||||
sprintf(funcName, "%s_merge", pCtx->funcName);
|
snprintf(funcName, MAX_FUNC_NAME, "%s_merge", pCtx->funcName);
|
||||||
|
|
||||||
lua_State* lua = pCtx->pEnv->lua_state;
|
lua_State* lua = pCtx->pEnv->lua_state;
|
||||||
lua_getglobal(lua, funcName);
|
lua_getglobal(lua, funcName);
|
||||||
|
@ -167,7 +167,7 @@ void taosLoadScriptMerge(void *pInit, char* data, int32_t numOfRows, char* pOutp
|
||||||
void taosLoadScriptFinalize(void *pInit,int64_t key, char *pOutput, int32_t* numOfOutput) {
|
void taosLoadScriptFinalize(void *pInit,int64_t key, char *pOutput, int32_t* numOfOutput) {
|
||||||
ScriptCtx *pCtx = pInit;
|
ScriptCtx *pCtx = pInit;
|
||||||
char funcName[MAX_FUNC_NAME] = {0};
|
char funcName[MAX_FUNC_NAME] = {0};
|
||||||
sprintf(funcName, "%s_finalize", pCtx->funcName);
|
snprintf(funcName, MAX_FUNC_NAME, "%s_finalize", pCtx->funcName);
|
||||||
|
|
||||||
lua_State* lua = pCtx->pEnv->lua_state;
|
lua_State* lua = pCtx->pEnv->lua_state;
|
||||||
lua_getglobal(lua, funcName);
|
lua_getglobal(lua, funcName);
|
||||||
|
|
|
@ -1764,41 +1764,41 @@ _return:
|
||||||
return DEAL_RES_ERROR;
|
return DEAL_RES_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t fltConverToStr(char *str, int type, void *buf, int32_t bufSize, int32_t *len) {
|
int32_t fltConverToStr(char *str, int32_t strMaxLen, int type, void *buf, int32_t bufSize, int32_t *len) {
|
||||||
int32_t n = 0;
|
int32_t n = 0;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TSDB_DATA_TYPE_NULL:
|
case TSDB_DATA_TYPE_NULL:
|
||||||
n = sprintf(str, "null");
|
n = snprintf(str, strMaxLen, "null");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_BOOL:
|
case TSDB_DATA_TYPE_BOOL:
|
||||||
n = sprintf(str, (*(int8_t *)buf) ? "true" : "false");
|
n = snprintf(str, strMaxLen, (*(int8_t *)buf) ? "true" : "false");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_TINYINT:
|
case TSDB_DATA_TYPE_TINYINT:
|
||||||
n = sprintf(str, "%d", *(int8_t *)buf);
|
n = snprintf(str, strMaxLen, "%d", *(int8_t *)buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_SMALLINT:
|
case TSDB_DATA_TYPE_SMALLINT:
|
||||||
n = sprintf(str, "%d", *(int16_t *)buf);
|
n = snprintf(str, strMaxLen, "%d", *(int16_t *)buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_INT:
|
case TSDB_DATA_TYPE_INT:
|
||||||
n = sprintf(str, "%d", *(int32_t *)buf);
|
n = snprintf(str, strMaxLen, "%d", *(int32_t *)buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_BIGINT:
|
case TSDB_DATA_TYPE_BIGINT:
|
||||||
case TSDB_DATA_TYPE_TIMESTAMP:
|
case TSDB_DATA_TYPE_TIMESTAMP:
|
||||||
n = sprintf(str, "%" PRId64, *(int64_t *)buf);
|
n = snprintf(str, strMaxLen, "%" PRId64, *(int64_t *)buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_FLOAT:
|
case TSDB_DATA_TYPE_FLOAT:
|
||||||
n = sprintf(str, "%e", GET_FLOAT_VAL(buf));
|
n = snprintf(str, strMaxLen, "%e", GET_FLOAT_VAL(buf));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_DOUBLE:
|
case TSDB_DATA_TYPE_DOUBLE:
|
||||||
n = sprintf(str, "%e", GET_DOUBLE_VAL(buf));
|
n = snprintf(str, strMaxLen, "%e", GET_DOUBLE_VAL(buf));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_BINARY:
|
case TSDB_DATA_TYPE_BINARY:
|
||||||
|
@ -1817,19 +1817,19 @@ int32_t fltConverToStr(char *str, int type, void *buf, int32_t bufSize, int32_t
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_UTINYINT:
|
case TSDB_DATA_TYPE_UTINYINT:
|
||||||
n = sprintf(str, "%d", *(uint8_t *)buf);
|
n = snprintf(str, strMaxLen, "%d", *(uint8_t *)buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_USMALLINT:
|
case TSDB_DATA_TYPE_USMALLINT:
|
||||||
n = sprintf(str, "%d", *(uint16_t *)buf);
|
n = snprintf(str, strMaxLen, "%d", *(uint16_t *)buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_UINT:
|
case TSDB_DATA_TYPE_UINT:
|
||||||
n = sprintf(str, "%u", *(uint32_t *)buf);
|
n = snprintf(str, strMaxLen, "%u", *(uint32_t *)buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_UBIGINT:
|
case TSDB_DATA_TYPE_UBIGINT:
|
||||||
n = sprintf(str, "%" PRIu64, *(uint64_t *)buf);
|
n = snprintf(str, strMaxLen, "%" PRIu64, *(uint64_t *)buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -1886,8 +1886,8 @@ int32_t filterDumpInfoToString(SFilterInfo *info, const char *msg, int32_t optio
|
||||||
SFilterField *left = FILTER_UNIT_LEFT_FIELD(info, unit);
|
SFilterField *left = FILTER_UNIT_LEFT_FIELD(info, unit);
|
||||||
SColumnNode *refNode = (SColumnNode *)left->desc;
|
SColumnNode *refNode = (SColumnNode *)left->desc;
|
||||||
if (unit->compare.optr <= OP_TYPE_JSON_CONTAINS) {
|
if (unit->compare.optr <= OP_TYPE_JSON_CONTAINS) {
|
||||||
len = sprintf(str, "UNIT[%d] => [%d][%d] %s [", i, refNode->dataBlockId, refNode->slotId,
|
len += snprintf(str, sizeof(str), "UNIT[%d] => [%d][%d] %s [", i, refNode->dataBlockId, refNode->slotId,
|
||||||
operatorTypeStr(unit->compare.optr));
|
operatorTypeStr(unit->compare.optr));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unit->right.type == FLD_TYPE_VALUE && FILTER_UNIT_OPTR(unit) != OP_TYPE_IN) {
|
if (unit->right.type == FLD_TYPE_VALUE && FILTER_UNIT_OPTR(unit) != OP_TYPE_IN) {
|
||||||
|
@ -1898,18 +1898,22 @@ int32_t filterDumpInfoToString(SFilterInfo *info, const char *msg, int32_t optio
|
||||||
data += VARSTR_HEADER_SIZE;
|
data += VARSTR_HEADER_SIZE;
|
||||||
}
|
}
|
||||||
if (data) {
|
if (data) {
|
||||||
FLT_ERR_RET(fltConverToStr(str + len, type, data, tlen > 32 ? 32 : tlen, &tlen));
|
FLT_ERR_RET(fltConverToStr(str + len, sizeof(str) - len, type, data, tlen > 32 ? 32 : tlen, &tlen));
|
||||||
|
len += tlen;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
(void)strcat(str, "NULL");
|
(void)strncat(str, "NULL", sizeof(str) - len - 1);
|
||||||
|
len += 4;
|
||||||
}
|
}
|
||||||
(void)strcat(str, "]");
|
(void)strncat(str, "]", sizeof(str) - len - 1);
|
||||||
|
len += 1;
|
||||||
|
|
||||||
if (unit->compare.optr2) {
|
if (unit->compare.optr2) {
|
||||||
(void)strcat(str, " && ");
|
(void)strncat(str, " && ", sizeof(str) - len - 1);
|
||||||
|
len += 4;
|
||||||
if (unit->compare.optr2 <= OP_TYPE_JSON_CONTAINS) {
|
if (unit->compare.optr2 <= OP_TYPE_JSON_CONTAINS) {
|
||||||
(void)sprintf(str + strlen(str), "[%d][%d] %s [", refNode->dataBlockId, refNode->slotId,
|
len += snprintf(str + len, sizeof(str) - len, "[%d][%d] %s [", refNode->dataBlockId,
|
||||||
operatorTypeStr(unit->compare.optr2));
|
refNode->slotId, operatorTypeStr(unit->compare.optr2));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unit->right2.type == FLD_TYPE_VALUE && FILTER_UNIT_OPTR(unit) != OP_TYPE_IN) {
|
if (unit->right2.type == FLD_TYPE_VALUE && FILTER_UNIT_OPTR(unit) != OP_TYPE_IN) {
|
||||||
|
@ -1919,11 +1923,14 @@ int32_t filterDumpInfoToString(SFilterInfo *info, const char *msg, int32_t optio
|
||||||
tlen = varDataLen(data);
|
tlen = varDataLen(data);
|
||||||
data += VARSTR_HEADER_SIZE;
|
data += VARSTR_HEADER_SIZE;
|
||||||
}
|
}
|
||||||
FLT_ERR_RET(fltConverToStr(str + strlen(str), type, data, tlen > 32 ? 32 : tlen, &tlen));
|
FLT_ERR_RET(fltConverToStr(str + len, sizeof(str) - len, type, data, tlen > 32 ? 32 : tlen, &tlen));
|
||||||
|
len += tlen;
|
||||||
} else {
|
} else {
|
||||||
(void)strcat(str, "NULL");
|
(void)strncat(str, "NULL", sizeof(str) - len - 1);
|
||||||
|
len += 4;
|
||||||
}
|
}
|
||||||
(void)strcat(str, "]");
|
(void)strncat(str, "]", sizeof(str) - len - 1);
|
||||||
|
len += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug("%s", str); // TODO
|
qDebug("%s", str); // TODO
|
||||||
|
@ -1955,21 +1962,39 @@ int32_t filterDumpInfoToString(SFilterInfo *info, const char *msg, int32_t optio
|
||||||
SFilterRangeNode *r = ctx->rs;
|
SFilterRangeNode *r = ctx->rs;
|
||||||
int32_t tlen = 0;
|
int32_t tlen = 0;
|
||||||
while (r) {
|
while (r) {
|
||||||
char str[256] = {0};
|
char str[256] = {0};
|
||||||
|
int32_t len = 0;
|
||||||
if (FILTER_GET_FLAG(r->ra.sflag, RANGE_FLG_NULL)) {
|
if (FILTER_GET_FLAG(r->ra.sflag, RANGE_FLG_NULL)) {
|
||||||
(void)strcat(str, "(NULL)");
|
(void)strncat(str, "(NULL)", sizeof(str) - len - 1);
|
||||||
|
len += 6;
|
||||||
} else {
|
} else {
|
||||||
FILTER_GET_FLAG(r->ra.sflag, RANGE_FLG_EXCLUDE) ? strcat(str, "(") : strcat(str, "[");
|
FILTER_GET_FLAG(r->ra.sflag, RANGE_FLG_EXCLUDE) ?
|
||||||
FLT_ERR_RET(fltConverToStr(str + strlen(str), ctx->type, &r->ra.s, tlen > 32 ? 32 : tlen, &tlen));
|
(void)strncat(str, "(", sizeof(str) - len - 1) :
|
||||||
FILTER_GET_FLAG(r->ra.sflag, RANGE_FLG_EXCLUDE) ? strcat(str, ")") : strcat(str, "]");
|
(void)strncat(str, "[", sizeof(str) - len - 1);
|
||||||
|
len += 1;
|
||||||
|
FLT_ERR_RET(fltConverToStr(str + len, sizeof(str) - len, ctx->type, &r->ra.s, tlen > 32 ? 32 : tlen, &tlen));
|
||||||
|
len += tlen;
|
||||||
|
FILTER_GET_FLAG(r->ra.sflag, RANGE_FLG_EXCLUDE) ?
|
||||||
|
(void)strncat(str, ")", sizeof(str) - len - 1) :
|
||||||
|
(void)strncat(str, "]", sizeof(str) - len - 1);
|
||||||
|
len += 1;
|
||||||
}
|
}
|
||||||
(void)strcat(str, " - ");
|
(void)strncat(str, " - ", sizeof(str) - len - 1);
|
||||||
|
len += 3;
|
||||||
if (FILTER_GET_FLAG(r->ra.eflag, RANGE_FLG_NULL)) {
|
if (FILTER_GET_FLAG(r->ra.eflag, RANGE_FLG_NULL)) {
|
||||||
(void)strcat(str, "(NULL)");
|
(void)strncat(str, "(NULL)", sizeof(str) - len - 1);
|
||||||
|
len += 6;
|
||||||
} else {
|
} else {
|
||||||
FILTER_GET_FLAG(r->ra.eflag, RANGE_FLG_EXCLUDE) ? strcat(str, "(") : strcat(str, "[");
|
FILTER_GET_FLAG(r->ra.eflag, RANGE_FLG_EXCLUDE) ?
|
||||||
FLT_ERR_RET(fltConverToStr(str + strlen(str), ctx->type, &r->ra.e, tlen > 32 ? 32 : tlen, &tlen));
|
(void)strncat(str, "(", sizeof(str) - len - 1) :
|
||||||
FILTER_GET_FLAG(r->ra.eflag, RANGE_FLG_EXCLUDE) ? strcat(str, ")") : strcat(str, "]");
|
(void)strncat(str, "[", sizeof(str) - len - 1);
|
||||||
|
len += 1;
|
||||||
|
FLT_ERR_RET(fltConverToStr(str + len, sizeof(str) - len, ctx->type, &r->ra.e, tlen > 32 ? 32 : tlen, &tlen));
|
||||||
|
len += tlen;
|
||||||
|
FILTER_GET_FLAG(r->ra.eflag, RANGE_FLG_EXCLUDE) ?
|
||||||
|
(void)strncat(str, ")", sizeof(str) - len - 1) :
|
||||||
|
(void)strncat(str, "]", sizeof(str) - len - 1);
|
||||||
|
len += 1;
|
||||||
}
|
}
|
||||||
qDebug("range: %s", str);
|
qDebug("range: %s", str);
|
||||||
|
|
||||||
|
|
|
@ -1211,7 +1211,7 @@ EDealRes sclRewriteFunction(SNode **pNode, SScalarCtx *ctx) {
|
||||||
|
|
||||||
res->translate = true;
|
res->translate = true;
|
||||||
|
|
||||||
(void)strcpy(res->node.aliasName, node->node.aliasName);
|
tstrncpy(res->node.aliasName, node->node.aliasName, TSDB_COL_NAME_LEN);
|
||||||
res->node.resType.type = output.columnData->info.type;
|
res->node.resType.type = output.columnData->info.type;
|
||||||
res->node.resType.bytes = output.columnData->info.bytes;
|
res->node.resType.bytes = output.columnData->info.bytes;
|
||||||
res->node.resType.scale = output.columnData->info.scale;
|
res->node.resType.scale = output.columnData->info.scale;
|
||||||
|
@ -1286,7 +1286,7 @@ EDealRes sclRewriteLogic(SNode **pNode, SScalarCtx *ctx) {
|
||||||
res->node.resType = node->node.resType;
|
res->node.resType = node->node.resType;
|
||||||
res->translate = true;
|
res->translate = true;
|
||||||
|
|
||||||
(void)strcpy(res->node.aliasName, node->node.aliasName);
|
tstrncpy(res->node.aliasName, node->node.aliasName, TSDB_COL_NAME_LEN);
|
||||||
int32_t type = output.columnData->info.type;
|
int32_t type = output.columnData->info.type;
|
||||||
if (IS_VAR_DATA_TYPE(type)) {
|
if (IS_VAR_DATA_TYPE(type)) {
|
||||||
res->datum.p = output.columnData->pData;
|
res->datum.p = output.columnData->pData;
|
||||||
|
@ -1356,7 +1356,7 @@ EDealRes sclRewriteOperator(SNode **pNode, SScalarCtx *ctx) {
|
||||||
|
|
||||||
res->translate = true;
|
res->translate = true;
|
||||||
|
|
||||||
(void)strcpy(res->node.aliasName, node->node.aliasName);
|
tstrncpy(res->node.aliasName, node->node.aliasName, TSDB_COL_NAME_LEN);
|
||||||
res->node.resType = node->node.resType;
|
res->node.resType = node->node.resType;
|
||||||
if (colDataIsNull_s(output.columnData, 0)) {
|
if (colDataIsNull_s(output.columnData, 0)) {
|
||||||
res->isNull = true;
|
res->isNull = true;
|
||||||
|
@ -1419,7 +1419,7 @@ EDealRes sclRewriteCaseWhen(SNode **pNode, SScalarCtx *ctx) {
|
||||||
|
|
||||||
res->translate = true;
|
res->translate = true;
|
||||||
|
|
||||||
(void)strcpy(res->node.aliasName, node->node.aliasName);
|
tstrncpy(res->node.aliasName, node->node.aliasName, TSDB_COL_NAME_LEN);
|
||||||
res->node.resType = node->node.resType;
|
res->node.resType = node->node.resType;
|
||||||
if (colDataIsNull_s(output.columnData, 0)) {
|
if (colDataIsNull_s(output.columnData, 0)) {
|
||||||
res->isNull = true;
|
res->isNull = true;
|
||||||
|
|
|
@ -2067,9 +2067,9 @@ int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutp
|
||||||
case TSDB_DATA_TYPE_BINARY:
|
case TSDB_DATA_TYPE_BINARY:
|
||||||
case TSDB_DATA_TYPE_GEOMETRY: {
|
case TSDB_DATA_TYPE_GEOMETRY: {
|
||||||
if (inputType == TSDB_DATA_TYPE_BOOL) {
|
if (inputType == TSDB_DATA_TYPE_BOOL) {
|
||||||
// NOTE: sprintf will append '\0' at the end of string
|
// NOTE: snprintf will append '\0' at the end of string
|
||||||
int32_t len = sprintf(varDataVal(output), "%.*s", (int32_t)(outputLen - VARSTR_HEADER_SIZE),
|
int32_t len = snprintf(varDataVal(output), outputLen + TSDB_NCHAR_SIZE - VARSTR_HEADER_SIZE, "%.*s",
|
||||||
*(int8_t *)input ? "true" : "false");
|
(int32_t)(outputLen - VARSTR_HEADER_SIZE), *(int8_t *)input ? "true" : "false");
|
||||||
varDataSetLen(output, len);
|
varDataSetLen(output, len);
|
||||||
} else if (inputType == TSDB_DATA_TYPE_BINARY) {
|
} else if (inputType == TSDB_DATA_TYPE_BINARY) {
|
||||||
int32_t len = TMIN(varDataLen(input), outputLen - VARSTR_HEADER_SIZE);
|
int32_t len = TMIN(varDataLen(input), outputLen - VARSTR_HEADER_SIZE);
|
||||||
|
@ -2109,7 +2109,7 @@ int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutp
|
||||||
int32_t len;
|
int32_t len;
|
||||||
if (inputType == TSDB_DATA_TYPE_BOOL) {
|
if (inputType == TSDB_DATA_TYPE_BOOL) {
|
||||||
char tmp[8] = {0};
|
char tmp[8] = {0};
|
||||||
len = sprintf(tmp, "%.*s", outputCharLen, *(int8_t *)input ? "true" : "false");
|
len = snprintf(tmp, sizeof(tmp), "%.*s", outputCharLen, *(int8_t *)input ? "true" : "false");
|
||||||
bool ret = taosMbsToUcs4(tmp, len, (TdUcs4 *)varDataVal(output), outputLen - VARSTR_HEADER_SIZE, &len);
|
bool ret = taosMbsToUcs4(tmp, len, (TdUcs4 *)varDataVal(output), outputLen - VARSTR_HEADER_SIZE, &len);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
code = TSDB_CODE_SCALAR_CONVERT_ERROR;
|
code = TSDB_CODE_SCALAR_CONVERT_ERROR;
|
||||||
|
@ -4411,11 +4411,11 @@ int32_t histogramScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarP
|
||||||
int32_t len;
|
int32_t len;
|
||||||
char buf[512] = {0};
|
char buf[512] = {0};
|
||||||
if (!normalized) {
|
if (!normalized) {
|
||||||
len = sprintf(varDataVal(buf), "{\"lower_bin\":%g, \"upper_bin\":%g, \"count\":%" PRId64 "}", bins[k].lower,
|
len = snprintf(varDataVal(buf), sizeof(buf) - VARSTR_HEADER_SIZE, "{\"lower_bin\":%g, \"upper_bin\":%g, \"count\":%" PRId64 "}",
|
||||||
bins[k].upper, bins[k].count);
|
bins[k].lower, bins[k].upper, bins[k].count);
|
||||||
} else {
|
} else {
|
||||||
len = sprintf(varDataVal(buf), "{\"lower_bin\":%g, \"upper_bin\":%g, \"count\":%lf}", bins[k].lower,
|
len = snprintf(varDataVal(buf), sizeof(buf) - VARSTR_HEADER_SIZE, "{\"lower_bin\":%g, \"upper_bin\":%g, \"count\":%lf}",
|
||||||
bins[k].upper, bins[k].percentage);
|
bins[k].lower, bins[k].upper, bins[k].percentage);
|
||||||
}
|
}
|
||||||
varDataSetLen(buf, len);
|
varDataSetLen(buf, len);
|
||||||
SCL_ERR_JRET(colDataSetVal(pOutputData, k, buf, false));
|
SCL_ERR_JRET(colDataSetVal(pOutputData, k, buf, false));
|
||||||
|
|
|
@ -734,7 +734,7 @@ int32_t vectorConvertToVarData(SSclVectorConvCtx *pCtx) {
|
||||||
|
|
||||||
int64_t value = 0;
|
int64_t value = 0;
|
||||||
GET_TYPED_DATA(value, int64_t, pCtx->inType, colDataGetData(pInputCol, i));
|
GET_TYPED_DATA(value, int64_t, pCtx->inType, colDataGetData(pInputCol, i));
|
||||||
int32_t len = sprintf(varDataVal(tmp), "%" PRId64, value);
|
int32_t len = snprintf(varDataVal(tmp), sizeof(tmp) - VARSTR_HEADER_SIZE, "%" PRId64, value);
|
||||||
varDataLen(tmp) = len;
|
varDataLen(tmp) = len;
|
||||||
if (pCtx->outType == TSDB_DATA_TYPE_NCHAR) {
|
if (pCtx->outType == TSDB_DATA_TYPE_NCHAR) {
|
||||||
SCL_ERR_RET(varToNchar(tmp, pCtx->pOut, i, NULL));
|
SCL_ERR_RET(varToNchar(tmp, pCtx->pOut, i, NULL));
|
||||||
|
@ -751,7 +751,7 @@ int32_t vectorConvertToVarData(SSclVectorConvCtx *pCtx) {
|
||||||
|
|
||||||
uint64_t value = 0;
|
uint64_t value = 0;
|
||||||
GET_TYPED_DATA(value, uint64_t, pCtx->inType, colDataGetData(pInputCol, i));
|
GET_TYPED_DATA(value, uint64_t, pCtx->inType, colDataGetData(pInputCol, i));
|
||||||
int32_t len = sprintf(varDataVal(tmp), "%" PRIu64, value);
|
int32_t len = snprintf(varDataVal(tmp), sizeof(tmp) - VARSTR_HEADER_SIZE, "%" PRIu64, value);
|
||||||
varDataLen(tmp) = len;
|
varDataLen(tmp) = len;
|
||||||
if (pCtx->outType == TSDB_DATA_TYPE_NCHAR) {
|
if (pCtx->outType == TSDB_DATA_TYPE_NCHAR) {
|
||||||
SCL_ERR_RET(varToNchar(tmp, pCtx->pOut, i, NULL));
|
SCL_ERR_RET(varToNchar(tmp, pCtx->pOut, i, NULL));
|
||||||
|
@ -768,7 +768,7 @@ int32_t vectorConvertToVarData(SSclVectorConvCtx *pCtx) {
|
||||||
|
|
||||||
double value = 0;
|
double value = 0;
|
||||||
GET_TYPED_DATA(value, double, pCtx->inType, colDataGetData(pInputCol, i));
|
GET_TYPED_DATA(value, double, pCtx->inType, colDataGetData(pInputCol, i));
|
||||||
int32_t len = sprintf(varDataVal(tmp), "%lf", value);
|
int32_t len = snprintf(varDataVal(tmp), sizeof(tmp) - VARSTR_HEADER_SIZE, "%lf", value);
|
||||||
varDataLen(tmp) = len;
|
varDataLen(tmp) = len;
|
||||||
if (pCtx->outType == TSDB_DATA_TYPE_NCHAR) {
|
if (pCtx->outType == TSDB_DATA_TYPE_NCHAR) {
|
||||||
SCL_ERR_RET(varToNchar(tmp, pCtx->pOut, i, NULL));
|
SCL_ERR_RET(varToNchar(tmp, pCtx->pOut, i, NULL));
|
||||||
|
|
|
@ -55,7 +55,7 @@ void flttInitLogFile() {
|
||||||
|
|
||||||
tsAsyncLog = 0;
|
tsAsyncLog = 0;
|
||||||
qDebugFlag = 159;
|
qDebugFlag = 159;
|
||||||
(void)strcpy(tsLogDir, TD_LOG_DIR_PATH);
|
tstrncpy(tsLogDir, TD_LOG_DIR_PATH, PATH_MAX);
|
||||||
|
|
||||||
if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum, false) < 0) {
|
if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum, false) < 0) {
|
||||||
printf("failed to open log file in directory:%s\n", tsLogDir);
|
printf("failed to open log file in directory:%s\n", tsLogDir);
|
||||||
|
@ -101,7 +101,7 @@ int32_t flttMakeColumnNode(SNode **pNode, SSDataBlock **block, int32_t dataType,
|
||||||
rnode->node.resType.bytes = dataBytes;
|
rnode->node.resType.bytes = dataBytes;
|
||||||
rnode->dataBlockId = 0;
|
rnode->dataBlockId = 0;
|
||||||
|
|
||||||
sprintf(rnode->dbName, "%" PRIu64, dbidx++);
|
snprintf(rnode->dbName, TSDB_DB_NAME_LEN, "%" PRIu64, dbidx++);
|
||||||
|
|
||||||
if (NULL == block) {
|
if (NULL == block) {
|
||||||
rnode->slotId = 2;
|
rnode->slotId = 2;
|
||||||
|
@ -666,7 +666,7 @@ TEST(columnTest, binary_column_like_binary) {
|
||||||
int32_t rowNum = sizeof(leftv) / sizeof(leftv[0]);
|
int32_t rowNum = sizeof(leftv) / sizeof(leftv[0]);
|
||||||
flttMakeColumnNode(&pLeft, &src, TSDB_DATA_TYPE_BINARY, 3, rowNum, leftv);
|
flttMakeColumnNode(&pLeft, &src, TSDB_DATA_TYPE_BINARY, 3, rowNum, leftv);
|
||||||
|
|
||||||
sprintf(&rightv[2], "%s", "__0");
|
snprintf(&rightv[2], sizeof(rightv) - 2, "%s", "__0");
|
||||||
varDataSetLen(rightv, strlen(&rightv[2]));
|
varDataSetLen(rightv, strlen(&rightv[2]));
|
||||||
flttMakeValueNode(&pRight, TSDB_DATA_TYPE_BINARY, rightv);
|
flttMakeValueNode(&pRight, TSDB_DATA_TYPE_BINARY, rightv);
|
||||||
flttMakeOpNode(&opNode, OP_TYPE_LIKE, TSDB_DATA_TYPE_BOOL, pLeft, pRight);
|
flttMakeOpNode(&opNode, OP_TYPE_LIKE, TSDB_DATA_TYPE_BOOL, pLeft, pRight);
|
||||||
|
|
|
@ -81,7 +81,7 @@ void scltInitLogFile() {
|
||||||
|
|
||||||
tsAsyncLog = 0;
|
tsAsyncLog = 0;
|
||||||
qDebugFlag = 159;
|
qDebugFlag = 159;
|
||||||
(void)strcpy(tsLogDir, TD_LOG_DIR_PATH);
|
tstrncpy(tsLogDir, TD_LOG_DIR_PATH, PATH_MAX);
|
||||||
|
|
||||||
if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum, false) < 0) {
|
if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum, false) < 0) {
|
||||||
(void)printf("failed to open log file in directory:%s\n", tsLogDir);
|
(void)printf("failed to open log file in directory:%s\n", tsLogDir);
|
||||||
|
|
Loading…
Reference in New Issue