Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
1993a074
提交
1993a074
authored
2月 25, 2014
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Formatting
上级
fad0012c
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
20 行增加
和
19 行删除
+20
-19
Insert.java
h2/src/main/org/h2/command/dml/Insert.java
+5
-5
DbSettings.java
h2/src/main/org/h2/constant/DbSettings.java
+1
-1
MVStore.java
h2/src/main/org/h2/mvstore/MVStore.java
+3
-3
Page.java
h2/src/main/org/h2/mvstore/Page.java
+1
-1
ObjectDataType.java
h2/src/main/org/h2/mvstore/type/ObjectDataType.java
+1
-1
LobStorageMap.java
h2/src/main/org/h2/store/LobStorageMap.java
+2
-1
TestDuplicateKeyUpdate.java
h2/src/test/org/h2/test/db/TestDuplicateKeyUpdate.java
+3
-3
TestMVStore.java
h2/src/test/org/h2/test/store/TestMVStore.java
+4
-4
没有找到文件。
h2/src/main/org/h2/command/dml/Insert.java
浏览文件 @
1993a074
...
...
@@ -326,7 +326,7 @@ public class Insert extends Prepared implements ResultTarget {
variableNames
.
add
(
key
);
session
.
setVariable
(
key
,
list
.
get
(
getCurrentRowNumber
()
-
1
)[
i
].
getValue
(
session
));
}
StatementBuilder
buff
=
new
StatementBuilder
(
"UPDATE "
);
buff
.
append
(
table
.
getSQL
()).
append
(
" SET "
);
for
(
Column
column
:
duplicateKeyAssignmentMap
.
keySet
())
{
...
...
@@ -341,7 +341,7 @@ public class Insert extends Prepared implements ResultTarget {
}
buff
.
append
(
prepareUpdateCondition
(
foundIndex
).
getSQL
());
String
sql
=
buff
.
toString
();
Prepared
command
=
session
.
prepare
(
sql
);
Prepared
command
=
session
.
prepare
(
sql
);
for
(
Parameter
param
:
command
.
getParameters
())
{
Parameter
insertParam
=
parameters
.
get
(
param
.
getIndex
());
param
.
setValue
(
insertParam
.
getValue
(
session
));
...
...
@@ -384,11 +384,11 @@ public class Insert extends Prepared implements ResultTarget {
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
if
(
expr
.
getColumnName
().
equals
(
columns
[
i
].
getName
()))
{
if
(
condition
==
null
)
{
condition
=
new
Comparison
(
session
,
Comparison
.
EQUAL
,
condition
=
new
Comparison
(
session
,
Comparison
.
EQUAL
,
expr
,
list
.
get
(
getCurrentRowNumber
()
-
1
)[
i
++]);
}
else
{
condition
=
new
ConditionAndOr
(
ConditionAndOr
.
AND
,
condition
,
new
Comparison
(
session
,
Comparison
.
EQUAL
,
condition
=
new
ConditionAndOr
(
ConditionAndOr
.
AND
,
condition
,
new
Comparison
(
session
,
Comparison
.
EQUAL
,
expr
,
list
.
get
(
0
)[
i
++]));
}
}
...
...
h2/src/main/org/h2/constant/DbSettings.java
浏览文件 @
1993a074
...
...
@@ -327,7 +327,7 @@ public class DbSettings extends SettingsBase {
* Use the MVStore storage engine.
*/
public
final
boolean
mvStore
=
get
(
"MV_STORE"
,
false
);
/**
* Database setting <code>COMPRESS</code>
* (default: false).<br />
...
...
h2/src/main/org/h2/mvstore/MVStore.java
浏览文件 @
1993a074
...
...
@@ -1725,7 +1725,7 @@ public class MVStore {
/**
* How many versions to retain for in-memory stores. If not set, 5 old
* versions are retained.
*
*
* @param count the number of versions to keep
*/
public
void
setVersionsToKeep
(
int
count
)
{
...
...
@@ -2327,7 +2327,7 @@ public class MVStore {
* there is still a small risk that password stays in memory (due to
* Java garbage collection). Also, the hashed encryption key is kept in
* memory as long as the file is open.
*
*
* @param password the password
* @return this
*/
...
...
@@ -2407,7 +2407,7 @@ public class MVStore {
* that any kind of store (including an off-heap store) is considered a
* "persistence", while an "in-memory store" means objects are not
* persisted and fully kept in the JVM heap.
*
*
* @param store the file store
* @return this
*/
...
...
h2/src/main/org/h2/mvstore/Page.java
浏览文件 @
1993a074
...
...
@@ -849,7 +849,7 @@ public class Page {
chunk
.
pageCountLive
++;
return
typePos
+
1
;
}
private
void
writeChildren
(
WriteBuffer
buff
)
{
int
len
=
keyCount
;
for
(
int
i
=
0
;
i
<=
len
;
i
++)
{
...
...
h2/src/main/org/h2/mvstore/type/ObjectDataType.java
浏览文件 @
1993a074
...
...
@@ -1471,7 +1471,7 @@ public class ObjectDataType implements DataType {
* The type for serialized objects.
*/
class
SerializedObjectType
extends
AutoDetectDataType
{
private
int
averageSize
=
10000
;
SerializedObjectType
(
ObjectDataType
base
)
{
...
...
h2/src/main/org/h2/store/LobStorageMap.java
浏览文件 @
1993a074
...
...
@@ -46,7 +46,8 @@ public class LobStorageMap implements LobStorageInterface {
* (which is a long) to the stream store id (which is a byte array).
*
* Key: lobId (long)
* Value: { streamStoreId (byte[]), tableId (int), byteCount (long), hash (long) }.
* Value: { streamStoreId (byte[]), tableId (int),
* byteCount (long), hash (long) }.
*/
private
MVMap
<
Long
,
Object
[]>
lobMap
;
...
...
h2/src/test/org/h2/test/db/TestDuplicateKeyUpdate.java
浏览文件 @
1993a074
...
...
@@ -194,7 +194,7 @@ public class TestDuplicateKeyUpdate extends TestBase {
ResultSet
rs
=
stat
.
executeQuery
(
"select count from test where key = 'a'"
);
rs
.
next
();
assertEquals
(
3
,
rs
.
getInt
(
1
));
stat
.
execute
(
"drop table test"
);
}
...
...
@@ -206,7 +206,7 @@ public class TestDuplicateKeyUpdate extends TestBase {
// Insert multiple values in single insert operation
for
(
int
i
=
0
;
i
<=
2
;
++
i
)
{
PreparedStatement
prep
=
conn
.
prepareStatement
(
"insert into test(key, count) values(?, ?), (?, ?), (?, ?) "
+
"insert into test(key, count) values(?, ?), (?, ?), (?, ?) "
+
"on duplicate key update count = count + 1"
);
prep
.
setString
(
1
,
"a"
);
prep
.
setInt
(
2
,
1
);
...
...
@@ -222,7 +222,7 @@ public class TestDuplicateKeyUpdate extends TestBase {
ResultSet
rs
=
stat
.
executeQuery
(
"select count from test where key = 'a'"
);
rs
.
next
();
assertEquals
(
3
,
rs
.
getInt
(
1
));
stat
.
execute
(
"drop table test"
);
}
...
...
h2/src/test/org/h2/test/store/TestMVStore.java
浏览文件 @
1993a074
...
...
@@ -106,7 +106,7 @@ public class TestMVStore extends TestBase {
// longer running tests
testLargerThan2G
();
}
private
void
testCompressEmptyPage
()
{
String
fileName
=
getBaseDir
()
+
"/testDeletedMap.h3"
;
MVStore
store
=
new
MVStore
.
Builder
().
...
...
@@ -123,7 +123,7 @@ public class TestMVStore extends TestBase {
open
();
store
.
close
();
}
private
void
testCompressed
()
{
String
fileName
=
getBaseDir
()
+
"/testCompressed.h3"
;
MVStore
s
=
new
MVStore
.
Builder
().
fileName
(
fileName
).
compressData
().
open
();
...
...
@@ -214,7 +214,7 @@ public class TestMVStore extends TestBase {
}
}
}
private
void
testVersionsToKeep2
()
{
MVStore
s
=
new
MVStore
.
Builder
().
autoCommitDisabled
().
open
();
s
.
setVersionsToKeep
(
2
);
...
...
@@ -1130,7 +1130,7 @@ public class TestMVStore extends TestBase {
// System.out.println("size: " + FileUtils.size(fileName));
}
}
private
void
testOldVersion
()
{
MVStore
s
;
for
(
int
op
=
0
;
op
<=
1
;
op
++)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论