提交 973bb073 编写于 作者: S slzhou

enhance: subquery can use expr primary key +/- value as primary key

上级 6e80f55e
...@@ -821,7 +821,19 @@ static bool isPrimaryKeyImpl(SNode* pExpr) { ...@@ -821,7 +821,19 @@ static bool isPrimaryKeyImpl(SNode* pExpr) {
FUNCTION_TYPE_IROWTS == pFunc->funcType) { FUNCTION_TYPE_IROWTS == pFunc->funcType) {
return true; return true;
} }
} } else if (QUERY_NODE_OPERATOR == nodeType(pExpr)) {
SOperatorNode* pOper = (SOperatorNode*)pExpr;
if (OP_TYPE_ADD != pOper->opType && OP_TYPE_SUB != pOper->opType) {
return false;
}
if (!isPrimaryKeyImpl(pOper->pLeft)) {
return false;
}
if (QUERY_NODE_VALUE != nodeType(pOper->pRight)) {
return false;
}
return true;
}
return false; return false;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册