patch 4.0

This commit is contained in:
wangzelin.wzl
2022-10-24 10:34:53 +08:00
parent 4ad6e00ec3
commit 93a1074b0c
10533 changed files with 2588271 additions and 2299373 deletions

View File

@ -13,12 +13,14 @@
#define USING_LOG_PREFIX SQL_JO
#include "sql/optimizer/ob_fd_item.h"
#include "sql/optimizer/ob_optimizer_util.h"
#include "sql/optimizer/ob_fd_item.h"
using namespace oceanbase;
using namespace sql;
using namespace oceanbase::common;
int ObFdItem::assign(const ObFdItem& other)
int ObFdItem::assign(const ObFdItem &other)
{
parent_exprs_ = other.parent_exprs_;
is_unique_ = other.is_unique_;
@ -26,7 +28,9 @@ int ObFdItem::assign(const ObFdItem& other)
return OB_SUCCESS;
}
int ObFdItem::check_expr_in_child(const ObRawExpr* expr, const EqualSets& equal_sets, bool& is_in_child) const
int ObFdItem::check_expr_in_child(const ObRawExpr *expr,
const EqualSets &equal_sets,
bool &is_in_child) const
{
int ret = OB_SUCCESS;
UNUSED(expr);
@ -35,8 +39,9 @@ int ObFdItem::check_expr_in_child(const ObRawExpr* expr, const EqualSets& equal_
return ret;
}
int ObFdItem::check_exprs_in_child(
const ObIArray<ObRawExpr*>& exprs, const EqualSets& equal_sets, bool& is_in_child) const
int ObFdItem::check_exprs_in_child(const ObIArray<ObRawExpr *> &exprs,
const EqualSets &equal_sets,
bool &is_in_child) const
{
int ret = OB_SUCCESS;
is_in_child = true;
@ -48,8 +53,10 @@ int ObFdItem::check_exprs_in_child(
return ret;
}
int ObFdItem::check_exprs_in_child(
const ObIArray<ObRawExpr*>& exprs, const EqualSets& equal_sets, const int64_t pos_start, ObSqlBitSet<> exprs_set)
int ObFdItem::check_exprs_in_child(const ObIArray<ObRawExpr *> &exprs,
const EqualSets &equal_sets,
const int64_t pos_start,
ObBitSet<> &exprs_set)
{
int ret = OB_SUCCESS;
bool in_child = false;
@ -69,8 +76,10 @@ int ObFdItem::check_exprs_in_child(
return ret;
}
int ObFdItem::check_exprs_in_child(const common::ObIArray<OrderItem>& order_items, const EqualSets& equal_sets,
const int64_t pos_start, ObSqlBitSet<> exprs_set)
int ObFdItem::check_exprs_in_child(const common::ObIArray<OrderItem> &order_items,
const EqualSets &equal_sets,
const int64_t pos_start,
ObBitSet<> &exprs_set)
{
int ret = OB_SUCCESS;
bool in_child = false;
@ -90,7 +99,7 @@ int ObFdItem::check_exprs_in_child(const common::ObIArray<OrderItem>& order_item
return ret;
}
int ObTableFdItem::assign(const ObTableFdItem& other)
int ObTableFdItem::assign(const ObTableFdItem &other)
{
int ret = OB_SUCCESS;
if (OB_LIKELY(this != &other)) {
@ -103,10 +112,12 @@ int ObTableFdItem::assign(const ObTableFdItem& other)
return ret;
}
int ObTableFdItem::check_expr_in_child(const ObRawExpr* expr, const EqualSets& equal_sets, bool& is_in_child) const
int ObTableFdItem::check_expr_in_child(const ObRawExpr *expr,
const EqualSets &equal_sets,
bool &is_in_child) const
{
int ret = OB_SUCCESS;
const ObRawExpr* cur_expr = NULL;
const ObRawExpr *cur_expr = NULL;
bool is_consistent = false;
is_in_child = false;
if (OB_ISNULL(expr)) {
@ -115,23 +126,24 @@ int ObTableFdItem::check_expr_in_child(const ObRawExpr* expr, const EqualSets& e
} else if (expr->has_flag(CNT_AGG)) {
//do nothing
} else if (expr->get_expr_levels().has_member(stmt_level_)) {
if (!expr->get_relation_ids().is_empty() && child_tables_.is_superset(expr->get_relation_ids())) {
if (!expr->get_relation_ids().is_empty() &&
child_tables_.is_superset(expr->get_relation_ids())) {
is_in_child = true;
}
for (int64_t i = 0; OB_SUCC(ret) && !is_in_child && i < equal_sets.count(); ++i) {
const EqualSet* equal_set = equal_sets.at(i);
const EqualSet *equal_set = equal_sets.at(i);
if (OB_ISNULL(equal_set)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get null equal set", K(ret));
} else if (!ObOptimizerUtil::find_equal_expr(*equal_set, expr)) {
continue;
}
}
for (int64_t j = 0; OB_SUCC(ret) && !is_in_child && j < equal_set->count(); ++j) {
if (OB_ISNULL(cur_expr = equal_set->at(j))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get null expr", K(ret));
} else if (cur_expr->get_relation_ids().is_empty() ||
!child_tables_.is_superset(cur_expr->get_relation_ids())) {
} else if (cur_expr->get_relation_ids().is_empty() ||
!child_tables_.is_superset(cur_expr->get_relation_ids())) {
// do nothing
} else if (OB_FAIL(ObRawExprUtils::expr_is_order_consistent(cur_expr, expr, is_consistent))) {
LOG_WARN("failed to check expr is order consistent", K(ret));
@ -144,7 +156,7 @@ int ObTableFdItem::check_expr_in_child(const ObRawExpr* expr, const EqualSets& e
return ret;
}
int ObExprFdItem::assign(const ObExprFdItem& other)
int ObExprFdItem::assign(const ObExprFdItem &other)
{
int ret = OB_SUCCESS;
if (OB_LIKELY(this != &other)) {
@ -157,21 +169,23 @@ int ObExprFdItem::assign(const ObExprFdItem& other)
return ret;
}
int ObExprFdItem::check_expr_in_child(const ObRawExpr* expr, const EqualSets& equal_sets, bool& is_in_child) const
int ObExprFdItem::check_expr_in_child(const ObRawExpr *expr,
const EqualSets &equal_sets,
bool &is_in_child) const
{
int ret = OB_SUCCESS;
is_in_child = ObOptimizerUtil::find_equal_expr(child_exprs_, expr, equal_sets);
return ret;
}
int ObFdItemFactory::create_fd_item_set(ObFdItemSet*& fd_item_set)
int ObFdItemFactory::create_fd_item_set(ObFdItemSet *&fd_item_set)
{
int ret = OB_SUCCESS;
if (OB_ISNULL(fd_item_set = (ObFdItemSet*)allocator_.alloc(sizeof(ObFdItemSet)))) {
if (OB_ISNULL(fd_item_set = (ObFdItemSet *)allocator_.alloc(sizeof(ObFdItemSet)))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("failed to alloc fd item sets", K(ret));
} else {
fd_item_set = new (fd_item_set) ObFdItemSet();
fd_item_set = new(fd_item_set) ObFdItemSet();
if (OB_FAIL(item_set_store_.store_obj(fd_item_set))) {
LOG_WARN("failed to store obj", K(ret));
fd_item_set->~ObFdItemSet();
@ -181,10 +195,11 @@ int ObFdItemFactory::create_fd_item_set(ObFdItemSet*& fd_item_set)
return ret;
}
int ObFdItemFactory::get_parent_exprs_ptr(ObRawExpr* parent_expr, ObRawExprSet*& parent_exprs_ptr)
int ObFdItemFactory::get_parent_exprs_ptr(ObRawExpr *parent_expr,
ObRawExprSet *&parent_exprs_ptr)
{
int ret = OB_SUCCESS;
ObSEArray<ObRawExpr*, 1> parent_exprs;
ObSEArray<ObRawExpr *, 1> parent_exprs;
if (OB_FAIL(parent_exprs.push_back(parent_expr))) {
LOG_WARN("failed to push back expr", K(ret));
} else {
@ -193,7 +208,8 @@ int ObFdItemFactory::get_parent_exprs_ptr(ObRawExpr* parent_expr, ObRawExprSet*&
return ret;
}
int ObFdItemFactory::get_parent_exprs_ptr(const ObIArray<ObRawExpr*>& parent_exprs, ObRawExprSet*& parent_exprs_ptr)
int ObFdItemFactory::get_parent_exprs_ptr(const ObIArray<ObRawExpr *> &parent_exprs,
ObRawExprSet *&parent_exprs_ptr)
{
int ret = OB_SUCCESS;
parent_exprs_ptr = NULL;
@ -214,7 +230,7 @@ int ObFdItemFactory::get_parent_exprs_ptr(const ObIArray<ObRawExpr*>& parent_exp
}
}
// if not exists, create new one
if (find) {
if (find) {
// do nothing
} else if (OB_FAIL(ObRawExprSetUtils::add_expr_set(&allocator_, parent_exprs, parent_sets_))) {
LOG_WARN("failed to add expr set", K(ret));
@ -225,17 +241,19 @@ int ObFdItemFactory::get_parent_exprs_ptr(const ObIArray<ObRawExpr*>& parent_exp
return ret;
}
int ObFdItemFactory::create_table_fd_item(
ObTableFdItem*& fd_item, const bool is_unique, ObRawExprSet* parent_exprs, const int32_t stmt_level)
int ObFdItemFactory::create_table_fd_item(ObTableFdItem *&fd_item,
const bool is_unique,
ObRawExprSet *parent_exprs,
const int32_t stmt_level)
{
int ret = OB_SUCCESS;
fd_item = NULL;
void* ptr = allocator_.alloc(sizeof(ObTableFdItem));
void *ptr = allocator_.alloc(sizeof(ObTableFdItem));
if (OB_ISNULL(ptr)) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("no memory to create ObTableFdItem", K(ret));
} else {
fd_item = new (ptr) ObTableFdItem(is_unique, parent_exprs, stmt_level);
fd_item = new(ptr) ObTableFdItem(is_unique, parent_exprs, stmt_level);
if (OB_FAIL(item_store_.store_obj(fd_item))) {
LOG_WARN("failed to store obj", K(ret));
fd_item->~ObTableFdItem();
@ -245,12 +263,15 @@ int ObFdItemFactory::create_table_fd_item(
return ret;
}
int ObFdItemFactory::create_table_fd_item(ObTableFdItem*& fd_item, const bool is_unique,
const ObIArray<ObRawExpr*>& parent_exprs, const int32_t stmt_level, const ObRelIds& table_set)
int ObFdItemFactory::create_table_fd_item(ObTableFdItem *&fd_item,
const bool is_unique,
const ObIArray<ObRawExpr *> &parent_exprs,
const int32_t stmt_level,
const ObRelIds &table_set)
{
int ret = OB_SUCCESS;
fd_item = NULL;
ObRawExprSet* parent_exprs_ptr = NULL;
ObRawExprSet *parent_exprs_ptr = NULL;
if (OB_FAIL(get_parent_exprs_ptr(parent_exprs, parent_exprs_ptr))) {
LOG_WARN("failed to get parent exprs ptr", K(ret));
} else if (OB_FAIL(create_table_fd_item(fd_item, is_unique, parent_exprs_ptr, stmt_level))) {
@ -261,11 +282,15 @@ int ObFdItemFactory::create_table_fd_item(ObTableFdItem*& fd_item, const bool is
return ret;
}
int ObFdItemFactory::create_table_fd_item(ObTableFdItem*& fd_item, const ObTableFdItem& other)
int ObFdItemFactory::create_table_fd_item(ObTableFdItem *&fd_item,
const ObTableFdItem &other)
{
int ret = OB_SUCCESS;
fd_item = NULL;
if (OB_FAIL(create_table_fd_item(fd_item, other.is_unique(), other.get_parent_exprs(), other.get_stmt_level()))) {
if (OB_FAIL(create_table_fd_item(fd_item,
other.is_unique(),
other.get_parent_exprs(),
other.get_stmt_level()))) {
LOG_WARN("failed to create table fd item", K(ret));
} else if (OB_FAIL(fd_item->get_child_tables().add_members(other.get_child_tables()))) {
LOG_WARN("failed to add member to child tables", K(ret));
@ -273,17 +298,19 @@ int ObFdItemFactory::create_table_fd_item(ObTableFdItem*& fd_item, const ObTable
return ret;
}
int ObFdItemFactory::create_expr_fd_item(
ObExprFdItem*& fd_item, const bool is_unique, ObRawExprSet* parent_exprs, const int32_t stmt_level)
int ObFdItemFactory::create_expr_fd_item(ObExprFdItem *&fd_item,
const bool is_unique,
ObRawExprSet *parent_exprs,
const int32_t stmt_level)
{
int ret = OB_SUCCESS;
fd_item = NULL;
void* ptr = allocator_.alloc(sizeof(ObExprFdItem));
void *ptr = allocator_.alloc(sizeof(ObExprFdItem));
if (OB_ISNULL(ptr)) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("no memory to create ObExprFdItem", K(ret));
} else {
fd_item = new (ptr) ObExprFdItem(is_unique, parent_exprs, stmt_level);
fd_item = new(ptr) ObExprFdItem(is_unique, parent_exprs, stmt_level);
if (OB_FAIL(item_store_.store_obj(fd_item))) {
LOG_WARN("failed to store obj", K(ret));
fd_item->~ObExprFdItem();
@ -293,27 +320,36 @@ int ObFdItemFactory::create_expr_fd_item(
return ret;
}
int ObFdItemFactory::create_expr_fd_item(ObExprFdItem*& fd_item, const bool is_unique,
const ObIArray<ObRawExpr*>& parent_exprs, const int32_t stmt_level, const ObIArray<ObRawExpr*>& child_exprs)
int ObFdItemFactory::create_expr_fd_item(ObExprFdItem *&fd_item,
const bool is_unique,
const ObIArray<ObRawExpr *> &parent_exprs,
const int32_t stmt_level,
const ObIArray<ObRawExpr *> &child_exprs)
{
int ret = OB_SUCCESS;
fd_item = NULL;
ObRawExprSet* parent_exprs_ptr = NULL;
ObRawExprSet *parent_exprs_ptr = NULL;
if (OB_FAIL(get_parent_exprs_ptr(parent_exprs, parent_exprs_ptr))) {
LOG_WARN("failed to get parent exprs ptr", K(ret));
} else if (OB_FAIL(create_expr_fd_item(fd_item, is_unique, parent_exprs_ptr, stmt_level))) {
LOG_WARN("failed to create table fd item", K(ret));
} else if (OB_FAIL(ObRawExprSetUtils::to_expr_set(&allocator_, child_exprs, fd_item->get_child_exprs()))) {
} else if (OB_FAIL(ObRawExprSetUtils::to_expr_set(&allocator_,
child_exprs,
fd_item->get_child_exprs()))) {
LOG_WARN("failed to expr set", K(ret));
}
return ret;
}
int ObFdItemFactory::create_expr_fd_item(ObExprFdItem*& fd_item, const ObExprFdItem& other)
int ObFdItemFactory::create_expr_fd_item(ObExprFdItem *&fd_item,
const ObExprFdItem &other)
{
int ret = OB_SUCCESS;
fd_item = NULL;
if (OB_FAIL(create_expr_fd_item(fd_item, other.is_unique(), other.get_parent_exprs(), other.get_stmt_level()))) {
if (OB_FAIL(create_expr_fd_item(fd_item,
other.is_unique(),
other.get_parent_exprs(),
other.get_stmt_level()))) {
LOG_WARN("failed to create table fd item", K(ret));
} else if (OB_FAIL(fd_item->get_child_exprs().assign(other.get_child_exprs()))) {
LOG_WARN("failed to assign child exprs", K(ret));
@ -321,19 +357,19 @@ int ObFdItemFactory::create_expr_fd_item(ObExprFdItem*& fd_item, const ObExprFdI
return ret;
}
int ObFdItemFactory::copy_fd_item(ObFdItem*& fd_item, const ObFdItem& other)
int ObFdItemFactory::copy_fd_item(ObFdItem *&fd_item, const ObFdItem &other)
{
int ret = OB_SUCCESS;
if (other.is_table_fd_item()) {
ObTableFdItem* table_fd_item = NULL;
if (OB_FAIL(create_table_fd_item(table_fd_item, static_cast<const ObTableFdItem&>(other)))) {
ObTableFdItem *table_fd_item = NULL;
if (OB_FAIL(create_table_fd_item(table_fd_item, static_cast<const ObTableFdItem &>(other)))) {
LOG_WARN("failed to create table fd item", K(ret));
} else {
fd_item = table_fd_item;
}
} else if (other.is_expr_fd_item()) {
ObExprFdItem* expr_fd_item = NULL;
if (OB_FAIL(create_expr_fd_item(expr_fd_item, static_cast<const ObExprFdItem&>(other)))) {
ObExprFdItem *expr_fd_item = NULL;
if (OB_FAIL(create_expr_fd_item(expr_fd_item, static_cast<const ObExprFdItem &>(other)))) {
LOG_WARN("failed to create expr fd item", K(ret));
} else {
fd_item = expr_fd_item;
@ -345,118 +381,70 @@ int ObFdItemFactory::copy_fd_item(ObFdItem*& fd_item, const ObFdItem& other)
return ret;
}
int ObFdItemFactory::deduce_fd_item_set(const EqualSets& equal_sets, ObIArray<ObRawExpr*>& column_exprs,
ObIArray<ObRawExpr*>& const_exprs, ObFdItemSet& fd_item_set)
int ObFdItemFactory::deduce_fd_item_set(const EqualSets &equal_sets,
ObIArray<ObRawExpr *> &column_exprs,
ObIArray<ObRawExpr *> &const_exprs,
ObFdItemSet &fd_item_set)
{
int ret = OB_SUCCESS;
bool is_happend = true;
ObSqlBitSet<> deduced_fd;
ObSEArray<ObFdItem*, 8> new_fd_items;
int64_t const_exprs_count = -1;
if (OB_FAIL(ObOptimizerUtil::remove_equal_exprs(equal_sets, const_exprs, column_exprs))) {
LOG_WARN("failed to remove equal exprs", K(ret));
}
for (int64_t i = 0; OB_SUCC(ret) && const_exprs.count() > const_exprs_count && i < 10; i++) {
do {
const_exprs_count = const_exprs.count();
if (OB_FAIL(do_deduce_fd_item_set(
equal_sets, column_exprs, const_exprs, fd_item_set, false, deduced_fd, new_fd_items))) {
if (OB_FAIL(do_deduce_fd_item_set(equal_sets, column_exprs, const_exprs,
fd_item_set, deduced_fd))) {
LOG_WARN("failed to simplify fd item", K(ret));
}
}
if (OB_FAIL(ret)) {
/*do nothing*/
} else if (OB_FAIL(do_deduce_fd_item_set(
equal_sets, column_exprs, const_exprs, fd_item_set, true, deduced_fd, new_fd_items))) {
LOG_WARN("failed to simplify fd item", K(ret));
} else if (OB_FAIL(append(fd_item_set, new_fd_items))) {
LOG_WARN("failed to append fd items", K(ret));
}
} while (OB_SUCC(ret) && const_exprs.count() != const_exprs_count);
return ret;
}
int ObFdItemFactory::do_deduce_fd_item_set(const EqualSets& equal_sets, ObIArray<ObRawExpr*>& column_exprs,
ObIArray<ObRawExpr*>& const_exprs, ObFdItemSet& fd_item_set, const bool final_deduce, ObSqlBitSet<>& deduced_fd,
ObIArray<ObFdItem*>& new_fd_items)
//If all parent exprs are const, add child exprs to const_exprs
int ObFdItemFactory::do_deduce_fd_item_set(const EqualSets &equal_sets,
ObIArray<ObRawExpr *> &column_exprs,
ObIArray<ObRawExpr *> &const_exprs,
ObFdItemSet &fd_item_set,
ObSqlBitSet<> &deduced_fd)
{
int ret = OB_SUCCESS;
for (int64_t i = 0; OB_SUCC(ret) && i < fd_item_set.count(); i++) {
ObFdItem* fd_item = NULL;
ObRawExprSet* parent_exprs = NULL;
if (OB_ISNULL(fd_item = fd_item_set.at(i)) || OB_ISNULL(parent_exprs = fd_item->get_parent_exprs())) {
ObFdItem *fd_item = NULL;
ObRawExprSet *parent_exprs = NULL;
if (OB_ISNULL(fd_item = fd_item_set.at(i))
|| OB_ISNULL(parent_exprs = fd_item->get_parent_exprs())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected null", K(ret));
} else if (deduced_fd.has_member(i)) { // has deduced
} else if (deduced_fd.has_member(i)) {// has deduced
/*do nothing*/
} else {
ObSEArray<ObRawExpr*, 8> const_parent_exprs;
ObSEArray<ObRawExpr*, 8> other_parent_exprs;
bool is_expr_const = false;
for (int64_t j = 0; OB_SUCC(ret) && j < parent_exprs->count(); j++) {
if (OB_FAIL(ObOptimizerUtil::is_const_expr(parent_exprs->at(j), equal_sets, const_exprs, is_expr_const))) {
bool all_const = true;
for (int64_t j = 0; all_const && OB_SUCC(ret) && j < parent_exprs->count(); j++) {
if (OB_FAIL(ObOptimizerUtil::is_const_expr(parent_exprs->at(j), equal_sets,
const_exprs, all_const))) {
LOG_WARN("failed to check is const expr", K(ret));
} else if (is_expr_const) {
ret = const_parent_exprs.push_back(parent_exprs->at(j));
} else {
ret = other_parent_exprs.push_back(parent_exprs->at(j));
}
}
if (const_parent_exprs.empty() && other_parent_exprs.empty()) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected fd", K(ret), K(*fd_item));
} else if (other_parent_exprs.empty()) {
if (OB_SUCC(ret) && all_const) { // all parent exprs is const, add const exprs
bool is_in_child = false;
ObSEArray<ObRawExpr*, 8> other_column_exprs;
int64_t cnt = 0;
ObRawExpr *expr = NULL;
for (int64_t j = 0; OB_SUCC(ret) && j < column_exprs.count(); j++) {
if (OB_FAIL(fd_item->check_expr_in_child(column_exprs.at(j), equal_sets, is_in_child))) {
if (OB_ISNULL(expr = column_exprs.at(j))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpected null", K(expr), K(ret));
} else if (expr->is_const_expr() || ObOptimizerUtil::find_item(const_exprs, expr)) {
/* do nothing */
} else if (OB_FAIL(fd_item->check_expr_in_child(expr, equal_sets, is_in_child))) {
LOG_WARN("failed to check expr in child", K(ret));
} else if (is_in_child) {
ret = const_exprs.push_back(column_exprs.at(j));
} else {
ret = other_column_exprs.push_back(column_exprs.at(j));
} else if (!is_in_child) {
column_exprs.at(cnt++) = expr;
} else if (OB_FAIL(const_exprs.push_back(expr))) { // add const exprs
LOG_WARN("failed to push back", K(ret));
}
}
if (OB_SUCC(ret) && OB_FAIL(column_exprs.assign(other_column_exprs))) {
LOG_WARN("failed to assign exprs", K(ret));
if (OB_SUCC(ret)) {
ObOptimizerUtil::revert_items(column_exprs, cnt);
}
ObFdItem* new_fd_item = NULL;
ObRawExprSet* parent_exprs_ptr = NULL;
if (OB_FAIL(ret) || 1 == const_parent_exprs.count()) {
/*do nothing*/
} else {
for (int64_t j = 0; OB_SUCC(ret) && j < const_parent_exprs.count(); j++) {
if (OB_FAIL(get_parent_exprs_ptr(const_parent_exprs.at(j), parent_exprs_ptr))) {
LOG_WARN("failed to get parent exprs ptr", K(ret));
} else if (OB_FAIL(copy_fd_item(new_fd_item, *fd_item))) {
LOG_WARN("failed to copy fd item", K(ret));
} else if (0 == j) {
new_fd_item->set_parent_exprs(parent_exprs_ptr);
fd_item_set.at(i) = new_fd_item;
} else if (new_fd_items.push_back(new_fd_item)) {
LOG_WARN("failed to push back fd item", K(ret));
} else {
new_fd_item->set_parent_exprs(parent_exprs_ptr);
}
}
}
if (OB_SUCC(ret) && OB_FAIL(deduced_fd.add_member(i))) {
LOG_WARN("failed to assign exprs", K(ret));
}
} else if (final_deduce && !const_parent_exprs.empty()) {
ObRawExprSet* parent_exprs_ptr = NULL;
ObFdItem *new_fd_item = NULL;
if (OB_FAIL(get_parent_exprs_ptr(other_parent_exprs, parent_exprs_ptr))) {
LOG_WARN("failed to get parent exprs ptr", K(ret));
} else if (OB_FAIL(copy_fd_item(new_fd_item, *fd_item))) {
LOG_WARN("failed to copy fd item", K(ret));
} else {
new_fd_item->set_parent_exprs(parent_exprs_ptr);
fd_item_set.at(i) = new_fd_item;
}
} else { /*do nothing*/
}
}
}