[fix](projections) Open the project expressions properly. (#13162)

In current 'ExecNode::open' function, the 'open(_projections)' is unreachable which might cause serious crashed. (#13150)
This commit is contained in:
Kikyou1997
2022-10-09 18:43:45 +08:00
committed by GitHub
parent 89514fc964
commit fc711d89c8
2 changed files with 5 additions and 6 deletions

View File

@ -249,14 +249,13 @@ Status ExecNode::open(RuntimeState* state) {
if (_vconjunct_ctx_ptr) {
RETURN_IF_ERROR((*_vconjunct_ctx_ptr)->open(state));
}
RETURN_IF_ERROR(vectorized::VExpr::open(_projections, state));
if (typeid(*this) != typeid(doris::vectorized::VOlapScanNode) &&
typeid(*this) != typeid(doris::vectorized::NewOlapScanNode)) {
return Expr::open(_conjunct_ctxs, state);
} else {
return Status::OK();
}
RETURN_IF_ERROR(Expr::open(_conjunct_ctxs, state));
return vectorized::VExpr::open(_projections, state);
}
Status ExecNode::reset(RuntimeState* state) {

View File

@ -24,7 +24,7 @@ Type before bug fix: varchar(*)
suite("test_view_varchar_length") {
sql """ DROP TABLE IF EXISTS T """
sql """
CREATE TABLE `T` (
CREATE TABLE `t_test_view_varchar_length` (
`id` int,
`name` varchar(32)
) ENGINE=OLAP
@ -36,13 +36,13 @@ Type before bug fix: varchar(*)
"storage_format" = "V2"
);
"""
sql "drop view if exists V;"
sql "drop view if exists v_test_view_varchar_length;"
sql """
create view V as select name from T;
create view v_test_view_varchar_length as select name from t_test_view_varchar_length;
"""
qt_sql """
desc V;
desc v_test_view_varchar_length;
"""
}