Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
StoneAtom
stonedb
提交
99c5e80f
stonedb
项目概览
StoneAtom
/
stonedb
9 个月 前同步成功
通知
7
Star
817
Fork
141
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
stonedb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
99c5e80f
编写于
4月 12, 2023
作者:
L
lihongjian
提交者:
mergify[bot]
4月 17, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tianmu):Remove excess log printing and add some code comments(#1545)
上级
09f0e402
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
7 deletion
+17
-7
storage/tianmu/executor/combined_iterator.cpp
storage/tianmu/executor/combined_iterator.cpp
+2
-5
storage/tianmu/handler/ha_tianmu.cpp
storage/tianmu/handler/ha_tianmu.cpp
+15
-2
未找到文件。
storage/tianmu/executor/combined_iterator.cpp
浏览文件 @
99c5e80f
...
...
@@ -51,9 +51,6 @@ void CombinedIterator::Next() {
}
}
else
{
base_iter_
->
Next
();
if
(
base_iter_
->
Valid
())
{
TIANMU_LOG
(
LogCtl_Level
::
ERROR
,
"base pos: %d"
,
base_iter_
->
Position
());
}
}
}
...
...
@@ -85,8 +82,8 @@ bool CombinedIterator::Valid() const { return Position() != -1; }
bool
CombinedIterator
::
IsBase
()
const
{
return
is_base_
;
}
bool
CombinedIterator
::
BaseCurrentRowIsInvalid
()
const
{
if
(
base_iter_
->
CurrentRowIsDeleted
()
||
InDeltaDeletedRow
.
find
(
base_iter_
->
Position
())
!=
InDeltaDeletedRow
.
end
()
||
InDeltaUpdateRow
.
find
(
base_iter_
->
Position
())
!=
InDeltaUpdateRow
.
end
())
{
if
(
InDeltaDeletedRow
.
find
(
base_iter_
->
Position
())
!=
InDeltaDeletedRow
.
end
()
||
InDeltaUpdateRow
.
find
(
base_iter_
->
Position
())
!=
InDeltaUpdateRow
.
end
()
||
base_iter_
->
CurrentRowIsDeleted
()
)
{
return
true
;
}
return
false
;
...
...
storage/tianmu/handler/ha_tianmu.cpp
浏览文件 @
99c5e80f
...
...
@@ -1259,8 +1259,10 @@ int ha_tianmu::fill_row(uchar *buf) {
std
::
memcpy
(
buffer
.
get
(),
table
->
record
[
0
],
table
->
s
->
reclength
);
}
if
(
iterator_
->
IsBase
())
{
// judge whether this line has been deleted.
// if this line has been deleted, data will not be copied.
/*
Determine whether the current row is invalid in the base layer,
If it is invalid, directly return to the SQL layer that the current row has been deleted
*/
if
(
iterator_
->
BaseCurrentRowIsInvalid
())
{
current_position_
=
iterator_
->
Position
();
iterator_
->
Next
();
...
...
@@ -1275,6 +1277,7 @@ int ha_tianmu::fill_row(uchar *buf) {
if
(
!
delta_record
.
empty
())
{
switch
(
core
::
DeltaRecordHead
::
GetRecordType
(
delta_record
.
data
()))
{
case
core
::
RecordType
::
kInsert
:
// If the function change fails, it will be considered that the row change has been deleted.
if
(
!
core
::
Engine
::
DecodeInsertRecordToField
(
delta_record
.
data
(),
table
->
field
))
{
current_position_
=
iterator_
->
Position
();
iterator_
->
Next
();
...
...
@@ -1283,6 +1286,11 @@ int ha_tianmu::fill_row(uchar *buf) {
}
break
;
case
core
::
RecordType
::
kUpdate
:
/*
Merge data from the base layer and delta layer.
At the same time, record the status of switching to the delta layer
When iterating the base layer data, it is judged as invalid for changing rows
*/
current_txn_
->
GetTableByPath
(
table_name_
)
->
FillRowByRowid
(
table
,
iterator_
->
Position
());
core
::
Engine
::
DecodeUpdateRecordToField
(
delta_record
.
data
(),
table
->
field
);
iterator_
->
InDeltaUpdateRow
.
insert
(
...
...
@@ -1290,6 +1298,11 @@ int ha_tianmu::fill_row(uchar *buf) {
break
;
case
core
::
RecordType
::
kDelete
:
current_position_
=
iterator_
->
Position
();
/*
If there is deleted data with a new row in the delta layer,
Just record it down,
When iterating the base layer data, it is judged as invalid for changing rows
*/
iterator_
->
InDeltaDeletedRow
.
insert
(
std
::
unordered_map
<
int64_t
,
bool
>::
value_type
(
current_position_
,
true
));
iterator_
->
Next
();
dbug_tmp_restore_column_map
(
table
->
write_set
,
org_bitmap
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录