fix expr pullup transform bug

This commit is contained in:
obdev
2022-12-13 03:41:51 +00:00
committed by ob-robot
parent e297460c69
commit 3bff3ea3cc
4 changed files with 79 additions and 22 deletions

View File

@ -3693,13 +3693,14 @@ int ObDMLStmt::get_equal_set_conditions(ObIArray<ObRawExpr *> &conditions,
// 1. where conditions
// 2. join conditions in joined tables
// 3. join conditions in semi/anti join
int ObDMLStmt::get_where_scope_conditions(ObIArray<ObRawExpr *> &conditions) const
int ObDMLStmt::get_where_scope_conditions(ObIArray<ObRawExpr *> &conditions,
bool outer_semi_only /* default false*/ ) const
{
int ret = OB_SUCCESS;
RelExprChecker expr_checker(conditions);
if (OB_FAIL(expr_checker.init())) {
LOG_WARN("init relexpr checker failed", K(ret));
} else if (OB_FAIL(append(conditions, condition_exprs_))) {
} else if (!outer_semi_only && OB_FAIL(append(conditions, condition_exprs_))) {
LOG_WARN("failed to append conditions", K(ret));
} else {
for (int64_t i = 0; OB_SUCC(ret) && i < joined_tables_.count(); ++i) {

View File

@ -1033,7 +1033,8 @@ public:
virtual int get_equal_set_conditions(ObIArray<ObRawExpr *> &conditions,
const bool is_strict,
const int check_scope) const;
int get_where_scope_conditions(ObIArray<ObRawExpr *> &conditions) const;
int get_where_scope_conditions(ObIArray<ObRawExpr *> &conditions,
bool outer_semi_only = false) const;
static int extract_equal_condition_from_joined_table(const TableItem *table,
ObIArray<ObRawExpr *> &equal_set_conditions,
const bool is_strict);