[FEAT MERGE] Support gb18030_2022

This commit is contained in:
xianyu-w
2023-04-26 15:13:03 +00:00
committed by ob-robot
parent ef51ca80f8
commit 3efcefc29e
27 changed files with 32100 additions and 855 deletions

View File

@ -235,10 +235,17 @@ int ObExprConvertOracle::calc_convert_oracle_expr(const ObExpr &expr,
ObTextStringDatumResult output_result(expr.datum_meta_.type_, &expr, &ctx, &res_datum);
int64_t src_byte_len = 0;
int64_t buf_size = 0;
ObCharsetType src_cs = ObCharset::charset_type_by_coll(src_cs_type);
ObCharsetType dst_cs = ObCharset::charset_type_by_coll(dst_cs_type);
if (ob_is_string_tc(expr.datum_meta_.type_)
&& (src.length() == 0
|| ObCharset::charset_type_by_coll(src_cs_type) == ObCharset::charset_type_by_coll(dst_cs_type)
|| ObCharset::charset_type_by_coll(dst_cs_type) == CHARSET_BINARY)) {
|| src_cs == dst_cs
|| dst_cs == CHARSET_BINARY
/** GB18030 and GB18030_2022 have the same code points,
* but they have different mapping to unicode.
* So, we do not do charset_convert for them in convert*/
|| (src_cs == CHARSET_GB18030 && dst_cs == CHARSET_GB18030_2022)
|| (src_cs == CHARSET_GB18030_2022 && dst_cs == CHARSET_GB18030))) {
dst = src; // no need convert
} else if (OB_FAIL(src_iter.init(0, NULL, &calc_alloc))) {
LOG_WARN("init src_iter failed ", K(ret), K(src_iter));