Merge pull request #26543 from taosdata/fix/3.0/TD-30951
fix project with bool condition node
This commit is contained in:
commit
dd6674fe38
|
@ -1777,6 +1777,19 @@ int32_t createExprFromOneNode(SExprInfo* pExp, SNode* pNode, int16_t slotId) {
|
||||||
pExp->base.resSchema =
|
pExp->base.resSchema =
|
||||||
createResSchema(pType->type, pType->bytes, slotId, pType->scale, pType->precision, pCaseNode->node.aliasName);
|
createResSchema(pType->type, pType->bytes, slotId, pType->scale, pType->precision, pCaseNode->node.aliasName);
|
||||||
pExp->pExpr->_optrRoot.pRootNode = pNode;
|
pExp->pExpr->_optrRoot.pRootNode = pNode;
|
||||||
|
} else if (type == QUERY_NODE_LOGIC_CONDITION) {
|
||||||
|
pExp->pExpr->nodeType = QUERY_NODE_OPERATOR;
|
||||||
|
SLogicConditionNode* pCond = (SLogicConditionNode*)pNode;
|
||||||
|
pExp->base.pParam = taosMemoryCalloc(1, sizeof(SFunctParam));
|
||||||
|
if (!pExp->base.pParam) {
|
||||||
|
code = terrno;
|
||||||
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
pExp->base.numOfParams = 1;
|
||||||
|
SDataType* pType = &pCond->node.resType;
|
||||||
|
pExp->base.resSchema = createResSchema(pType->type, pType->bytes, slotId, pType->scale, pType->precision, pCond->node.aliasName);
|
||||||
|
pExp->pExpr->_optrRoot.pRootNode = pNode;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,8 @@ class TDTestCase:
|
||||||
|
|
||||||
tdSql.query("select * from (select ts, col1 from sta partition by tbname) limit 2");
|
tdSql.query("select * from (select ts, col1 from sta partition by tbname) limit 2");
|
||||||
tdSql.checkRows(2)
|
tdSql.checkRows(2)
|
||||||
|
tdSql.query('select col1 > 0 and col2 > 0 from stb')
|
||||||
|
tdSql.checkRows(12)
|
||||||
def stop(self):
|
def stop(self):
|
||||||
tdSql.close()
|
tdSql.close()
|
||||||
tdLog.success("%s successfully executed" % __file__)
|
tdLog.success("%s successfully executed" % __file__)
|
||||||
|
|
Loading…
Reference in New Issue