Fix view merge bug when there is a rand() function in select items of view.

This commit is contained in:
my0
2021-09-17 10:24:34 +08:00
committed by wangzelin.wzl
parent 9e46649a49
commit a87cb43159
2 changed files with 15 additions and 1 deletions

View File

@ -346,7 +346,15 @@ int ObTransformViewMerge::check_can_be_unnested(
LOG_WARN("NULL expr", K(ret));
} else if (expr->has_flag(CNT_SUB_QUERY)) {
can_be = false;
} else { /*do nothing*/
}
}
// stmt不能包含rand函数 https://work.aone.alibaba-inc.com/issue/35875561
if (OB_SUCC(ret) && can_be) {
bool has_rand = false;
if (OB_FAIL(child_stmt->has_rand(has_rand))) {
LOG_WARN("failed to get rand flag", K(ret));
} else {
can_be = !has_rand;
}
}
}