fix tests
This commit is contained in:
parent
9a01b42bc2
commit
2bf3da7415
|
@ -50,12 +50,12 @@
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define COPY_STRING_FORM_ID_TOKEN(buf, pToken) tstrncpy(buf, (pToken)->z, TMIN((pToken)->n + 1, sizeof(buf)))
|
#define COPY_STRING_FORM_ID_TOKEN(buf, pToken) strncpy(buf, (pToken)->z, TMIN((pToken)->n, sizeof(buf) - 1))
|
||||||
#define COPY_STRING_FORM_STR_TOKEN(buf, pToken) \
|
#define COPY_STRING_FORM_STR_TOKEN(buf, pToken) \
|
||||||
do { \
|
do { \
|
||||||
if ((pToken)->n > 2) { \
|
if ((pToken)->n > 2) { \
|
||||||
tstrncpy(buf, (pToken)->z + 1, TMIN((pToken)->n - 1, sizeof(buf))); \
|
strncpy(buf, (pToken)->z + 1, TMIN((pToken)->n - 2, sizeof(buf) - 1)); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
SToken nil_token = {.type = TK_NK_NIL, .n = 0, .z = NULL};
|
SToken nil_token = {.type = TK_NK_NIL, .n = 0, .z = NULL};
|
||||||
|
@ -113,7 +113,7 @@ static bool checkPassword(SAstCreateContext* pCxt, const SToken* pPasswordToken,
|
||||||
} else if (pPasswordToken->n >= (TSDB_USET_PASSWORD_LEN + 2)) {
|
} else if (pPasswordToken->n >= (TSDB_USET_PASSWORD_LEN + 2)) {
|
||||||
pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG);
|
pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG);
|
||||||
} else {
|
} else {
|
||||||
tstrncpy(pPassword, pPasswordToken->z, TMIN(TSDB_USET_PASSWORD_LEN, pPasswordToken->n + 1));
|
strncpy(pPassword, pPasswordToken->z, pPasswordToken->n);
|
||||||
(void)strdequote(pPassword);
|
(void)strdequote(pPassword);
|
||||||
if (strtrim(pPassword) <= 0) {
|
if (strtrim(pPassword) <= 0) {
|
||||||
pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_PASSWD_EMPTY);
|
pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_PASSWD_EMPTY);
|
||||||
|
@ -151,7 +151,7 @@ static int32_t parseEndpoint(SAstCreateContext* pCxt, const SToken* pEp, char* p
|
||||||
tstrncpy(pFqdn, ep, TSDB_FQDN_LEN);
|
tstrncpy(pFqdn, ep, TSDB_FQDN_LEN);
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
tstrncpy(pFqdn, ep, pColon - ep + 1);
|
strncpy(pFqdn, ep, pColon - ep);
|
||||||
return parsePort(pCxt, pColon + 1, pPort);
|
return parsePort(pCxt, pColon + 1, pPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,14 +327,15 @@ SNode* releaseRawExprNode(SAstCreateContext* pCxt, SNode* pNode) {
|
||||||
tstrncpy(pExpr->userAlias, ((SFunctionNode*)pExpr)->functionName, TSDB_COL_NAME_LEN);
|
tstrncpy(pExpr->userAlias, ((SFunctionNode*)pExpr)->functionName, TSDB_COL_NAME_LEN);
|
||||||
tstrncpy(pExpr->aliasName, ((SFunctionNode*)pExpr)->functionName, TSDB_COL_NAME_LEN);
|
tstrncpy(pExpr->aliasName, ((SFunctionNode*)pExpr)->functionName, TSDB_COL_NAME_LEN);
|
||||||
} else {
|
} else {
|
||||||
int32_t len = TMIN(sizeof(pExpr->aliasName), pRawExpr->n + 1);
|
int32_t len = TMIN(sizeof(pExpr->aliasName) - 1, pRawExpr->n);
|
||||||
|
|
||||||
// See TS-3398.
|
// See TS-3398.
|
||||||
// Len of pRawExpr->p could be larger than len of aliasName[TSDB_COL_NAME_LEN].
|
// Len of pRawExpr->p could be larger than len of aliasName[TSDB_COL_NAME_LEN].
|
||||||
// If aliasName is truncated, hash value of aliasName could be the same.
|
// If aliasName is truncated, hash value of aliasName could be the same.
|
||||||
uint64_t hashVal = MurmurHash3_64(pRawExpr->p, pRawExpr->n);
|
uint64_t hashVal = MurmurHash3_64(pRawExpr->p, pRawExpr->n);
|
||||||
snprintf(pExpr->aliasName, TSDB_COL_NAME_LEN, "%" PRIu64, hashVal);
|
snprintf(pExpr->aliasName, TSDB_COL_NAME_LEN, "%" PRIu64, hashVal);
|
||||||
tstrncpy(pExpr->userAlias, pRawExpr->p, len);
|
strncpy(pExpr->userAlias, pRawExpr->p, len);
|
||||||
|
pExpr->userAlias[len] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pRawExpr->pNode = NULL;
|
pRawExpr->pNode = NULL;
|
||||||
|
@ -1022,7 +1023,7 @@ static SNode* createPrimaryKeyCol(SAstCreateContext* pCxt, const SToken* pFuncNa
|
||||||
if (NULL == pFuncName) {
|
if (NULL == pFuncName) {
|
||||||
tstrncpy(pCol->colName, ROWTS_PSEUDO_COLUMN_NAME, TSDB_COL_NAME_LEN);
|
tstrncpy(pCol->colName, ROWTS_PSEUDO_COLUMN_NAME, TSDB_COL_NAME_LEN);
|
||||||
} else {
|
} else {
|
||||||
tstrncpy(pCol->colName, pFuncName->z, pFuncName->n + 1);
|
strncpy(pCol->colName, pFuncName->z, pFuncName->n);
|
||||||
}
|
}
|
||||||
pCol->isPrimTs = true;
|
pCol->isPrimTs = true;
|
||||||
return (SNode*)pCol;
|
return (SNode*)pCol;
|
||||||
|
@ -1524,9 +1525,11 @@ SNode* setProjectionAlias(SAstCreateContext* pCxt, SNode* pNode, SToken* pAlias)
|
||||||
CHECK_PARSER_STATUS(pCxt);
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
trimEscape(pAlias);
|
trimEscape(pAlias);
|
||||||
SExprNode* pExpr = (SExprNode*)pNode;
|
SExprNode* pExpr = (SExprNode*)pNode;
|
||||||
int32_t len = TMIN(sizeof(pExpr->aliasName), pAlias->n + 1);
|
int32_t len = TMIN(sizeof(pExpr->aliasName) - 1, pAlias->n);
|
||||||
tstrncpy(pExpr->aliasName, pAlias->z, len);
|
strncpy(pExpr->aliasName, pAlias->z, len);
|
||||||
tstrncpy(pExpr->userAlias, pAlias->z, len);
|
pExpr->aliasName[len] = '\0';
|
||||||
|
strncpy(pExpr->userAlias, pAlias->z, len);
|
||||||
|
pExpr->userAlias[len] = '\0';
|
||||||
pExpr->asAlias = true;
|
pExpr->asAlias = true;
|
||||||
return pNode;
|
return pNode;
|
||||||
_err:
|
_err:
|
||||||
|
@ -2242,7 +2245,7 @@ SNode* setColumnOptions(SAstCreateContext* pCxt, SNode* pOptions, const SToken*
|
||||||
char optionType[TSDB_CL_OPTION_LEN];
|
char optionType[TSDB_CL_OPTION_LEN];
|
||||||
|
|
||||||
memset(optionType, 0, TSDB_CL_OPTION_LEN);
|
memset(optionType, 0, TSDB_CL_OPTION_LEN);
|
||||||
tstrncpy(optionType, pVal1->z, TMIN(pVal1->n, TSDB_CL_OPTION_LEN));
|
strncpy(optionType, pVal1->z, TMIN(pVal1->n, TSDB_CL_OPTION_LEN));
|
||||||
if (0 == strlen(optionType)) {
|
if (0 == strlen(optionType)) {
|
||||||
pCxt->errCode = TSDB_CODE_PAR_SYNTAX_ERROR;
|
pCxt->errCode = TSDB_CODE_PAR_SYNTAX_ERROR;
|
||||||
return pOptions;
|
return pOptions;
|
||||||
|
@ -2374,7 +2377,7 @@ SNode* createCreateSubTableFromFileClause(SAstCreateContext* pCxt, bool ignoreEx
|
||||||
if (TK_NK_STRING == pFilePath->type) {
|
if (TK_NK_STRING == pFilePath->type) {
|
||||||
(void)trimString(pFilePath->z, pFilePath->n, pStmt->filePath, PATH_MAX);
|
(void)trimString(pFilePath->z, pFilePath->n, pStmt->filePath, PATH_MAX);
|
||||||
} else {
|
} else {
|
||||||
tstrncpy(pStmt->filePath, pFilePath->z, TMIN(PATH_MAX, pFilePath->n + 1));
|
strncpy(pStmt->filePath, pFilePath->z, pFilePath->n);
|
||||||
}
|
}
|
||||||
|
|
||||||
nodesDestroyNode(pUseRealTable);
|
nodesDestroyNode(pUseRealTable);
|
||||||
|
|
|
@ -2131,7 +2131,7 @@ static EDealRes translateNormalValue(STranslateContext* pCxt, SValueNode* pVal,
|
||||||
return generateDealNodeErrMsg(pCxt, terrno);
|
return generateDealNodeErrMsg(pCxt, terrno);
|
||||||
}
|
}
|
||||||
varDataSetLen(pVal->datum.p, len);
|
varDataSetLen(pVal->datum.p, len);
|
||||||
tstrncpy(varDataVal(pVal->datum.p), pVal->literal, len);
|
strncpy(varDataVal(pVal->datum.p), pVal->literal, len);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TSDB_DATA_TYPE_TIMESTAMP: {
|
case TSDB_DATA_TYPE_TIMESTAMP: {
|
||||||
|
@ -4395,7 +4395,7 @@ static EDealRes doTranslateTbName(SNode** pNode, void* pContext) {
|
||||||
return DEAL_RES_ERROR;
|
return DEAL_RES_ERROR;
|
||||||
}
|
}
|
||||||
varDataSetLen(pVal->datum.p, tbLen);
|
varDataSetLen(pVal->datum.p, tbLen);
|
||||||
tstrncpy(varDataVal(pVal->datum.p), pVal->literal, tbLen);
|
tstrncpy(varDataVal(pVal->datum.p), pVal->literal, tbLen + 1);
|
||||||
tstrncpy(pVal->node.userAlias, pFunc->node.userAlias, TSDB_COL_NAME_LEN);
|
tstrncpy(pVal->node.userAlias, pFunc->node.userAlias, TSDB_COL_NAME_LEN);
|
||||||
tstrncpy(pVal->node.aliasName, pFunc->node.aliasName, TSDB_COL_NAME_LEN);
|
tstrncpy(pVal->node.aliasName, pFunc->node.aliasName, TSDB_COL_NAME_LEN);
|
||||||
nodesDestroyNode(*pNode);
|
nodesDestroyNode(*pNode);
|
||||||
|
|
|
@ -606,7 +606,7 @@ static int32_t getIntegerFromAuthStr(const char* pStart, char** pNext) {
|
||||||
tstrncpy(buf, pStart, 10);
|
tstrncpy(buf, pStart, 10);
|
||||||
*pNext = NULL;
|
*pNext = NULL;
|
||||||
} else {
|
} else {
|
||||||
tstrncpy(buf, pStart, p - pStart + 1);
|
strncpy(buf, pStart, p - pStart);
|
||||||
*pNext = ++p;
|
*pNext = ++p;
|
||||||
}
|
}
|
||||||
return taosStr2Int32(buf, NULL, 10);
|
return taosStr2Int32(buf, NULL, 10);
|
||||||
|
@ -618,7 +618,7 @@ static void getStringFromAuthStr(const char* pStart, char* pStr, char** pNext) {
|
||||||
tstrncpy(pStr, pStart, strlen(pStart) + 1);
|
tstrncpy(pStr, pStart, strlen(pStart) + 1);
|
||||||
*pNext = NULL;
|
*pNext = NULL;
|
||||||
} else {
|
} else {
|
||||||
tstrncpy(pStr, pStart, p - pStart + 1);
|
strncpy(pStr, pStart, p - pStart);
|
||||||
*pNext = ++p;
|
*pNext = ++p;
|
||||||
}
|
}
|
||||||
if (*pStart == '`' && *(pStart + 1) == '`') {
|
if (*pStart == '`' && *(pStart + 1) == '`') {
|
||||||
|
@ -652,7 +652,7 @@ static int32_t buildTableReq(SHashObj* pTablesHash, SArray** pTables) {
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
char* pKey = taosHashGetKey(p, &len);
|
char* pKey = taosHashGetKey(p, &len);
|
||||||
char fullName[TSDB_TABLE_FNAME_LEN] = {0};
|
char fullName[TSDB_TABLE_FNAME_LEN] = {0};
|
||||||
tstrncpy(fullName, pKey, len);
|
strncpy(fullName, pKey, len);
|
||||||
SName name = {0};
|
SName name = {0};
|
||||||
int32_t code = tNameFromString(&name, fullName, T_NAME_ACCT | T_NAME_DB | T_NAME_TABLE);
|
int32_t code = tNameFromString(&name, fullName, T_NAME_ACCT | T_NAME_DB | T_NAME_TABLE);
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
@ -683,7 +683,7 @@ static int32_t buildDbReq(SHashObj* pDbsHash, SArray** pDbs) {
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
char* pKey = taosHashGetKey(p, &len);
|
char* pKey = taosHashGetKey(p, &len);
|
||||||
char fullName[TSDB_DB_FNAME_LEN] = {0};
|
char fullName[TSDB_DB_FNAME_LEN] = {0};
|
||||||
tstrncpy(fullName, pKey, len);
|
strncpy(fullName, pKey, len);
|
||||||
if (NULL == taosArrayPush(*pDbs, fullName)) {
|
if (NULL == taosArrayPush(*pDbs, fullName)) {
|
||||||
taosHashCancelIterate(pDbsHash, p);
|
taosHashCancelIterate(pDbsHash, p);
|
||||||
taosArrayDestroy(*pDbs);
|
taosArrayDestroy(*pDbs);
|
||||||
|
@ -737,7 +737,7 @@ static int32_t buildUserAuthReq(SHashObj* pUserAuthHash, SArray** pUserAuth) {
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
char* pKey = taosHashGetKey(p, &len);
|
char* pKey = taosHashGetKey(p, &len);
|
||||||
char key[USER_AUTH_KEY_MAX_LEN] = {0};
|
char key[USER_AUTH_KEY_MAX_LEN] = {0};
|
||||||
tstrncpy(key, pKey, len);
|
strncpy(key, pKey, len);
|
||||||
SUserAuthInfo userAuth = {0};
|
SUserAuthInfo userAuth = {0};
|
||||||
stringToUserAuth(key, len, &userAuth);
|
stringToUserAuth(key, len, &userAuth);
|
||||||
if (NULL == taosArrayPush(*pUserAuth, &userAuth)) {
|
if (NULL == taosArrayPush(*pUserAuth, &userAuth)) {
|
||||||
|
@ -763,7 +763,7 @@ static int32_t buildUdfReq(SHashObj* pUdfHash, SArray** pUdf) {
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
char* pFunc = taosHashGetKey(p, &len);
|
char* pFunc = taosHashGetKey(p, &len);
|
||||||
char func[TSDB_FUNC_NAME_LEN] = {0};
|
char func[TSDB_FUNC_NAME_LEN] = {0};
|
||||||
tstrncpy(func, pFunc, len);
|
strncpy(func, pFunc, len);
|
||||||
if (NULL == taosArrayPush(*pUdf, func)) {
|
if (NULL == taosArrayPush(*pUdf, func)) {
|
||||||
taosHashCancelIterate(pUdfHash, p);
|
taosHashCancelIterate(pUdfHash, p);
|
||||||
taosArrayDestroy(*pUdf);
|
taosArrayDestroy(*pUdf);
|
||||||
|
|
|
@ -109,7 +109,7 @@ bool qParseDbName(const char* pStr, size_t length, char** pDbName) {
|
||||||
if (*pDbName == NULL) {
|
if (*pDbName == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
tstrncpy(*pDbName, t.z, dbNameLen);
|
strncpy(*pDbName, t.z, dbNameLen);
|
||||||
(*pDbName)[dbNameLen] = '\0';
|
(*pDbName)[dbNameLen] = '\0';
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ static int32_t setValueByBindParam(SValueNode* pVal, TAOS_MULTI_BIND* pParam) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
varDataSetLen(pVal->datum.p, pVal->node.resType.bytes);
|
varDataSetLen(pVal->datum.p, pVal->node.resType.bytes);
|
||||||
tstrncpy(varDataVal(pVal->datum.p), (const char*)pParam->buffer, pVal->node.resType.bytes);
|
strncpy(varDataVal(pVal->datum.p), (const char*)pParam->buffer, pVal->node.resType.bytes);
|
||||||
pVal->node.resType.bytes += VARSTR_HEADER_SIZE;
|
pVal->node.resType.bytes += VARSTR_HEADER_SIZE;
|
||||||
break;
|
break;
|
||||||
case TSDB_DATA_TYPE_NCHAR: {
|
case TSDB_DATA_TYPE_NCHAR: {
|
||||||
|
@ -472,7 +472,7 @@ static int32_t setValueByBindParam2(SValueNode* pVal, TAOS_STMT2_BIND* pParam) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
varDataSetLen(pVal->datum.p, pVal->node.resType.bytes);
|
varDataSetLen(pVal->datum.p, pVal->node.resType.bytes);
|
||||||
tstrncpy(varDataVal(pVal->datum.p), (const char*)pParam->buffer, pVal->node.resType.bytes);
|
strncpy(varDataVal(pVal->datum.p), (const char*)pParam->buffer, pVal->node.resType.bytes);
|
||||||
pVal->node.resType.bytes += VARSTR_HEADER_SIZE;
|
pVal->node.resType.bytes += VARSTR_HEADER_SIZE;
|
||||||
break;
|
break;
|
||||||
case TSDB_DATA_TYPE_NCHAR: {
|
case TSDB_DATA_TYPE_NCHAR: {
|
||||||
|
|
|
@ -41,9 +41,9 @@ static int32_t getSlotKey(SNode* pNode, const char* pStmtName, char** ppKey, int
|
||||||
if (!*ppKey) {
|
if (!*ppKey) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
strncat(*ppKey, pStmtName, TSDB_TABLE_NAME_LEN);
|
TAOS_STRNCAT(*ppKey, pStmtName, TSDB_TABLE_NAME_LEN);
|
||||||
strncat(*ppKey, ".", 2);
|
TAOS_STRNCAT(*ppKey, ".", 2);
|
||||||
strncat(*ppKey, pCol->node.aliasName, TSDB_COL_NAME_LEN);
|
TAOS_STRNCAT(*ppKey, pCol->node.aliasName, TSDB_COL_NAME_LEN);
|
||||||
*pLen = taosHashBinary(*ppKey, strlen(*ppKey));
|
*pLen = taosHashBinary(*ppKey, strlen(*ppKey));
|
||||||
return code;
|
return code;
|
||||||
} else {
|
} else {
|
||||||
|
@ -51,7 +51,7 @@ static int32_t getSlotKey(SNode* pNode, const char* pStmtName, char** ppKey, int
|
||||||
if (!*ppKey) {
|
if (!*ppKey) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
strncat(*ppKey, pCol->node.aliasName, TSDB_COL_NAME_LEN);
|
TAOS_STRNCAT(*ppKey, pCol->node.aliasName, TSDB_COL_NAME_LEN);
|
||||||
*pLen = strlen(*ppKey);
|
*pLen = strlen(*ppKey);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ static int32_t getSlotKey(SNode* pNode, const char* pStmtName, char** ppKey, int
|
||||||
if (!*ppKey) {
|
if (!*ppKey) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
strncat(*ppKey, pCol->colName, TSDB_COL_NAME_LEN);
|
TAOS_STRNCAT(*ppKey, pCol->colName, TSDB_COL_NAME_LEN);
|
||||||
*pLen = strlen(*ppKey);
|
*pLen = strlen(*ppKey);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -70,9 +70,9 @@ static int32_t getSlotKey(SNode* pNode, const char* pStmtName, char** ppKey, int
|
||||||
if (!*ppKey) {
|
if (!*ppKey) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
strncat(*ppKey, pCol->tableAlias, TSDB_TABLE_NAME_LEN);
|
TAOS_STRNCAT(*ppKey, pCol->tableAlias, TSDB_TABLE_NAME_LEN);
|
||||||
strncat(*ppKey, ".", 2);
|
TAOS_STRNCAT(*ppKey, ".", 2);
|
||||||
strncat(*ppKey, pCol->colName, TSDB_COL_NAME_LEN);
|
TAOS_STRNCAT(*ppKey, pCol->colName, TSDB_COL_NAME_LEN);
|
||||||
*pLen = taosHashBinary(*ppKey, strlen(*ppKey));
|
*pLen = taosHashBinary(*ppKey, strlen(*ppKey));
|
||||||
return code;
|
return code;
|
||||||
} else if (QUERY_NODE_FUNCTION == nodeType(pNode)) {
|
} else if (QUERY_NODE_FUNCTION == nodeType(pNode)) {
|
||||||
|
@ -85,9 +85,9 @@ static int32_t getSlotKey(SNode* pNode, const char* pStmtName, char** ppKey, int
|
||||||
if (!*ppKey) {
|
if (!*ppKey) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
strncat(*ppKey, pStmtName, TSDB_TABLE_NAME_LEN);
|
TAOS_STRNCAT(*ppKey, pStmtName, TSDB_TABLE_NAME_LEN);
|
||||||
strncat(*ppKey, ".", 2);
|
TAOS_STRNCAT(*ppKey, ".", 2);
|
||||||
strncat(*ppKey, ((SExprNode*)pNode)->aliasName, TSDB_COL_NAME_LEN);
|
TAOS_STRNCAT(*ppKey, ((SExprNode*)pNode)->aliasName, TSDB_COL_NAME_LEN);
|
||||||
*pLen = taosHashBinary(*ppKey, strlen(*ppKey));
|
*pLen = taosHashBinary(*ppKey, strlen(*ppKey));
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -95,9 +95,9 @@ static int32_t getSlotKey(SNode* pNode, const char* pStmtName, char** ppKey, int
|
||||||
if (!*ppKey) {
|
if (!*ppKey) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
strncat(*ppKey, pVal->literal, strlen(pVal->literal));
|
TAOS_STRNCAT(*ppKey, pVal->literal, strlen(pVal->literal));
|
||||||
strncat(*ppKey, ".", 2);
|
TAOS_STRNCAT(*ppKey, ".", 2);
|
||||||
strncat(*ppKey, ((SExprNode*)pNode)->aliasName, TSDB_COL_NAME_LEN);
|
TAOS_STRNCAT(*ppKey, ((SExprNode*)pNode)->aliasName, TSDB_COL_NAME_LEN);
|
||||||
*pLen = taosHashBinary(*ppKey, strlen(*ppKey));
|
*pLen = taosHashBinary(*ppKey, strlen(*ppKey));
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -109,9 +109,9 @@ static int32_t getSlotKey(SNode* pNode, const char* pStmtName, char** ppKey, int
|
||||||
if (!*ppKey) {
|
if (!*ppKey) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
strncat(*ppKey, pStmtName, TSDB_TABLE_NAME_LEN);
|
TAOS_STRNCAT(*ppKey, pStmtName, TSDB_TABLE_NAME_LEN);
|
||||||
strncat(*ppKey, ".", 2);
|
TAOS_STRNCAT(*ppKey, ".", 2);
|
||||||
strncat(*ppKey, ((SExprNode*)pNode)->aliasName, TSDB_COL_NAME_LEN);
|
TAOS_STRNCAT(*ppKey, ((SExprNode*)pNode)->aliasName, TSDB_COL_NAME_LEN);
|
||||||
*pLen = taosHashBinary(*ppKey, strlen(*ppKey));
|
*pLen = taosHashBinary(*ppKey, strlen(*ppKey));
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ static int32_t getSlotKey(SNode* pNode, const char* pStmtName, char** ppKey, int
|
||||||
if (!*ppKey) {
|
if (!*ppKey) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
strncat(*ppKey, ((SExprNode*)pNode)->aliasName, TSDB_COL_NAME_LEN);
|
TAOS_STRNCAT(*ppKey, ((SExprNode*)pNode)->aliasName, TSDB_COL_NAME_LEN);
|
||||||
*pLen = strlen(*ppKey);
|
*pLen = strlen(*ppKey);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue