Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
47e6588f
提交
47e6588f
authored
1月 24, 2014
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Various bugs in the MVStore storage and have been fixed.
上级
809d44cf
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
70 行增加
和
16 行删除
+70
-16
changelog.html
h2/src/docsrc/html/changelog.html
+3
-2
MVStore.java
h2/src/main/org/h2/mvstore/MVStore.java
+2
-1
MVRTreeMap.java
h2/src/main/org/h2/mvstore/rtree/MVRTreeMap.java
+14
-13
TestMVRTree.java
h2/src/test/org/h2/test/store/TestMVRTree.java
+24
-0
TestMVTableEngine.java
h2/src/test/org/h2/test/store/TestMVTableEngine.java
+27
-0
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
47e6588f
...
...
@@ -18,10 +18,11 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
The method org.h2.expression.Function.getCost could throw a NullPointException.
<ul><li>
Various bugs in the MVStore storage and have been fixed.
</li><li>
The method org.h2.expression.Function.getCost could throw a NullPointException.
</li><li>
Storing LOBs in separate files (outside of the database) is no longer supported for new databases.
</li><li>
Lucene 2 is no longer supported.
</li><li>
Fix bug in calculating default MIN and MAX values for SEQUENCE
</li><li>
Fix bug in calculating default MIN and MAX values for SEQUENCE
.
</li></ul>
<h2>
Version 1.3.175 (2014-01-18)
</h2>
...
...
h2/src/main/org/h2/mvstore/MVStore.java
浏览文件 @
47e6588f
...
...
@@ -1477,7 +1477,8 @@ public class MVStore {
// This could result in a cache miss if the operation is rolled back,
// but we don't optimize for rollback.
// We could also keep the page in the cache, as somebody could read it.
// We could also keep the page in the cache, as somebody
// could still read it (reading the old version).
if
(
cache
!=
null
)
{
cache
.
remove
(
pos
);
}
...
...
h2/src/main/org/h2/mvstore/rtree/MVRTreeMap.java
浏览文件 @
47e6588f
...
...
@@ -255,30 +255,31 @@ public class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
* @param p the page
* @param writeVersion the write version
* @param key the key
* @param value the value
* @return the old value
* @param value the
new
value
* @return the old value
(never null)
*/
private
Object
set
(
Page
p
,
long
writeVersion
,
Object
key
,
Object
value
)
{
if
(!
p
.
isLeaf
())
{
if
(
p
.
isLeaf
())
{
for
(
int
i
=
0
;
i
<
p
.
getKeyCount
();
i
++)
{
if
(
keyType
.
equals
(
p
.
getKey
(
i
),
key
))
{
return
p
.
setValue
(
i
,
value
);
}
}
}
else
{
for
(
int
i
=
0
;
i
<
p
.
getKeyCount
();
i
++)
{
if
(
contains
(
p
,
i
,
key
))
{
Page
c
=
copyOnWrite
(
p
.
getChildPage
(
i
),
writeVersion
);
Object
result
=
set
(
c
,
writeVersion
,
key
,
value
);
if
(
result
!=
null
)
{
Page
c
=
p
.
getChildPage
(
i
);
if
(
get
(
c
,
key
)
!=
null
)
{
c
=
copyOnWrite
(
c
,
writeVersion
);
Object
result
=
set
(
c
,
writeVersion
,
key
,
value
);
p
.
setChild
(
i
,
c
);
p
.
setCounts
(
i
,
c
);
return
result
;
}
}
}
}
else
{
for
(
int
i
=
0
;
i
<
p
.
getKeyCount
();
i
++)
{
if
(
keyType
.
equals
(
p
.
getKey
(
i
),
key
))
{
return
p
.
setValue
(
i
,
value
);
}
}
}
return
null
;
throw
DataUtils
.
newIllegalStateException
(
DataUtils
.
ERROR_INTERNAL
,
"Not found: {0}"
,
key
)
;
}
private
void
add
(
Page
p
,
long
writeVersion
,
Object
key
,
Object
value
)
{
...
...
h2/src/test/org/h2/test/store/TestMVRTree.java
浏览文件 @
47e6588f
...
...
@@ -47,6 +47,7 @@ public class TestMVRTree extends TestMVStore {
FileUtils
.
deleteRecursive
(
getBaseDir
(),
true
);
FileUtils
.
createDirectories
(
getBaseDir
());
testRandomInsert
();
testSpatialKey
();
testExample
();
testMany
();
...
...
@@ -54,6 +55,29 @@ public class TestMVRTree extends TestMVStore {
testRandom
();
testRandomFind
();
}
private
void
testRandomInsert
()
{
String
fileName
=
getBaseDir
()
+
"/testMany.h3"
;
FileUtils
.
delete
(
fileName
);
MVStore
s
;
s
=
new
MVStore
.
Builder
().
fileName
(
fileName
).
pageSplitSize
(
100
).
open
();
MVRTreeMap
<
String
>
map
=
s
.
openMap
(
"data"
,
new
MVRTreeMap
.
Builder
<
String
>());
Random
r
=
new
Random
(
1
);
for
(
int
i
=
0
;
i
<
1000
;
i
++)
{
if
(
i
%
100
==
0
)
{
r
.
setSeed
(
1
);
}
float
x
=
r
.
nextFloat
()
*
50
,
y
=
r
.
nextFloat
()
*
50
;
SpatialKey
k
=
new
SpatialKey
(
i
%
100
,
x
,
x
+
2
,
y
,
y
+
1
);
map
.
put
(
k
,
"i:"
+
i
);
if
(
i
%
10
==
0
)
{
s
.
commit
();
}
}
s
.
close
();
}
private
void
testSpatialKey
()
{
SpatialKey
a0
=
new
SpatialKey
(
0
,
1
,
2
,
3
,
4
);
...
...
h2/src/test/org/h2/test/store/TestMVTableEngine.java
浏览文件 @
47e6588f
...
...
@@ -47,6 +47,8 @@ public class TestMVTableEngine extends TestBase {
@Override
public
void
test
()
throws
Exception
{
testGarbageCollectionForLOB
();
testSpatial
();
testCount
();
testMinMaxWithNull
();
testTimeout
();
...
...
@@ -72,6 +74,31 @@ public class TestMVTableEngine extends TestBase {
testSimple
();
}
private
void
testGarbageCollectionForLOB
()
throws
SQLException
{
// TODO Auto-generated method stub
}
private
void
testSpatial
()
throws
SQLException
{
FileUtils
.
deleteRecursive
(
getBaseDir
(),
true
);
Connection
conn
;
Statement
stat
;
String
url
=
"mvstore;MV_STORE=TRUE"
;
url
=
getURL
(
url
,
true
);
conn
=
getConnection
(
url
);
stat
=
conn
.
createStatement
();
stat
.
execute
(
"call rand(1)"
);
stat
.
execute
(
"create table coords as select rand()*50 x, "
+
"rand()*50 y from system_range(1, 5000)"
);
stat
.
execute
(
"create table geoms(id identity, the_geom geometry)"
);
stat
.
execute
(
"create spatial index on geoms(the_geom)"
);
stat
.
execute
(
"insert into geoms(the_geom) select 'polygon(('||"
+
"(1+x)||' '||(1+y)||', '||(2+x)||' '||(2+y)||', "
+
"'||(3+x)||' '||(1+y)||', '||(1+x)||' '||(1+y)||'))' from coords;"
);
conn
.
close
();
}
private
void
testCount
()
throws
Exception
{
if
(
config
.
memory
)
{
return
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论