Fix dblink bugs

This commit is contained in:
xianyu-w
2023-03-17 02:40:51 +00:00
committed by ob-robot
parent 77f3afb799
commit 843888c953
8 changed files with 176 additions and 97 deletions

View File

@ -431,6 +431,16 @@ int ObTransformerImpl::choose_rewrite_rules(ObDMLStmt *stmt, uint64_t &need_type
}
if (func.contain_link_table_) {
disable_list |= (~ObTransformRule::ALL_HEURISTICS_RULES);
// Below rules might generate filter which contains constant values which has implicit types,
// which can not be printed in the link sql.
// example:
// create table t (c1 varchar(10), c2 char(10))
// select * from t where c1 = 'a' and c2 = c1;
// => select * from t where c1 = 'a' and c2 = implicit cast('a' as varchar);
ObTransformRule::add_trans_type(disable_list, PREDICATE_MOVE_AROUND);
ObTransformRule::add_trans_type(disable_list, CONST_PROPAGATE);
ObTransformRule::add_trans_type(disable_list, SIMPLIFY_EXPR);
}
need_types = ObTransformRule::ALL_TRANSFORM_RULES & (~disable_list);
}