提交 33d19d15 编写于 作者: O obdev 提交者: wangzelin.wzl

[CP] 【SQLancer】query result mismatch

上级 7433acf7
......@@ -202,13 +202,19 @@ int OB_INLINE ObExprOperator::cast_operand_type(
LOG_DEBUG(
"need cast operand", K(res_type), K(res_type.get_calc_meta().get_scale()), K(res_obj), K(res_obj.get_scale()));
ObCastMode cast_mode = get_cast_mode();
// In PAD expression, we need add COLUMN_CONVERT to cast mode when cast is
// from bit to binary and column convert is set in column_conv_ctx_. The COLUMN_CONVERT
// cast mode is used in bit_to_string to decide which cast way is appropriate.
if (OB_UNLIKELY(T_FUN_PAD == get_type() && ob_is_bit_tc(param_type) &&
ob_is_varbinary_type(calc_type, calc_collation_type) &&
CM_IS_COLUMN_CONVERT(expr_ctx.column_conv_ctx_.cast_mode_))) {
// In PAD expression, we need add COLUMN_CONVERT to cast mode when cast is
// from bit to binary and column convert is set in column_conv_ctx_. The COLUMN_CONVERT
// cast mode is used in bit_to_string to decide which cast way is appropriate.
cast_mode |= CM_COLUMN_CONVERT;
} else if (OB_UNLIKELY(T_FUN_SYS_BIT_COUNT == get_type() && ObIntType == param_type && ObUInt64Type == calc_type)) {
// when param_type is ObIntType and calc_type is ObUInt64Type,
// set CM_NO_RANGE_CHECK in cast_mode,
// so that res_obj will not convert to zero even res_obj is less than 0.
cast_mode |= CM_NO_RANGE_CHECK;
}
bool is_bool = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册