fix: alias name length
This commit is contained in:
parent
9d86f48622
commit
8a7b633036
|
@ -55,8 +55,8 @@ typedef struct SDataType {
|
||||||
typedef struct SExprNode {
|
typedef struct SExprNode {
|
||||||
ENodeType type;
|
ENodeType type;
|
||||||
SDataType resType;
|
SDataType resType;
|
||||||
char aliasName[TSDB_COL_NAME_LEN];
|
char aliasName[TSDB_COL_NAME_LEN + TSDB_COL_NAME_EXLEN];
|
||||||
char userAlias[TSDB_COL_NAME_LEN];
|
char userAlias[TSDB_COL_NAME_LEN + TSDB_COL_NAME_EXLEN];
|
||||||
SArray* pAssociation;
|
SArray* pAssociation;
|
||||||
bool asAlias;
|
bool asAlias;
|
||||||
bool asParam;
|
bool asParam;
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "function.h"
|
#include "function.h"
|
||||||
|
#include "nodes.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "querynodes.h"
|
#include "querynodes.h"
|
||||||
#include "tfill.h"
|
#include "tfill.h"
|
||||||
|
@ -395,10 +396,12 @@ static int32_t createDataBlockForEmptyInput(SOperatorInfo* pOperator, SSDataBloc
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the last expression is a tuple function, we don't need to create a empty data block
|
// if the expression is a bind expression, we don't need to create a empty data block
|
||||||
int32_t lastExprIndex = pOperator->exprSupp.numOfExprs - 1;
|
for (int i = pOperator->exprSupp.numOfExprs - 1; i >= 0; i--) {
|
||||||
if(pOperator->exprSupp.pExprInfo[lastExprIndex].pExpr->_function.bindExprID > 0) {
|
SExprInfo* pExprInfo = &pOperator->exprSupp.pExprInfo[i];
|
||||||
return TSDB_CODE_SUCCESS;
|
if (nodeType(pExprInfo->pExpr) == QUERY_NODE_FUNCTION && pExprInfo->pExpr->_function.bindExprID > 0) {
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
code = createDataBlock(&pBlock);
|
code = createDataBlock(&pBlock);
|
||||||
|
|
|
@ -3585,8 +3585,7 @@ static EDealRes rewriteColToSelectValFunc(STranslateContext* pCxt, SNode** pNode
|
||||||
if (isRelatedToOtherExpr((SExprNode*)*pNode)) {
|
if (isRelatedToOtherExpr((SExprNode*)*pNode)) {
|
||||||
int len = strlen(((SExprNode*)*pNode)->aliasName);
|
int len = strlen(((SExprNode*)*pNode)->aliasName);
|
||||||
if (len + TSDB_COL_NAME_EXLEN >= TSDB_COL_NAME_LEN) {
|
if (len + TSDB_COL_NAME_EXLEN >= TSDB_COL_NAME_LEN) {
|
||||||
parserError("%s The alias name is too long, the extra part will be truncated", __func__);
|
parserWarn("%s The alias name is too long, the extra part will be truncated", __func__);
|
||||||
return DEAL_RES_ERROR;
|
|
||||||
}
|
}
|
||||||
tsnprintf(pFunc->node.aliasName + len, TSDB_COL_NAME_EXLEN, ".%d", ((SExprNode*)*pNode)->relatedTo);
|
tsnprintf(pFunc->node.aliasName + len, TSDB_COL_NAME_EXLEN, ".%d", ((SExprNode*)*pNode)->relatedTo);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue