Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
2524b93d
提交
2524b93d
authored
6月 24, 2018
作者:
Noel Grandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "filename in ValueLob is now never null"
This reverts commit
c6cf352d
. hmmm, not quite right
上级
c6cf352d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
39 行增加
和
6 行删除
+39
-6
Data.java
h2/src/main/org/h2/store/Data.java
+2
-2
ValueLob.java
h2/src/main/org/h2/value/ValueLob.java
+37
-4
没有找到文件。
h2/src/main/org/h2/store/Data.java
浏览文件 @
2524b93d
...
...
@@ -852,8 +852,8 @@ public class Data {
return
ValueLob
.
openUnlinked
(
type
,
handler
,
tableId
,
objectId
,
precision
,
compression
,
filename
);
}
return
ValueLob
Db
.
create
(
type
,
handler
,
tableId
,
objectId
,
null
,
preci
sion
);
return
ValueLob
.
openLinked
(
type
,
handler
,
tableId
,
objectId
,
precision
,
compres
sion
);
}
}
case
Value
.
ARRAY
:
{
...
...
h2/src/main/org/h2/value/ValueLob.java
浏览文件 @
2524b93d
...
...
@@ -30,9 +30,18 @@ import org.h2.util.StringUtils;
import
org.h2.util.Utils
;
/**
* This is the legacy implementation of LOBs for PageStore databases where the
* LOB was stored in an external file.
*
* Implementation of the BLOB and CLOB data types. Small objects are kept in
* memory and stored in the record.
*
* Large objects are stored in their own files. When large objects are set in a
* prepared statement, they are first stored as 'temporary' files. Later, when
* they are used in a record, and when the record is stored, the lob files are
* linked: the file is renamed using the file format (tableId).(objectId). There
* is one exception: large variables are stored in the file (-1).(objectId).
*
* When lobs are deleted, they are first renamed to a temp file, and if the
* delete operation is committed the file is deleted.
*
* Data compression is supported.
*/
public
class
ValueLob
extends
Value
{
...
...
@@ -132,6 +141,24 @@ public class ValueLob extends Value {
table
+
Constants
.
SUFFIX_LOB_FILE
;
}
/**
* Create a LOB value with the given parameters.
*
* @param type the data type, either Value.BLOB or Value.CLOB
* @param handler the file handler
* @param tableId the table object id
* @param objectId the object id
* @param precision the precision (length in elements)
* @param compression if compression is used
* @return the value object
*/
public
static
ValueLob
openLinked
(
int
type
,
DataHandler
handler
,
int
tableId
,
int
objectId
,
long
precision
,
boolean
compression
)
{
String
fileName
=
getFileName
(
handler
,
tableId
,
objectId
);
return
new
ValueLob
(
type
,
handler
,
fileName
,
tableId
,
objectId
,
true
/* linked */
,
precision
,
compression
);
}
/**
* Create a LOB value with the given parameters.
*
...
...
@@ -301,11 +328,17 @@ public class ValueLob extends Value {
@Override
public
void
remove
()
{
deleteFile
(
handler
,
fileName
);
if
(
fileName
!=
null
)
{
deleteFile
(
handler
,
fileName
);
}
}
@Override
public
Value
copy
(
DataHandler
h
,
int
tabId
)
{
if
(
fileName
==
null
)
{
this
.
tableId
=
tabId
;
return
this
;
}
if
(
linked
)
{
ValueLob
copy
=
new
ValueLob
(
this
.
valueType
,
this
.
handler
,
this
.
fileName
,
this
.
tableId
,
getNewObjectId
(
h
),
this
.
linked
,
this
.
precision
,
this
.
compressed
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论