[CP]sync bugfix from 42x. fix:json compare with const string, behavior not consistent with mysql

This commit is contained in:
obdev
2024-01-17 13:12:15 +00:00
committed by ob-robot
parent 9c3cfa1dcc
commit 1cdd63cdae
8 changed files with 29 additions and 10 deletions

View File

@ -45,6 +45,7 @@ int ObExprJsonPretty::calc_result_type1(ObExprResType &type,
type.set_type(ObLongTextType);
type.set_collation_type(CS_TYPE_UTF8MB4_BIN);
type.set_collation_level(CS_LEVEL_IMPLICIT);
type.set_accuracy(ObAccuracy::DDL_DEFAULT_ACCURACY[ObLongTextType]);
if (OB_FAIL(ObJsonExprHelper::is_valid_for_json(type1, 1, N_JSON_PRETTY))) {
LOG_WARN("wrong type for json doc.", K(ret), K(type1.get_type()));