提交 d21e7e36 编写于 作者: S shenglian zhou

fix return error when parse through handleSQLExprItem

上级 e0b9d99f
...@@ -1894,13 +1894,14 @@ static int32_t handleSQLExprItem(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t ...@@ -1894,13 +1894,14 @@ static int32_t handleSQLExprItem(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1);
} }
int32_t code = TSDB_CODE_SUCCESS;
if (arithmeticType == NORMAL_ARITHMETIC) { if (arithmeticType == NORMAL_ARITHMETIC) {
handleScalarExpr(pCmd, pQueryInfo, exprIndex, pItem, &columnList, true); code = handleScalarExpr(pCmd, pQueryInfo, exprIndex, pItem, &columnList, true);
} else { } else {
handleAggregateExpr(pCmd, pQueryInfo, exprIndex, pItem, &columnList, true); code = handleAggregateExpr(pCmd, pQueryInfo, exprIndex, pItem, &columnList, true);
} }
return TSDB_CODE_SUCCESS; return code;
} }
static void addProjectQueryCol(SQueryInfo* pQueryInfo, int32_t startPos, SColumnIndex* pIndex, tSqlExprItem* pItem, int32_t colId) { static void addProjectQueryCol(SQueryInfo* pQueryInfo, int32_t startPos, SColumnIndex* pIndex, tSqlExprItem* pItem, int32_t colId) {
......
...@@ -169,7 +169,7 @@ int32_t exprTreeValidateTree(tExprNode *pExpr) { ...@@ -169,7 +169,7 @@ int32_t exprTreeValidateTree(tExprNode *pExpr) {
if (!IS_VAR_DATA_TYPE(pExpr->pVal->nType)) { if (!IS_VAR_DATA_TYPE(pExpr->pVal->nType)) {
pExpr->resultBytes = tDataTypes[pExpr->pVal->nType].bytes; pExpr->resultBytes = tDataTypes[pExpr->pVal->nType].bytes;
} else { } else {
pExpr->resultBytes = pExpr->pVal->nLen + VARSTR_HEADER_SIZE; pExpr->resultBytes = (int16_t)(pExpr->pVal->nLen + VARSTR_HEADER_SIZE);
} }
} else if (pExpr->nodeType == TSQL_NODE_COL) { } else if (pExpr->nodeType == TSQL_NODE_COL) {
pExpr->resultType = pExpr->pSchema->type; pExpr->resultType = pExpr->pSchema->type;
...@@ -1017,7 +1017,7 @@ void vectorConcat(int16_t functionId, tExprOperandInfo* pInputs, uint8_t numInpu ...@@ -1017,7 +1017,7 @@ void vectorConcat(int16_t functionId, tExprOperandInfo* pInputs, uint8_t numInpu
if (!hasNullInputs) { if (!hasNullInputs) {
int16_t dataLen = 0; int16_t dataLen = 0;
for (int j = 0; j < numInputs; ++j) { for (int j = 0; j < numInputs; ++j) {
memcpy((void*)(varDataVal(outputData)+dataLen), varDataVal(inputData[j]), varDataLen(inputData[j])); memcpy(((char*)varDataVal(outputData))+dataLen, varDataVal(inputData[j]), varDataLen(inputData[j]));
dataLen += varDataLen(inputData[j]); dataLen += varDataLen(inputData[j]);
} }
varDataSetLen(outputData, dataLen); varDataSetLen(outputData, dataLen);
......
...@@ -1290,7 +1290,7 @@ static int getTableDes( ...@@ -1290,7 +1290,7 @@ static int getTableDes(
convertNCharToReadable( convertNCharToReadable(
(char *)row[TSDB_SHOW_TABLES_NAME_INDEX], (char *)row[TSDB_SHOW_TABLES_NAME_INDEX],
length[0], tbuf, COMMAND_SIZE-2); length[0], tbuf, COMMAND_SIZE-2);
sprintf(tableDes->cols[i].value, "%s", tbuf); sprintf(tableDes->cols[i].value, "%.*s", COL_VALUEBUF_LEN-1, tbuf);
break; break;
} }
case TSDB_DATA_TYPE_TIMESTAMP: case TSDB_DATA_TYPE_TIMESTAMP:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册