Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
39f4df3f
提交
39f4df3f
authored
6月 22, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove session id and commit() from row
上级
e2035ba4
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
0 行增加
和
66 行删除
+0
-66
Session.java
h2/src/main/org/h2/engine/Session.java
+0
-18
UndoLogRecord.java
h2/src/main/org/h2/engine/UndoLogRecord.java
+0
-6
Row.java
h2/src/main/org/h2/result/Row.java
+0
-19
RowImpl.java
h2/src/main/org/h2/result/RowImpl.java
+0
-20
RowList.java
h2/src/main/org/h2/result/RowList.java
+0
-3
没有找到文件。
h2/src/main/org/h2/engine/Session.java
浏览文件 @
39f4df3f
...
...
@@ -692,20 +692,6 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
}
removeTemporaryLobs
(
true
);
if
(
undoLog
.
size
()
>
0
)
{
// commit the rows when using MVCC
if
(
database
.
isMVStore
())
{
synchronized
(
database
)
{
ArrayList
<
Row
>
rows
=
new
ArrayList
<>(
undoLog
.
size
());
while
(
undoLog
.
size
()
>
0
)
{
UndoLogRecord
entry
=
undoLog
.
getLast
();
rows
.
add
(
entry
.
getRow
());
undoLog
.
removeLast
(
false
);
}
for
(
Row
r
:
rows
)
{
r
.
commit
();
}
}
}
undoLog
.
clear
();
}
if
(!
ddl
)
{
...
...
@@ -925,10 +911,6 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
}
}
undoLog
.
add
(
log
);
}
else
{
if
(
database
.
isMVStore
())
{
row
.
commit
();
}
}
}
...
...
h2/src/main/org/h2/engine/UndoLogRecord.java
浏览文件 @
39f4df3f
...
...
@@ -106,9 +106,6 @@ public class UndoLogRecord {
try
{
table
.
addRow
(
session
,
row
);
table
.
fireAfterRow
(
session
,
null
,
row
,
true
);
// reset session id, otherwise other sessions think
// that this row was inserted by this session
row
.
commit
();
}
catch
(
DbException
e
)
{
if
(
session
.
getDatabase
().
getLockMode
()
==
Constants
.
LOCK_MODE_OFF
&&
e
.
getSQLException
().
getErrorCode
()
==
ErrorCode
.
DUPLICATE_KEY_1
)
{
...
...
@@ -137,7 +134,6 @@ public class UndoLogRecord {
buff
.
writeByte
(
row
.
isDeleted
()
?
(
byte
)
1
:
(
byte
)
0
);
buff
.
writeInt
(
log
.
getTableId
(
table
));
buff
.
writeLong
(
row
.
getKey
());
buff
.
writeInt
(
row
.
getSessionId
());
int
count
=
row
.
getColumnCount
();
buff
.
writeInt
(
count
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
...
...
@@ -212,7 +208,6 @@ public class UndoLogRecord {
boolean
deleted
=
buff
.
readByte
()
==
1
;
table
=
log
.
getTable
(
buff
.
readInt
());
long
key
=
buff
.
readLong
();
int
sessionId
=
buff
.
readInt
();
int
columnCount
=
buff
.
readInt
();
Value
[]
values
=
new
Value
[
columnCount
];
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
...
...
@@ -221,7 +216,6 @@ public class UndoLogRecord {
row
=
getTable
().
getDatabase
().
createRow
(
values
,
Row
.
MEMORY_CALCULATE
);
row
.
setKey
(
key
);
row
.
setDeleted
(
deleted
);
row
.
setSessionId
(
sessionId
);
state
=
IN_MEMORY_INVALID
;
}
...
...
h2/src/main/org/h2/result/Row.java
浏览文件 @
39f4df3f
...
...
@@ -53,25 +53,6 @@ public interface Row extends SearchRow {
*/
void
setDeleted
(
boolean
deleted
);
/**
* Set session id.
*
* @param sessionId the session id
*/
void
setSessionId
(
int
sessionId
);
/**
* Get session id.
*
* @return the session id
*/
int
getSessionId
();
/**
* This record has been committed. The session id is reset.
*/
void
commit
();
/**
* Check if the row is deleted.
*
...
...
h2/src/main/org/h2/result/RowImpl.java
浏览文件 @
39f4df3f
...
...
@@ -22,7 +22,6 @@ public class RowImpl implements Row {
private
int
memory
;
private
int
version
;
private
boolean
deleted
;
private
int
sessionId
;
public
RowImpl
(
Value
[]
data
,
int
memory
)
{
this
.
data
=
data
;
...
...
@@ -41,7 +40,6 @@ public class RowImpl implements Row {
RowImpl
r2
=
new
RowImpl
(
d2
,
memory
);
r2
.
key
=
key
;
r2
.
version
=
version
+
1
;
r2
.
sessionId
=
sessionId
;
return
r2
;
}
...
...
@@ -154,24 +152,6 @@ public class RowImpl implements Row {
this
.
deleted
=
deleted
;
}
@Override
public
void
setSessionId
(
int
sessionId
)
{
this
.
sessionId
=
sessionId
;
}
@Override
public
int
getSessionId
()
{
return
sessionId
;
}
/**
* This record has been committed. The session id is reset.
*/
@Override
public
void
commit
()
{
this
.
sessionId
=
0
;
}
@Override
public
boolean
isDeleted
()
{
return
deleted
;
...
...
h2/src/main/org/h2/result/RowList.java
浏览文件 @
39f4df3f
...
...
@@ -56,7 +56,6 @@ public class RowList {
buff
.
writeLong
(
r
.
getKey
());
buff
.
writeInt
(
r
.
getVersion
());
buff
.
writeInt
(
r
.
isDeleted
()
?
1
:
0
);
buff
.
writeInt
(
r
.
getSessionId
());
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
Value
v
=
r
.
getValue
(
i
);
buff
.
checkCapacity
(
1
);
...
...
@@ -174,7 +173,6 @@ public class RowList {
key
=
0
;
}
boolean
deleted
=
buff
.
readInt
()
==
1
;
int
sessionId
=
buff
.
readInt
();
Value
[]
values
=
new
Value
[
columnCount
];
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
Value
v
;
...
...
@@ -196,7 +194,6 @@ public class RowList {
row
.
setKey
(
key
);
row
.
setVersion
(
version
);
row
.
setDeleted
(
deleted
);
row
.
setSessionId
(
sessionId
);
return
row
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论