[CP] Fix cume_dist/percent_rank bug

This commit is contained in:
obdev
2023-09-08 10:40:37 +08:00
committed by ob-robot
parent 4ef22979ef
commit 8bb7c8394f
2 changed files with 16 additions and 6 deletions

View File

@ -2361,7 +2361,11 @@ int ObRawExprDeduceType::visit(ObWinFunRawExpr &expr)
// @TODO : nijia.nj, 细分各种window_funciton
if (T_WIN_FUN_CUME_DIST == expr.get_func_type() ||
T_WIN_FUN_PERCENT_RANK == expr.get_func_type()) {
if (is_oracle_mode()) {
const uint64_t ob_version = GET_MIN_CLUSTER_VERSION();
if (is_oracle_mode() ||
!((ob_version >= CLUSTER_VERSION_2277 && ob_version < CLUSTER_VERSION_3000)
|| (ob_version >= CLUSTER_VERSION_312 && ob_version < CLUSTER_VERSION_3200)
|| ob_version >= CLUSTER_VERSION_3_2_3_0)) {
result_type.set_accuracy(ObAccuracy::MAX_ACCURACY2[ORACLE_MODE][ObNumberType]);
result_type.set_calc_accuracy(ObAccuracy::MAX_ACCURACY2[ORACLE_MODE][ObNumberType]);
result_type.set_number();