diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 5db7e18fc5..3bb9e15182 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -887,7 +887,8 @@ _err: } static int32_t addParamToLogicConditionNode(SLogicConditionNode* pCond, SNode* pParam) { - if (QUERY_NODE_LOGIC_CONDITION == nodeType(pParam) && pCond->condType == ((SLogicConditionNode*)pParam)->condType) { + if (QUERY_NODE_LOGIC_CONDITION == nodeType(pParam) && pCond->condType == ((SLogicConditionNode*)pParam)->condType && + ((SLogicConditionNode*)pParam)->condType != LOGIC_COND_TYPE_NOT) { int32_t code = nodesListAppendList(pCond->pParameterList, ((SLogicConditionNode*)pParam)->pParameterList); ((SLogicConditionNode*)pParam)->pParameterList = NULL; nodesDestroyNode(pParam); diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index 3df42cbf33..eb975ec46f 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -225,6 +225,7 @@ python3 test.py -f query/distinctOneColTb.py python3 ./test.py -f query/filter.py python3 ./test.py -f query/filterCombo.py python3 ./test.py -f query/queryNormal.py +python3 ./test.py -f query/not.py python3 ./test.py -f query/queryError.py python3 ./test.py -f query/filterAllIntTypes.py python3 ./test.py -f query/filterFloatAndDouble.py diff --git a/tests/pytest/regressiontest.sh b/tests/pytest/regressiontest.sh index b69ee37a55..e42d53ded1 100755 --- a/tests/pytest/regressiontest.sh +++ b/tests/pytest/regressiontest.sh @@ -139,6 +139,7 @@ python3 ./test.py -f query/querySort.py python3 ./test.py -f query/queryJoin.py python3 ./test.py -f query/filterCombo.py python3 ./test.py -f query/queryNormal.py +python3 ./test.py -f query/not.py python3 ./test.py -f query/select_last_crash.py python3 ./test.py -f query/queryNullValueTest.py python3 ./test.py -f query/queryInsertValue.py diff --git a/tests/system-test/2-query/not.py b/tests/system-test/2-query/not.py index a0bd1d4e1d..1254226db3 100644 --- a/tests/system-test/2-query/not.py +++ b/tests/system-test/2-query/not.py @@ -98,24 +98,23 @@ class TDTestCase: tdsql.checkData(0, 1, 10) tdsql.checkData(1, 1, 30) - # tdsql.query(f"select * from {dbname}.{stbname} where not(not (v1 < 20 or v1 > 30)) order by t1") - # tdsql.checkRows(1) - # - # tdsql.checkData(0, 1, 20) - # tdsql.query(f"select * from {dbname}.{stbname} where not(not (v1 < 20 or v1 >= 30)) order by t1") - # tdsql.checkRows(2) - # - # tdsql.query(f"select * from {dbname}.{stbname} where not(not (t1 != 1)) order by t1") - # tdsql.checkRows(2) - # - # tdsql.query(f"select * from {dbname}.{stbname} where not(not (t1 > 2)) order by t1") - # tdsql.checkRows(1) - # - # tdsql.query(f"select * from {dbname}.{stbname} where not(not (t1 == 2)) order by t1") - # tdsql.checkRows(1) - # - # tdsql.query(f"select * from {dbname}.{stbname} where not(not (v1 > 10 and v1 < 30)) order by t1") - # tdsql.checkRows(1) + tdsql.query(f"select * from {dbname}.{stbname} where not(not (v1 < 20 or v1 > 30)) order by t1") + tdsql.checkRows(1) + + tdsql.query(f"select * from {dbname}.{stbname} where not(not (v1 < 20 or v1 >= 30)) order by t1") + tdsql.checkRows(2) + + tdsql.query(f"select * from {dbname}.{stbname} where not(not (t1 != 1)) order by t1") + tdsql.checkRows(2) + + tdsql.query(f"select * from {dbname}.{stbname} where not(not (t1 > 2)) order by t1") + tdsql.checkRows(1) + + tdsql.query(f"select * from {dbname}.{stbname} where not(not (t1 == 2)) order by t1") + tdsql.checkRows(1) + + tdsql.query(f"select * from {dbname}.{stbname} where not(not (v1 > 10 and v1 < 30)) order by t1") + tdsql.checkRows(1) def run(self): dbname = "db" diff --git a/tests/system-test/runAllOne.sh b/tests/system-test/runAllOne.sh index 3bb128ea28..0d65fd616b 100644 --- a/tests/system-test/runAllOne.sh +++ b/tests/system-test/runAllOne.sh @@ -245,6 +245,8 @@ python3 ./test.py -f 2-query/min.py -P python3 ./test.py -f 2-query/min.py -P -R python3 ./test.py -f 2-query/normal.py -P python3 ./test.py -f 2-query/normal.py -P -R +python3 ./test.py -f 2-query/not.py -P +python3 ./test.py -f 2-query/not.py -P -R python3 ./test.py -f 2-query/mode.py -P python3 ./test.py -f 2-query/mode.py -P -R python3 ./test.py -f 2-query/Now.py -P @@ -427,6 +429,7 @@ python3 ./test.py -f 2-query/Today.py -P -Q 2 python3 ./test.py -f 2-query/max.py -P -Q 2 python3 ./test.py -f 2-query/min.py -P -Q 2 python3 ./test.py -f 2-query/normal.py -P -Q 2 +python3 ./test.py -f 2-query/not.py -P -Q 2 python3 ./test.py -f 2-query/mode.py -P -Q 2 python3 ./test.py -f 2-query/count.py -P -Q 2 python3 ./test.py -f 2-query/countAlwaysReturnValue.py -P -Q 2 @@ -526,6 +529,7 @@ python3 ./test.py -f 2-query/Today.py -P -Q 3 python3 ./test.py -f 2-query/max.py -P -Q 3 python3 ./test.py -f 2-query/min.py -P -Q 3 python3 ./test.py -f 2-query/normal.py -P -Q 3 +python3 ./test.py -f 2-query/not.py -P -Q 3 python3 ./test.py -f 2-query/mode.py -P -Q 3 python3 ./test.py -f 2-query/count.py -P -Q 3 python3 ./test.py -f 2-query/countAlwaysReturnValue.py -P -Q 3 @@ -624,6 +628,7 @@ python3 ./test.py -f 2-query/Today.py -P -Q 4 python3 ./test.py -f 2-query/max.py -P -Q 4 python3 ./test.py -f 2-query/min.py -P -Q 4 python3 ./test.py -f 2-query/normal.py -P -Q 4 +python3 ./test.py -f 2-query/not.py -P -Q 4 python3 ./test.py -f 2-query/mode.py -P -Q 4 python3 ./test.py -f 2-query/count.py -P -Q 4 python3 ./test.py -f 2-query/countAlwaysReturnValue.py -P -Q 4