fix concat_ws and make_set report 4013 with more than 32 parameters
This commit is contained in:
@ -247,8 +247,7 @@ int ObExprConcatWs::calc_concat_ws_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDa
|
|||||||
} else if (sep->is_null()) {
|
} else if (sep->is_null()) {
|
||||||
res.set_null();
|
res.set_null();
|
||||||
} else {
|
} else {
|
||||||
ObIAllocator& calc_alloc = ctx.get_reset_tmp_alloc();
|
ObSEArray<ObString, 32> words;
|
||||||
ObSEArray<ObString, 32, ObIAllocator> words(OB_MALLOC_MIDDLE_BLOCK_SIZE, calc_alloc);
|
|
||||||
for (int64_t i = 1; OB_SUCC(ret) && i < expr.arg_cnt_; ++i) {
|
for (int64_t i = 1; OB_SUCC(ret) && i < expr.arg_cnt_; ++i) {
|
||||||
const ObDatum& dat = expr.locate_param_datum(ctx, i);
|
const ObDatum& dat = expr.locate_param_datum(ctx, i);
|
||||||
if (!dat.is_null() && OB_FAIL(words.push_back(dat.get_string()))) {
|
if (!dat.is_null() && OB_FAIL(words.push_back(dat.get_string()))) {
|
||||||
|
|||||||
@ -130,8 +130,7 @@ int ObExprMakeSet::calc_make_set_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatu
|
|||||||
if (expr.arg_cnt_ <= 64) {
|
if (expr.arg_cnt_ <= 64) {
|
||||||
input_bits &= ((ulonglong)1 << (expr.arg_cnt_ - 1)) - 1;
|
input_bits &= ((ulonglong)1 << (expr.arg_cnt_ - 1)) - 1;
|
||||||
}
|
}
|
||||||
ObIAllocator& calc_alloc = ctx.get_reset_tmp_alloc();
|
ObSEArray<ObString, 32> words;
|
||||||
ObSEArray<ObString, 32, ObIAllocator> words(OB_MALLOC_MIDDLE_BLOCK_SIZE, calc_alloc);
|
|
||||||
for (int64_t pos = 1, temp_input_bits = input_bits; OB_SUCC(ret) && temp_input_bits > 0;
|
for (int64_t pos = 1, temp_input_bits = input_bits; OB_SUCC(ret) && temp_input_bits > 0;
|
||||||
temp_input_bits >>= 1, ++pos) {
|
temp_input_bits >>= 1, ++pos) {
|
||||||
const ObDatum& dat = expr.locate_param_datum(ctx, pos);
|
const ObDatum& dat = expr.locate_param_datum(ctx, pos);
|
||||||
|
|||||||
Reference in New Issue
Block a user