Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
820af1e7
提交
820af1e7
authored
5月 14, 2013
作者:
noelgrandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
simplify - smarter use of constructor means we can drop a setter
上级
880a284f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
30 行增加
和
19 行删除
+30
-19
ValueDataType.java
h2/src/main/org/h2/mvstore/db/ValueDataType.java
+6
-3
Data.java
h2/src/main/org/h2/store/Data.java
+6
-3
ValueLob.java
h2/src/main/org/h2/value/ValueLob.java
+18
-13
没有找到文件。
h2/src/main/org/h2/mvstore/db/ValueDataType.java
浏览文件 @
820af1e7
...
@@ -612,11 +612,14 @@ public class ValueDataType implements DataType {
...
@@ -612,11 +612,14 @@ public class ValueDataType implements DataType {
precision
=
readVarLong
(
buff
);
precision
=
readVarLong
(
buff
);
compression
=
buff
.
get
()
==
1
;
compression
=
buff
.
get
()
==
1
;
}
}
ValueLob
lob
=
ValueLob
.
open
(
type
,
handler
,
tableId
,
objectId
,
precision
,
compression
);
if
(
smallLen
==
-
2
)
{
if
(
smallLen
==
-
2
)
{
lob
.
setFileName
(
readString
(
buff
),
false
);
String
filename
=
readString
(
buff
);
ValueLob
lob
=
ValueLob
.
openUnlinked
(
type
,
handler
,
tableId
,
objectId
,
precision
,
compression
,
filename
);
return
lob
;
}
else
{
ValueLob
lob
=
ValueLob
.
openLinked
(
type
,
handler
,
tableId
,
objectId
,
precision
,
compression
);
return
lob
;
}
}
return
lob
;
}
}
}
}
case
Value
.
ARRAY
:
{
case
Value
.
ARRAY
:
{
...
...
h2/src/main/org/h2/store/Data.java
浏览文件 @
820af1e7
...
@@ -806,11 +806,14 @@ public class Data {
...
@@ -806,11 +806,14 @@ public class Data {
precision
=
readVarLong
();
precision
=
readVarLong
();
compression
=
readByte
()
==
1
;
compression
=
readByte
()
==
1
;
}
}
ValueLob
lob
=
ValueLob
.
open
(
type
,
handler
,
tableId
,
objectId
,
precision
,
compression
);
if
(
smallLen
==
-
2
)
{
if
(
smallLen
==
-
2
)
{
lob
.
setFileName
(
readString
(),
false
);
String
filename
=
readString
();
ValueLob
lob
=
ValueLob
.
openUnlinked
(
type
,
handler
,
tableId
,
objectId
,
precision
,
compression
,
filename
);
return
lob
;
}
else
{
ValueLob
lob
=
ValueLob
.
openLinked
(
type
,
handler
,
tableId
,
objectId
,
precision
,
compression
);
return
lob
;
}
}
return
lob
;
}
}
}
}
case
Value
.
ARRAY
:
{
case
Value
.
ARRAY
:
{
...
...
h2/src/main/org/h2/value/ValueLob.java
浏览文件 @
820af1e7
...
@@ -127,12 +127,28 @@ public class ValueLob extends Value {
...
@@ -127,12 +127,28 @@ public class ValueLob extends Value {
* @param compression if compression is used
* @param compression if compression is used
* @return the value object
* @return the value object
*/
*/
public
static
ValueLob
open
(
int
type
,
DataHandler
handler
,
public
static
ValueLob
open
Linked
(
int
type
,
DataHandler
handler
,
int
tableId
,
int
objectId
,
long
precision
,
boolean
compression
)
{
int
tableId
,
int
objectId
,
long
precision
,
boolean
compression
)
{
String
fileName
=
getFileName
(
handler
,
tableId
,
objectId
);
String
fileName
=
getFileName
(
handler
,
tableId
,
objectId
);
return
new
ValueLob
(
type
,
handler
,
fileName
,
tableId
,
objectId
,
true
,
precision
,
compression
);
return
new
ValueLob
(
type
,
handler
,
fileName
,
tableId
,
objectId
,
true
/*linked*/
,
precision
,
compression
);
}
}
/**
* Create a LOB value with the given parameters.
*
* @param type the data type
* @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
openUnlinked
(
int
type
,
DataHandler
handler
,
int
tableId
,
int
objectId
,
long
precision
,
boolean
compression
,
String
fileName
)
{
return
new
ValueLob
(
type
,
handler
,
fileName
,
tableId
,
objectId
,
false
/*linked*/
,
precision
,
compression
);
}
/**
/**
* Create a CLOB value from a stream.
* Create a CLOB value from a stream.
*
*
...
@@ -762,17 +778,6 @@ public class ValueLob extends Value {
...
@@ -762,17 +778,6 @@ public class ValueLob extends Value {
}
}
}
}
/**
* Set the file name of this lob value.
*
* @param fileName the file name
* @param linked if the lob is linked
*/
public
void
setFileName
(
String
fileName
,
boolean
linked
)
{
this
.
fileName
=
fileName
;
this
.
linked
=
linked
;
}
public
int
getMemory
()
{
public
int
getMemory
()
{
if
(
small
!=
null
)
{
if
(
small
!=
null
)
{
return
small
.
length
+
104
;
return
small
.
length
+
104
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论