From 9fba096e46973bf6887c219d04f7d763b4a78109 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 25 Nov 2020 12:13:11 +0800 Subject: [PATCH] [TD-2220]: fix the bug in column arithmetic expression. --- src/query/src/qAst.c | 2 +- tests/script/general/parser/col_arithmetic_query.sim | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/query/src/qAst.c b/src/query/src/qAst.c index 4190e26158..a65f4a6dc9 100644 --- a/src/query/src/qAst.c +++ b/src/query/src/qAst.c @@ -497,7 +497,7 @@ void tExprTreeCalcTraverse(tExprNode *pExprs, int32_t numOfRows, char *pOutput, _bi_consumer_fn_t fp = tGetBiConsumerFn(pLeft->pSchema->type, pRight->pSchema->type, pExprs->_node.optr); // both columns are descending order, do not reverse the source data - fp(pLeftInputData, pRightInputData, numOfRows, numOfRows, pOutput, TSDB_ORDER_DESC); + fp(pLeftInputData, pRightInputData, numOfRows, numOfRows, pOutput, order); } else if (pRight->nodeType == TSQL_NODE_VALUE) { // columnLeft + 12 _bi_consumer_fn_t fp = tGetBiConsumerFn(pLeft->pSchema->type, pRight->pVal->nType, pExprs->_node.optr); diff --git a/tests/script/general/parser/col_arithmetic_query.sim b/tests/script/general/parser/col_arithmetic_query.sim index 0739338d5a..2e15ed1ffd 100644 --- a/tests/script/general/parser/col_arithmetic_query.sim +++ b/tests/script/general/parser/col_arithmetic_query.sim @@ -113,19 +113,19 @@ if $data90 != 0.000000000 then return -1 endi -if $data11 != 0.000000000 then +if $data91 != 0.000000000 then return -1 endi -if $data12 != 0.000000000 then +if $data92 != 0.000000000 then return -1 endi -if $data13 != 0.000000000 then +if $data93 != 0.000000000 then return -1 endi -if $data14 != 0.000000000 then +if $data94 != 0.000000000 then return -1 endi