Partition sort check earlier and more strictly
This commit is contained in:
parent
0866a4b852
commit
4f65ea3349
@ -1762,6 +1762,16 @@ int ObStaticEngineCG::generate_spec(ObLogSort &op, ObSortSpec &spec, const bool
|
||||
spec.part_cnt_ = op.get_part_cnt();
|
||||
LOG_TRACE("trace order by", K(spec.all_exprs_.count()), K(spec.all_exprs_));
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
if (spec.sort_collations_.count() != spec.sort_cmp_funs_.count()
|
||||
|| (spec.part_cnt_ > 0 && spec.part_cnt_ >= spec.sort_collations_.count())) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("part cnt or sort size not meet the expection", K(ret),
|
||||
K(OB_NOT_NULL(op.get_topn_expr())), K(OB_NOT_NULL(op.get_topk_limit_expr())),
|
||||
K(spec.enable_encode_sortkey_opt_), K(spec.prefix_pos_), K(spec.is_local_merge_sort_),
|
||||
K(spec.part_cnt_), K(spec.sort_collations_.count()), K(spec.sort_cmp_funs_.count()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
@ -596,12 +596,11 @@ int ObSortOpImpl::init(
|
||||
} else if (OB_INVALID_ID == tenant_id) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid argument", K(ret), K(tenant_id));
|
||||
} else if (OB_ISNULL(sort_collations) || OB_ISNULL(sort_cmp_funs) || OB_ISNULL(eval_ctx)
|
||||
|| sort_collations->count() != sort_cmp_funs->count() || OB_ISNULL(exec_ctx)
|
||||
|| part_cnt > sort_collations->count()) {
|
||||
} else if (OB_ISNULL(sort_collations) || OB_ISNULL(sort_cmp_funs)
|
||||
|| OB_ISNULL(eval_ctx) || OB_ISNULL(exec_ctx)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid argument: argument is null", K(ret), K(tenant_id),
|
||||
K(sort_collations), K(sort_cmp_funs), K(eval_ctx), K(part_cnt));
|
||||
LOG_WARN("invalid argument: argument is null", K(ret),
|
||||
K(tenant_id), K(sort_collations), K(sort_cmp_funs), K(eval_ctx));
|
||||
} else if (OB_FAIL(comp_.init(sort_collations, sort_cmp_funs,
|
||||
exec_ctx, enable_encode_sortkey))) {
|
||||
LOG_WARN("failed to init compare functions", K(ret));
|
||||
|
Loading…
x
Reference in New Issue
Block a user