Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
不争之德
oceanbase
提交
fbdf9545
O
oceanbase
项目概览
不争之德
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
fbdf9545
编写于
10月 03, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
10月 03, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
BUGFIX:Abnormal change of json integer value.
上级
39e1f2e9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
8 deletion
+11
-8
deps/oblib/src/lib/json_type/ob_json_bin.cpp
deps/oblib/src/lib/json_type/ob_json_bin.cpp
+9
-7
deps/oblib/src/lib/json_type/ob_json_bin.h
deps/oblib/src/lib/json_type/ob_json_bin.h
+2
-1
未找到文件。
deps/oblib/src/lib/json_type/ob_json_bin.cpp
浏览文件 @
fbdf9545
...
...
@@ -945,8 +945,9 @@ int ObJsonBin::to_tree(ObJsonNode *&json_tree)
}
else
{
// inline value store all store in union
offset
=
OB_JSON_TYPE_IS_INLINE
(
type
)
?
uint_val_
:
offset
;
type
=
ObJsonVar
::
get_var_type
(
offset
);
}
if
(
OB_FAIL
(
deserialize_json_value
(
ptr
+
offset
,
curr_
.
length
()
-
offset
,
type_
,
offset
,
json_tree
)))
{
if
(
OB_FAIL
(
deserialize_json_value
(
ptr
+
offset
,
curr_
.
length
()
-
offset
,
type_
,
offset
,
json_tree
,
type
)))
{
LOG_WARN
(
"deserialize failed"
,
K
(
ret
),
K
(
offset
),
K
(
type
));
}
}
...
...
@@ -958,7 +959,8 @@ int ObJsonBin::deserialize_json_value(const char *data,
uint64_t
length
,
uint8_t
type
,
uint64_t
value_offset
,
ObJsonNode
*&
json_tree
)
ObJsonNode
*&
json_tree
,
uint64_t
type_size
)
{
INIT_SUCC
(
ret
);
bool
is_inlined
=
OB_JSON_TYPE_IS_INLINE
(
type
);
...
...
@@ -1006,7 +1008,7 @@ int ObJsonBin::deserialize_json_value(const char *data,
LOG_WARN
(
"fail to alloc memory for int json node"
,
K
(
ret
));
}
else
{
if
(
is_inlined
)
{
ObJsonInt
*
node
=
new
(
buf
)
ObJsonInt
(
ObJsonVar
::
var_uint2int
(
value_offset
));
ObJsonInt
*
node
=
new
(
buf
)
ObJsonInt
(
ObJsonVar
::
var_uint2int
(
value_offset
,
type_size
));
json_tree
=
static_cast
<
ObJsonNode
*>
(
node
);
}
else
{
int64_t
val
=
0
;
...
...
@@ -1329,7 +1331,7 @@ int ObJsonBin::deserialize_json_object_v0(const char *data, uint64_t length, ObJ
ObString
key
(
key_len
,
reinterpret_cast
<
const
char
*>
(
key_buf
));
const
char
*
val
=
data
+
value_offset
;
ObJsonNode
*
node
=
NULL
;
ret
=
deserialize_json_value
(
val
,
length
-
value_offset
,
val_type
,
value_offset
,
node
);
ret
=
deserialize_json_value
(
val
,
length
-
value_offset
,
val_type
,
value_offset
,
node
,
type
);
if
(
OB_SUCC
(
ret
))
{
if
(
OB_FAIL
(
object
->
add
(
key
,
node
)))
{
LOG_WARN
(
"failed to add node to obj"
,
K
(
ret
));
...
...
@@ -1392,8 +1394,8 @@ int ObJsonBin::deserialize_json_array_v0(const char *data, uint64_t length, ObJs
}
else
{
const
char
*
val
=
data
+
val_offset
;
ObJsonNode
*
node
=
NULL
;
if
(
OB_FAIL
(
deserialize_json_value
(
val
,
length
-
val_offset
,
val_type
,
val_offset
,
node
)))
{
LOG_WARN
(
"failed to deserialize child node"
,
K
(
ret
),
K
(
i
),
K
(
val_type
),
K
(
val_offset
));
if
(
OB_FAIL
(
deserialize_json_value
(
val
,
length
-
val_offset
,
val_type
,
val_offset
,
node
,
type
)))
{
LOG_WARN
(
"failed to deserialize child node"
,
K
(
ret
),
K
(
i
),
K
(
val_type
),
K
(
val_offset
)
,
K
(
type
)
);
}
else
if
(
OB_FAIL
(
array
->
append
(
node
)))
{
LOG_WARN
(
"failed to append node to array"
,
K
(
ret
));
}
...
...
@@ -4346,7 +4348,7 @@ uint64_t ObJsonVar::var_int2uint(int64_t var)
int64_t
ObJsonVar
::
var_uint2int
(
uint64_t
var
,
uint8_t
entry_size
)
{
ObJsonBinLenSize
size
=
static_cast
<
ObJsonBinLenSize
>
(
max
(
ObJsonVar
::
get_var_type
(
var
),
entry_size
)
);
ObJsonBinLenSize
size
=
static_cast
<
ObJsonBinLenSize
>
(
entry_size
);
int64_t
val
=
0
;
switch
(
size
)
{
case
JBLS_UINT8
:
{
...
...
deps/oblib/src/lib/json_type/ob_json_bin.h
浏览文件 @
fbdf9545
...
...
@@ -412,7 +412,8 @@ private:
uint64_t
length
,
uint8_t
type
,
uint64_t
value_offset
,
ObJsonNode
*&
json_tree
);
ObJsonNode
*&
json_tree
,
uint64_t
type_size
);
int
deserialize_json_object_v0
(
const
char
*
data
,
uint64_t
length
,
ObJsonObject
*
object
);
inline
int
deserialize_json_object
(
const
char
*
data
,
uint64_t
length
,
ObJsonObject
*
object
,
ObJBVerType
vertype
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录