Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
b96d7663
O
oceanbase
项目概览
Metz
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b96d7663
编写于
7月 20, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
7月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] JSON bug fix
上级
1b88c270
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
11 deletion
+18
-11
src/sql/engine/aggregate/ob_aggregate_processor.cpp
src/sql/engine/aggregate/ob_aggregate_processor.cpp
+4
-1
src/sql/engine/expr/ob_datum_cast.cpp
src/sql/engine/expr/ob_datum_cast.cpp
+2
-1
src/sql/engine/expr/ob_expr_cast.cpp
src/sql/engine/expr/ob_expr_cast.cpp
+2
-1
src/sql/engine/expr/ob_expr_merge_result_type.map
src/sql/engine/expr/ob_expr_merge_result_type.map
+4
-4
src/sql/engine/expr/ob_expr_relational_cmp_type.map
src/sql/engine/expr/ob_expr_relational_cmp_type.map
+2
-2
src/sql/resolver/expr/ob_raw_expr_wrap_enum_set.cpp
src/sql/resolver/expr/ob_raw_expr_wrap_enum_set.cpp
+4
-2
未找到文件。
src/sql/engine/aggregate/ob_aggregate_processor.cpp
浏览文件 @
b96d7663
...
...
@@ -3340,7 +3340,7 @@ int ObAggregateProcessor::get_json_arrayagg_result(const ObAggrInfo &aggr_info,
ObString
origin_str
=
converted_datum
.
get_string
();
ObString
converted_str
;
if
(
OB_FAIL
(
ObExprUtil
::
convert_string_collation
(
origin_str
,
cs_type
,
converted_str
,
CS_TYPE_UTF8MB4_BIN
,
tmp_alloc
)))
{
CS_TYPE_UTF8MB4_BIN
,
tmp_alloc
)))
{
LOG_WARN
(
"convert string collation failed"
,
K
(
ret
),
K
(
cs_type
),
K
(
origin_str
.
length
()));
}
else
{
converted_datum
.
set_string
(
converted_str
);
...
...
@@ -3445,6 +3445,9 @@ int ObAggregateProcessor::get_json_objectagg_result(const ObAggrInfo &aggr_info,
K
(
tmp_obj
[
0
].
get_type
()),
K
(
tmp_obj
[
0
].
get_collation_type
()));
ret
=
OB_ERR_INVALID_JSON_CHARSET
;
LOG_USER_ERROR
(
OB_ERR_INVALID_JSON_CHARSET
);
}
else
if
(
NULL
==
tmp_obj
[
0
].
get_string_ptr
())
{
ret
=
OB_ERR_NULL_VALUE
;
LOG_WARN
(
"unexpected null result"
,
K
(
ret
),
K
(
tmp_obj
[
0
]));
}
else
{
ObObjType
val_type0
=
tmp_obj
[
0
].
get_type
();
ObCollationType
cs_type0
=
tmp_obj
[
0
].
get_collation_type
();
...
...
src/sql/engine/expr/ob_datum_cast.cpp
浏览文件 @
b96d7663
...
...
@@ -2215,7 +2215,8 @@ static int common_string_json(const ObExpr &expr,
if
(
is_need_charset_convert
==
false
)
{
j_text
.
assign_ptr
(
in_str
.
ptr
(),
in_str
.
length
());
}
bool
is_enumset_to_str
=
(
expr
.
args_
[
0
]
->
type_
==
T_FUN_SET_TO_STR
);
bool
is_enumset_to_str
=
((
expr
.
args_
[
0
]
->
type_
==
T_FUN_SET_TO_STR
)
||
(
expr
.
args_
[
0
]
->
type_
==
T_FUN_ENUM_TO_STR
));
ObIJsonBase
*
j_base
=
NULL
;
ObJsonOpaque
j_opaque
(
j_text
,
in_type
);
ObJsonString
j_string
(
j_text
.
ptr
(),
j_text
.
length
());
...
...
src/sql/engine/expr/ob_expr_cast.cpp
浏览文件 @
b96d7663
...
...
@@ -574,7 +574,8 @@ int ObExprCast::calc_result2(ObObj& result, const ObObj& obj1, const ObObj& obj2
if
(
OB_SUCC
(
ret
))
{
if
(
is_bool
)
{
ret
=
ObObjCaster
::
bool_to_json
(
dest_type
,
cast_ctx
,
obj1_round
,
buf_obj1
,
res_obj
);
}
else
if
(
OB_UNLIKELY
(
item_type_obj1
==
T_FUN_SET_TO_STR
))
{
}
else
if
(
OB_UNLIKELY
(
item_type_obj1
==
T_FUN_SET_TO_STR
)
||
OB_UNLIKELY
(
item_type_obj1
==
T_FUN_ENUM_TO_STR
))
{
ret
=
ObObjCaster
::
enumset_to_json
(
dest_type
,
cast_ctx
,
obj1_round
,
buf_obj1
,
res_obj
);
}
else
{
ret
=
ObObjCaster
::
to_type
(
dest_type
,
cast_ctx
,
obj1_round
,
buf_obj1
,
res_obj
);
...
...
src/sql/engine/expr/ob_expr_merge_result_type.map
浏览文件 @
b96d7663
...
...
@@ -1707,7 +1707,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObNCharType, /*ObEnumType=>ObNCharType */
ObMaxType, /*ObEnumType=>URowID*/
ObMaxType, /*ObEnumType=>ObLobType*/
Ob
MaxType,
/*ObEnumType=>ObJsonType*/
Ob
VarcharType,
/*ObEnumType=>ObJsonType*/
},
/*ObSetType*/
{
...
...
@@ -1758,7 +1758,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObNCharType, /*ObSetType=>ObNCharType */
ObMaxType, /*ObSetType=>URowID*/
ObMaxType, /*ObSetType=>ObLobType*/
Ob
MaxType,
/*ObSetType=>ObJsonType*/
Ob
VarcharType,
/*ObSetType=>ObJsonType*/
},
/*ObEnumInnerType*/
{
...
...
@@ -2458,8 +2458,8 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObJsonType, /* ObJsonType=>ObMediumTextType */
ObJsonType, /* ObJsonType=>ObLongTextType */
ObJsonType, /* ObJsonType=>ObBitType */
Ob
MaxType,
/* ObJsonType=>ObEnumType */
Ob
MaxType,
/* ObJsonType=>ObSetType */
Ob
VarcharType,
/* ObJsonType=>ObEnumType */
Ob
VarcharType,
/* ObJsonType=>ObSetType */
ObMaxType, /* ObJsonType=>ObEnumInnerType */
ObMaxType, /* ObJsonType=>ObSetInnerType */
ObMaxType, /* ObJsonType=>ObTimestampTZType */
...
...
src/sql/engine/expr/ob_expr_relational_cmp_type.map
浏览文件 @
b96d7663
...
...
@@ -1728,7 +1728,7 @@ static ObObjType RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] =
ObNumberType, /* ObNCharType */
ObNullType, /* ObURowIDType */
ObNullType, /* ObLobType */
Ob
Max
Type, /* ObJsonType */
Ob
Number
Type, /* ObJsonType */
},
/*SetType*/
{
...
...
@@ -2479,7 +2479,7 @@ static ObObjType RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] =
ObJsonType, /*MediumTextType*/
ObJsonType, /*LongTextType*/
ObJsonType, /*BitType*/
Ob
Max
Type, /* EnumType */
Ob
Number
Type, /* EnumType */
ObNumberType, /* SetType */
ObMaxType, /* EnumInnerType */
ObMaxType, /* SetInnerType */
...
...
src/sql/resolver/expr/ob_raw_expr_wrap_enum_set.cpp
浏览文件 @
b96d7663
...
...
@@ -679,8 +679,10 @@ int ObRawExprWrapEnumSet::visit(ObAggFunRawExpr& expr)
int
ret
=
OB_SUCCESS
;
if
(
expr
.
has_enum_set_column
()
&&
(
T_FUN_GROUP_CONCAT
==
expr
.
get_expr_type
()
||
T_FUN_MAX
==
expr
.
get_expr_type
()
||
T_FUN_MIN
==
expr
.
get_expr_type
()))
{
const
ObIArray
<
ObRawExpr
*>&
real_parm_exprs
=
expr
.
get_real_param_exprs
();
T_FUN_MIN
==
expr
.
get_expr_type
()
||
T_FUN_JSON_OBJECTAGG
==
expr
.
get_expr_type
()
||
T_FUN_JSON_ARRAYAGG
==
expr
.
get_expr_type
()))
{
const
ObIArray
<
ObRawExpr
*>
&
real_parm_exprs
=
expr
.
get_real_param_exprs
();
const
bool
is_same_need
=
false
;
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
real_parm_exprs
.
count
();
++
i
)
{
ObRawExpr
*
real_param_expr
=
real_parm_exprs
.
at
(
i
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录