Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
AdRainty
oceanbase
提交
a57c27ea
O
oceanbase
项目概览
AdRainty
/
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,体验更适合开发者的 AI 搜索 >>
提交
a57c27ea
编写于
11月 04, 2022
作者:
S
saltonz
提交者:
wangzelin.wzl
11月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Compare schema rowkey in idx tree cursor when query rowkey is not multi-version rowkey
上级
578c862c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
8 deletion
+14
-8
src/storage/blocksstable/ob_index_block_tree_cursor.cpp
src/storage/blocksstable/ob_index_block_tree_cursor.cpp
+13
-7
src/storage/blocksstable/ob_index_block_tree_cursor.h
src/storage/blocksstable/ob_index_block_tree_cursor.h
+1
-1
未找到文件。
src/storage/blocksstable/ob_index_block_tree_cursor.cpp
浏览文件 @
a57c27ea
...
...
@@ -352,17 +352,20 @@ int ObIndexBlockTreeCursor::drill_down(
int
ret
=
OB_SUCCESS
;
equal
=
false
;
ObDatumRowkey
tmp_endkey
;
bool
compare_schema_rowkey
=
false
;
int
cmp_ret
=
0
;
if
(
IS_NOT_INIT
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"Tree cursor not inited"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
drill_down
(
rowkey
,
depth
,
is_beyond_the_range
)))
{
LOG_WARN
(
"Fail to do lower bound drill down"
,
K
(
ret
));
}
else
if
(
FALSE_IT
(
compare_schema_rowkey
=
rowkey
.
datum_cnt_
==
sstable_
->
get_meta
().
get_schema_rowkey_column_count
()))
{
}
else
if
(
is_lower_bound
||
rowkey
.
is_min_rowkey
()
||
rowkey
.
is_max_rowkey
())
{
}
else
{
// move to upper bound
while
(
OB_SUCC
(
ret
)
&&
0
==
cmp_ret
)
{
if
(
OB_FAIL
(
get_current_endkey
(
tmp_endkey
)))
{
if
(
OB_FAIL
(
get_current_endkey
(
tmp_endkey
,
compare_schema_rowkey
)))
{
LOG_WARN
(
"Fail to get current endkey"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
tmp_endkey
.
compare
(
rowkey
,
...
...
@@ -389,7 +392,7 @@ int ObIndexBlockTreeCursor::drill_down(
if
(
OB_FAIL
(
ret
))
{
}
else
if
(
rowkey
.
is_min_rowkey
()
||
rowkey
.
is_max_rowkey
())
{
equal
=
false
;
}
else
if
(
OB_FAIL
(
get_current_endkey
(
tmp_endkey
)))
{
}
else
if
(
OB_FAIL
(
get_current_endkey
(
tmp_endkey
,
compare_schema_rowkey
)))
{
LOG_WARN
(
"Fail to get current endkey"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
tmp_endkey
.
compare
(
rowkey
,
...
...
@@ -874,9 +877,11 @@ int ObIndexBlockTreeCursor::release_held_path_item(ObIndexBlockTreePathItem &hel
return
ret
;
}
int
ObIndexBlockTreeCursor
::
get_current_endkey
(
ObDatumRowkey
&
endkey
)
int
ObIndexBlockTreeCursor
::
get_current_endkey
(
ObDatumRowkey
&
endkey
,
const
bool
get_schema_rowkey
)
{
int
ret
=
OB_SUCCESS
;
const
int64_t
rowkey_datum_cnt
=
get_schema_rowkey
?
sstable_
->
get_meta
().
get_schema_rowkey_column_count
()
:
rowkey_column_cnt_
;
if
(
IS_NOT_INIT
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"Fail to get current endkey"
,
K
(
ret
));
...
...
@@ -884,11 +889,12 @@ int ObIndexBlockTreeCursor::get_current_endkey(ObDatumRowkey &endkey)
const
ObIndexBlockDataHeader
*
idx_data_header
=
nullptr
;
if
(
OB_FAIL
(
get_transformed_data_header
(
*
curr_path_item_
,
idx_data_header
)))
{
LOG_WARN
(
"Fail to get transformed data header"
,
K
(
ret
));
}
else
{
endkey
=
idx_data_header
->
rowkey_array_
[
curr_path_item_
->
curr_row_idx_
];
}
else
if
(
OB_FAIL
(
endkey
.
assign
(
idx_data_header
->
rowkey_array_
[
curr_path_item_
->
curr_row_idx_
].
datums_
,
rowkey_datum_cnt
)))
{
LOG_WARN
(
"Failed to assign endkey"
,
K
(
ret
),
K
(
rowkey_datum_cnt
),
KPC
(
idx_data_header
));
}
}
else
if
(
OB_FAIL
(
endkey
.
assign
(
row_
.
storage_datums_
,
rowkey_
column_cnt_
)))
{
STORAGE_LOG
(
WARN
,
"Failed to assign endkey"
,
K
(
ret
),
K
(
rowkey_column_cnt_
),
K
(
row_
));
}
else
if
(
OB_FAIL
(
endkey
.
assign
(
row_
.
storage_datums_
,
rowkey_
datum_cnt
)))
{
LOG_WARN
(
"Failed to assign endkey"
,
K
(
ret
),
K
(
rowkey_datum_cnt
),
K
(
row_
));
}
return
ret
;
}
...
...
src/storage/blocksstable/ob_index_block_tree_cursor.h
浏览文件 @
a57c27ea
...
...
@@ -165,7 +165,7 @@ public:
ObIArray
<
ObMicroIndexInfo
>
&
micro_index_infos
,
ObIndexBlockTreePathItem
&
hold_item
);
int
release_held_path_item
(
ObIndexBlockTreePathItem
&
held_item
);
int
get_current_endkey
(
ObDatumRowkey
&
endkey
);
int
get_current_endkey
(
ObDatumRowkey
&
endkey
,
const
bool
get_schema_rowkey
=
false
);
int
estimate_range_macro_count
(
const
blocksstable
::
ObDatumRange
&
range
,
int64_t
&
macro_count
,
int64_t
&
ratio
);
private:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录