Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
206701c9
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看板
提交
206701c9
编写于
5月 20, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
5月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[fix]:sync json bugfix
上级
41777597
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
7 deletion
+13
-7
deps/oblib/src/lib/json_type/ob_json_bin.cpp
deps/oblib/src/lib/json_type/ob_json_bin.cpp
+5
-5
src/sql/engine/expr/ob_expr_in.cpp
src/sql/engine/expr/ob_expr_in.cpp
+8
-2
未找到文件。
deps/oblib/src/lib/json_type/ob_json_bin.cpp
浏览文件 @
206701c9
...
...
@@ -663,7 +663,7 @@ int ObJsonBin::serialize_json_value(ObJsonNode *json_tree, ObJsonBuffer &result)
int64_t
ser_len
=
serialization
::
encoded_length_vi64
(
sub_obj
->
length
());
int64_t
pos
=
result
.
length
()
+
sizeof
(
uint8_t
);
ObJBVerType
vertype
=
get_string_vertype
();
if
(
result_
.
append
(
reinterpret_cast
<
const
char
*>
(
&
vertype
),
sizeof
(
uint8_t
)))
{
if
(
OB_FAIL
(
result_
.
append
(
reinterpret_cast
<
const
char
*>
(
&
vertype
),
sizeof
(
uint8_t
)
)))
{
LOG_WARN
(
"failed to serialize type for str json obj"
,
K
(
ret
),
K
(
ser_len
));
}
else
if
(
OB_FAIL
(
result
.
reserve
(
ser_len
)))
{
LOG_WARN
(
"failed to reserver serialize size for str json obj"
,
K
(
ret
),
K
(
ser_len
));
...
...
@@ -746,7 +746,7 @@ int ObJsonBin::serialize_json_value(ObJsonNode *json_tree, ObJsonBuffer &result)
uint64_t
obj_size
=
sub_obj
->
size
();
uint16_t
field_type
=
static_cast
<
uint16_t
>
(
sub_obj
->
field_type
());
ObJBVerType
vertype
=
get_opaque_vertype
();
if
(
result_
.
append
(
reinterpret_cast
<
const
char
*>
(
&
vertype
),
sizeof
(
uint8_t
)))
{
if
(
OB_FAIL
(
result_
.
append
(
reinterpret_cast
<
const
char
*>
(
&
vertype
),
sizeof
(
uint8_t
)
)))
{
LOG_WARN
(
"failed to serialize type for str json obj"
,
K
(
ret
),
K
(
vertype
));
}
else
if
(
OB_FAIL
(
result
.
append
(
reinterpret_cast
<
const
char
*>
(
&
field_type
),
sizeof
(
uint16_t
))))
{
LOG_WARN
(
"failed to append opaque json obj type"
,
K
(
ret
));
...
...
@@ -983,7 +983,7 @@ int ObJsonBin::deserialize_json_value(const char *data,
int64_t
pos
=
0
;
if
(
OB_FAIL
(
serialization
::
decode_i16
(
data
,
length
,
pos
,
&
prec
)))
{
LOG_WARN
(
"fail to deserialize decimal precision."
,
K
(
ret
),
K
(
length
));
}
else
if
(
serialization
::
decode_i16
(
data
,
length
,
pos
,
&
scale
))
{
}
else
if
(
OB_FAIL
(
serialization
::
decode_i16
(
data
,
length
,
pos
,
&
scale
)
))
{
LOG_WARN
(
"fail to deserialize decimal scale."
,
K
(
ret
),
K
(
length
),
K
(
prec
));
}
else
if
(
OB_FAIL
(
num
.
deserialize
(
data
,
length
,
pos
)))
{
LOG_WARN
(
"fail to deserialize number."
,
K
(
ret
),
K
(
length
));
...
...
@@ -1606,7 +1606,7 @@ int ObJsonBin::raw_binary(ObString &buf, ObIAllocator *allocator) const
if
(
bytes_
*
OB_JSON_BIN_REBUILD_THRESHOLD
<
append_len
||
OB_JSON_TYPE_IS_INLINE
(
type_
))
{
// free space over 30% or inline type, do rebuild
ObJsonBuffer
&
jbuf
=
*
result
;
if
(
OB_FAIL
(
rebuild_json_value
(
curr_
.
ptr
()
+
pos_
,
curr_
.
length
()
-
pos_
,
type
,
type
,
uint_val_
,
jbuf
)))
{
if
(
OB_FAIL
(
rebuild_json_value
(
curr_
.
ptr
()
+
pos_
,
curr_
.
length
()
-
pos_
,
type
_
,
type
,
uint_val_
,
jbuf
)))
{
LOG_WARN
(
"failed to rebuild inline value"
,
K
(
ret
));
}
}
else
{
...
...
@@ -3760,7 +3760,7 @@ int ObJsonBin::rebuild_json_value(const char *data,
break
;
}
case
ObJsonNodeType
::
J_BOOLEAN
:
{
if
(
!
is_
src
_inlined
)
{
if
(
!
is_
dst
_inlined
)
{
if
(
OB_FAIL
(
serialize_json_integer
(
inline_data
,
result
)))
{
LOG_WARN
(
"failed to rebuild serialize boolean."
,
K
(
ret
),
K
(
inline_data
));
}
...
...
src/sql/engine/expr/ob_expr_in.cpp
浏览文件 @
206701c9
...
...
@@ -618,7 +618,13 @@ int ObExprInOrNotIn::calc_resultN(ObObj& result, const ObObj* objs, int64_t para
if
(
lib
::
is_oracle_mode
()
&&
is_param_is_ext_type_oracle
())
{
ret
=
OB_NOT_SUPPORTED
;
}
else
{
const
bool
hashset_lookup
=
need_hash
(
expr_ctx
.
exec_ctx_
);
bool
hash_json_type
=
false
;
for
(
int
i
=
0
;
i
<
param_num
&&
!
hash_json_type
;
++
i
)
{
if
(
ob_is_json
(
objs
[
i
].
get_type
()))
{
hash_json_type
=
true
;
}
}
const
bool
hashset_lookup
=
hash_json_type
&&
need_hash
(
expr_ctx
.
exec_ctx_
);
bool
fall_back
=
false
;
if
(
hashset_lookup
)
{
if
(
row_dimension_
==
1
)
{
...
...
@@ -1186,7 +1192,7 @@ int ObExprInOrNotIn::cg_expr_without_row(ObIAllocator& allocator, const ObRawExp
for
(
int
i
=
0
;
i
<
rt_expr
.
inner_func_cnt_
;
i
++
)
{
rt_expr
.
inner_functions_
[
i
]
=
(
void
*
)
func_ptr
;
}
if
(
!
is_param_all_const
())
{
if
(
!
is_param_all_const
()
||
(
ob_is_json
(
left_type
)
||
ob_is_json
(
right_type
))
)
{
rt_expr
.
eval_func_
=
&
ObExprInOrNotIn
::
eval_in_without_row_fallback
;
}
else
{
rt_expr
.
eval_func_
=
&
ObExprInOrNotIn
::
eval_in_without_row
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录