unused code

This commit is contained in:
facetosea 2025-02-11 07:38:12 +00:00
parent 6ba3edfd0b
commit 3c0121ef1a
6 changed files with 7 additions and 46 deletions

View File

@ -276,13 +276,13 @@ typedef struct tExprNode {
int32_t num;
struct SFunctionNode *pFunctNode;
int32_t functionType;
int32_t bindTupleFuncIdx;
} _function;
struct {
struct SNode *pRootNode;
} _optrRoot;
};
int32_t bindTupleFuncIdx;
int32_t tupleFuncIdx;
} tExprNode;

View File

@ -911,7 +911,7 @@ int32_t taosGetErrSize();
#define TSDB_CODE_PAR_INVALID_COLS_FUNCTION TAOS_DEF_ERROR_CODE(0, 0x2687)
#define TSDB_CODE_PAR_INVALID_COLS_SELECTFUNC TAOS_DEF_ERROR_CODE(0, 0x2688)
#define TSDB_CODE_INVALID_MULITI_COLS_FUNC TAOS_DEF_ERROR_CODE(0, 0x2689)
#define TSDB_CODE_INVALID_COLS_ALIAS TAOS_DEF_ERROR_CODE(0, 0x2690)
#define TSDB_CODE_INVALID_COLS_ALIAS TAOS_DEF_ERROR_CODE(0, 0x268A)
#define TSDB_CODE_PAR_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x26FF)
//planner

View File

@ -1992,7 +1992,9 @@ int32_t createExprFromOneNode(SExprInfo* pExp, SNode* pNode, int16_t slotId) {
code = TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR;
QUERY_CHECK_CODE(code, lino, _end);
}
pExp->pExpr->bindTupleFuncIdx = ((SExprNode*)pNode)->bindTupleFuncIdx;
if(type == QUERY_NODE_FUNCTION) {
pExp->pExpr->_function.bindTupleFuncIdx = ((SExprNode*)pNode)->bindTupleFuncIdx;
}
pExp->pExpr->tupleFuncIdx = ((SExprNode*)pNode)->tupleFuncIdx;
_end:
if (code != TSDB_CODE_SUCCESS) {
@ -2132,7 +2134,7 @@ static int32_t setSelectValueColumnInfo(SqlFunctionCtx* pCtx, int32_t numOfOutpu
if (pValCtxArray == NULL) {
pValCtx[num++] = &pCtx[i];
} else {
int32_t bindFuncIndex = pCtx[i].pExpr->pExpr->bindTupleFuncIdx; // start from index 1;
int32_t bindFuncIndex = pCtx[i].pExpr->pExpr->_function.bindTupleFuncIdx; // start from index 1;
if (bindFuncIndex > 0) { // 0 is default index related to the select function
bindFuncIndex -= 1;
}

View File

@ -170,7 +170,6 @@ SNode* createInterpTimeAround(SAstCreateContext* pCxt, SNode* pTimepoint, SN
SNode* createWhenThenNode(SAstCreateContext* pCxt, SNode* pWhen, SNode* pThen);
SNode* createCaseWhenNode(SAstCreateContext* pCxt, SNode* pCase, SNodeList* pWhenThenList, SNode* pElse);
SNode* createAlterSingleTagColumnNode(SAstCreateContext* pCtx, SToken* token, SNode* pVal);
SNode* createColsFunctionNode(SAstCreateContext* pCxt, SNode* pFunc, SNodeList* pList);
SNode* addWhereClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pWhere);
SNode* addPartitionByClause(SAstCreateContext* pCxt, SNode* pStmt, SNodeList* pPartitionByList);

View File

@ -375,6 +375,7 @@ SNodeList* createColsFuncParamNodeList(SAstCreateContext* pCxt, SNode* pNode, SN
pCxt->errCode = nodesListAppend(list, pFuncNode);
CHECK_PARSER_STATUS(pCxt);
pCxt->errCode = nodesListAppendList(list, pNodeList);
CHECK_PARSER_STATUS(pCxt);
return list;
_err:
@ -1177,24 +1178,6 @@ _err:
return NULL;
}
SNode* createColsFunctionNode(SAstCreateContext* pCxt, SNode* pColFunc, SNodeList* pExpr){
SFunctionNode* func = NULL;
CHECK_PARSER_STATUS(pCxt);
pCxt->errCode = nodesMakeNode(QUERY_NODE_FUNCTION, (SNode**)&func);
CHECK_MAKE_NODE(func);
strcpy(func->functionName, "cols");
pCxt->errCode = nodesListMakeAppend(&func->pParameterList, pColFunc);
CHECK_PARSER_STATUS(pCxt);
pCxt->errCode = nodesListMakeStrictAppendList(&func->pParameterList, pExpr);
CHECK_PARSER_STATUS(pCxt);
return (SNode*)func;
_err:
nodesDestroyNode((SNode*)func);
nodesDestroyNode(pColFunc);
nodesDestroyList(pExpr);
return NULL;
}
SNode* createSubstrFunctionNodeExt(SAstCreateContext* pCxt, SNode* pExpr, SNode* pExpr2, SNode* pExpr3) {
SFunctionNode* func = NULL;
CHECK_PARSER_STATUS(pCxt);

View File

@ -31,25 +31,6 @@ typedef struct SSlotIndex {
SArray* pSlotIdsInfo; // duplicate name slot
} SSlotIndex;
static int64_t getExprBindIndexStr(SNode* pNode, char* bindInfo) {
if (nodeType(pNode) == QUERY_NODE_COLUMN) {
SColumnNode* pCol = (SColumnNode*)pNode;
if (pCol->dataBlockId == 0) {
return 0;
}
}
if (nodesIsExprNode(pNode)) {
SExprNode* pExpr = (SExprNode*)pNode;
if (pExpr->bindTupleFuncIdx > 0 && pExpr->bindTupleFuncIdx <= 9) {
bindInfo[0] = '0' + pExpr->bindTupleFuncIdx;
return 1;
} else if (pExpr->bindTupleFuncIdx != 0) {
return tsnprintf(bindInfo, sizeof(bindInfo), "%d", pExpr->bindTupleFuncIdx);
}
}
return 0;
}
enum {
SLOT_KEY_TYPE_ALL = 1,
SLOT_KEY_TYPE_COLNAME = 2,
@ -59,7 +40,6 @@ static int32_t getSlotKeyHelper(SNode* pNode, const char* pPreName, const char*
int32_t* pLen, uint16_t extraBufLen, int8_t slotKeyType) {
int32_t code = 0;
char bindInfo[16] = {0};
//int exBindInfoLen = getExprBindIndexStr(pNode, bindInfo);
*ppKey = taosMemoryCalloc(1, callocLen);
if (!*ppKey) {
return terrno;
@ -68,9 +48,6 @@ static int32_t getSlotKeyHelper(SNode* pNode, const char* pPreName, const char*
TAOS_STRNCAT(*ppKey, pPreName, TSDB_TABLE_NAME_LEN);
TAOS_STRNCAT(*ppKey, ".", 2);
TAOS_STRNCAT(*ppKey, name, TSDB_COL_NAME_LEN);
// if (exBindInfoLen > 0) {
// TAOS_STRNCAT(*ppKey, bindInfo, exBindInfoLen);
// }
*pLen = taosHashBinary(*ppKey, strlen(*ppKey));
} else {
TAOS_STRNCAT(*ppKey, name, TSDB_COL_NAME_LEN);