fix subquery pullup bug and fix select into plan bug

This commit is contained in:
zzg19950727
2023-02-06 17:32:09 +08:00
committed by ob-robot
parent 41a9e671ee
commit 998db59e91
4 changed files with 45 additions and 9 deletions

View File

@ -56,3 +56,23 @@ int ObLogSelectInto::compute_plan_type()
} else { /*do nothing*/ }
return ret;
}
int ObLogSelectInto::get_op_exprs(ObIArray<ObRawExpr*> &all_exprs)
{
int ret = OB_SUCCESS;
const ObDMLStmt *stmt = NULL;
const ObSelectStmt *sel_stmt = NULL;
if (OB_ISNULL(get_plan()) || OB_ISNULL(stmt = get_plan()->get_stmt())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected null", K(ret));
} else if (!stmt->is_select_stmt()) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected stmt type", K(ret));
} else if (OB_FALSE_IT(sel_stmt = static_cast<const ObSelectStmt*>(stmt))) {
} else if (OB_FAIL(sel_stmt->get_select_exprs(output_exprs_))) {
LOG_WARN("failed to get select exprs", K(ret));
} else if (OB_FAIL(ObLogicalOperator::get_op_exprs(all_exprs))) {
LOG_WARN("failed to get op exprs", K(ret));
} else { /*do nothing*/ }
return ret;
}

View File

@ -99,6 +99,7 @@ public:
}
virtual int est_cost() override;
virtual int compute_plan_type() override;
virtual int get_op_exprs(ObIArray<ObRawExpr*> &all_exprs) override;
private:
ObItemType into_type_;
common::ObObj outfile_name_;