Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
285a6831
提交
285a6831
authored
6 年前
作者:
Noel Grandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve naming of the object id field in Prepared
上级
9e734920
master
version-1.4.198
无相关合并请求
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
16 行增加
和
15 行删除
+16
-15
Prepared.java
h2/src/main/org/h2/command/Prepared.java
+12
-11
Set.java
h2/src/main/org/h2/command/dml/Set.java
+3
-3
MetaRecord.java
h2/src/main/org/h2/engine/MetaRecord.java
+1
-1
没有找到文件。
h2/src/main/org/h2/command/Prepared.java
浏览文件 @
285a6831
...
...
@@ -54,7 +54,10 @@ public abstract class Prepared {
private
long
modificationMetaId
;
private
Command
command
;
private
int
objectId
;
/**
* Used when we restore metadata at startup, this is the metadata object ID as persisted in the database.
*/
private
int
persistedObjectId
;
private
int
currentRowNumber
;
private
int
rowScanCount
;
/**
...
...
@@ -239,27 +242,25 @@ public abstract class Prepared {
/**
* Get the object id to use for the database object that is created in this
* statement. This id is only set when the object is
persistent
.
* statement. This id is only set when the object is
already persisted
.
* If not set, this method returns 0.
*
* @return the object id or 0 if not set
*/
protected
int
get
Current
ObjectId
()
{
return
o
bjectId
;
protected
int
get
Persisted
ObjectId
()
{
return
persistedO
bjectId
;
}
/**
* Get the current object id, or get a new id from the database. The object
* Get the current object id
(ie. if it is already persisted)
, or get a new id from the database. The object
* id is used when creating new database object (CREATE statement).
*
* @return the object id
*/
protected
int
getObjectId
()
{
int
id
=
o
bjectId
;
int
id
=
persistedO
bjectId
;
if
(
id
==
0
)
{
id
=
session
.
getDatabase
().
allocateObjectId
();
}
else
{
objectId
=
0
;
}
return
id
;
}
...
...
@@ -287,12 +288,12 @@ public abstract class Prepared {
}
/**
* Set the object id for this statement.
* Set the
persisted
object id for this statement.
*
* @param i the object id
*/
public
void
setObjectId
(
int
i
)
{
this
.
o
bjectId
=
i
;
public
void
set
Persisted
ObjectId
(
int
i
)
{
this
.
persistedO
bjectId
=
i
;
this
.
create
=
false
;
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/command/dml/Set.java
浏览文件 @
285a6831
...
...
@@ -418,7 +418,7 @@ public class Set extends Prepared {
}
case
SetTypes
.
TRACE_LEVEL_FILE
:
session
.
getUser
().
checkAdmin
();
if
(
get
Current
ObjectId
()
==
0
)
{
if
(
get
Persisted
ObjectId
()
==
0
)
{
// don't set the property when opening the database
// this is for compatibility with older versions, because
// this setting was persistent
...
...
@@ -427,7 +427,7 @@ public class Set extends Prepared {
break
;
case
SetTypes
.
TRACE_LEVEL_SYSTEM_OUT
:
session
.
getUser
().
checkAdmin
();
if
(
get
Current
ObjectId
()
==
0
)
{
if
(
get
Persisted
ObjectId
()
==
0
)
{
// don't set the property when opening the database
// this is for compatibility with older versions, because
// this setting was persistent
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/MetaRecord.java
浏览文件 @
285a6831
...
...
@@ -54,7 +54,7 @@ public class MetaRecord implements Comparable<MetaRecord> {
DatabaseEventListener
listener
)
{
try
{
Prepared
command
=
systemSession
.
prepare
(
sql
);
command
.
setObjectId
(
id
);
command
.
set
Persisted
ObjectId
(
id
);
command
.
update
();
}
catch
(
DbException
e
)
{
e
=
e
.
addSQL
(
sql
);
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论