diff --git a/deps/oblib/src/common/object/ob_object.h b/deps/oblib/src/common/object/ob_object.h index dcd5d5136..0493edffd 100644 --- a/deps/oblib/src/common/object/ob_object.h +++ b/deps/oblib/src/common/object/ob_object.h @@ -135,11 +135,12 @@ public: set_collation_type(CS_TYPE_INVALID); } else if (ObHexStringType == type_) { set_collation_type(CS_TYPE_BINARY); + } else if (ob_is_json(static_cast(type_))) { + set_collation_type(CS_TYPE_UTF8MB4_BIN); } else if (!ob_is_string_type(static_cast(type_)) && !ob_is_lob_locator(static_cast(type_)) && !ob_is_raw(static_cast(type_)) && - !ob_is_enum_or_set_type(static_cast(type_)) && - !ob_is_json(static_cast(type_))) { + !ob_is_enum_or_set_type(static_cast(type_))) { set_collation_level(CS_LEVEL_NUMERIC); set_collation_type(CS_TYPE_BINARY); } diff --git a/src/sql/engine/aggregate/ob_aggregate_function.cpp b/src/sql/engine/aggregate/ob_aggregate_function.cpp index 6f1c20067..8206ed311 100644 --- a/src/sql/engine/aggregate/ob_aggregate_function.cpp +++ b/src/sql/engine/aggregate/ob_aggregate_function.cpp @@ -3285,7 +3285,6 @@ int ObAggregateFunction::get_json_arrayagg_result(const ObAggregateExpression *& LOG_WARN("convert string collation failed", K(ret), K(cs_type), K(origin_str.length())); } else { converted_obj.set_string(val_type, converted_str); - converted_obj.set_collation_type(CS_TYPE_UTF8MB4_BIN); cs_type = CS_TYPE_UTF8MB4_BIN; } } @@ -3430,7 +3429,6 @@ int ObAggregateFunction::get_json_objectagg_result(const ObAggregateExpression * LOG_WARN("convert string collation failed", K(ret), K(cs_type1), K(origin_str.length())); } else { converted_obj.set_string(val_type1, converted_str); - converted_obj.set_collation_type(CS_TYPE_UTF8MB4_BIN); cs_type1 = CS_TYPE_UTF8MB4_BIN; } }