Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
e9f6a718
提交
e9f6a718
authored
1月 24, 2018
作者:
thomasmueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Javadocs, formatting
上级
43e768fc
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
83 行增加
和
29 行删除
+83
-29
release.txt
h2/src/installer/release.txt
+29
-5
Merge.java
h2/src/main/org/h2/command/dml/Merge.java
+5
-0
MergeUsing.java
h2/src/main/org/h2/command/dml/MergeUsing.java
+5
-0
DataUtils.java
h2/src/main/org/h2/mvstore/DataUtils.java
+23
-0
MVStore.java
h2/src/main/org/h2/mvstore/MVStore.java
+6
-7
ColumnNamer.java
h2/src/main/org/h2/util/ColumnNamer.java
+1
-1
ColumnNamerConfiguration.java
h2/src/main/org/h2/util/ColumnNamerConfiguration.java
+5
-0
Utils.java
h2/src/main/org/h2/util/Utils.java
+0
-15
ValueLobDb.java
h2/src/main/org/h2/value/ValueLobDb.java
+3
-0
TestFunctions.java
h2/src/test/org/h2/test/db/TestFunctions.java
+2
-0
TestColumnNamer.java
h2/src/test/org/h2/test/utils/TestColumnNamer.java
+4
-1
没有找到文件。
h2/src/installer/release.txt
浏览文件 @
e9f6a718
git pull
# Checklist for a release
./build.sh spellcheck
./build.sh javadocImpl
## Formatting, Spellchecking, Javadocs
./build.sh docs
./build.sh jarMVStore (should be about 200 KB)
git pull
Do this until there are no errors.
Fix typos, add new words to dictionary.txt:
./build.sh spellcheck
Add documentation for all public methods. Make methods private if possible:
./build.sh javadocImpl
Ensure lines are not overly long:
./build.sh docs
## Jar File Size Verification
To ensure the MVStore jar file is not too large
(does not reference the database code by accident).
The file size should be about 200 KB:
./build.sh jarMVStore
## Changing Version Numbers
Update Constants.java - change version and build number
Update Constants.java - change version and build number
Update changelog.html - add new version, remove oldest
Update changelog.html - add new version, remove oldest
Update newsfeed.sql - add new version, remove oldest
Update newsfeed.sql - add new version, remove oldest
...
...
h2/src/main/org/h2/command/dml/Merge.java
浏览文件 @
e9f6a718
...
@@ -137,6 +137,11 @@ public class Merge extends Prepared {
...
@@ -137,6 +137,11 @@ public class Merge extends Prepared {
return
count
;
return
count
;
}
}
/**
* Merge the given row.
*
* @param row the row
*/
protected
void
merge
(
Row
row
)
{
protected
void
merge
(
Row
row
)
{
ArrayList
<
Parameter
>
k
=
update
.
getParameters
();
ArrayList
<
Parameter
>
k
=
update
.
getParameters
();
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
...
...
h2/src/main/org/h2/command/dml/MergeUsing.java
浏览文件 @
e9f6a718
...
@@ -195,6 +195,11 @@ public class MergeUsing extends Prepared {
...
@@ -195,6 +195,11 @@ public class MergeUsing extends Prepared {
Right
.
SELECT
);
Right
.
SELECT
);
}
}
/**
* Merge the given row.
*
* @param row the row
*/
protected
void
merge
(
Row
sourceRow
)
{
protected
void
merge
(
Row
sourceRow
)
{
// put the column values into the table filter
// put the column values into the table filter
sourceTableFilter
.
set
(
sourceRow
);
sourceTableFilter
.
set
(
sourceRow
);
...
...
h2/src/main/org/h2/mvstore/DataUtils.java
浏览文件 @
e9f6a718
...
@@ -17,6 +17,7 @@ import java.util.Arrays;
...
@@ -17,6 +17,7 @@ import java.util.Arrays;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
org.h2.engine.Constants
;
import
org.h2.engine.Constants
;
/**
/**
...
@@ -1087,4 +1088,26 @@ public final class DataUtils {
...
@@ -1087,4 +1088,26 @@ public final class DataUtils {
}
}
/**
* Get the configuration parameter value, or default.
*
* @param config the configuration
* @param key the key
* @param defaultValue the default
* @return the configured value or default
*/
public
static
int
getConfigParam
(
Map
<
String
,
?>
config
,
String
key
,
int
defaultValue
)
{
Object
o
=
config
.
get
(
key
);
if
(
o
instanceof
Number
)
{
return
((
Number
)
o
).
intValue
();
}
else
if
(
o
!=
null
)
{
try
{
return
Integer
.
decode
(
o
.
toString
());
}
catch
(
NumberFormatException
e
)
{
// ignore
}
}
return
defaultValue
;
}
}
}
h2/src/main/org/h2/mvstore/MVStore.java
浏览文件 @
e9f6a718
...
@@ -27,7 +27,6 @@ import org.h2.mvstore.cache.CacheLongKeyLIRS;
...
@@ -27,7 +27,6 @@ import org.h2.mvstore.cache.CacheLongKeyLIRS;
import
org.h2.mvstore.type.StringDataType
;
import
org.h2.mvstore.type.StringDataType
;
import
org.h2.util.MathUtils
;
import
org.h2.util.MathUtils
;
import
org.h2.util.New
;
import
org.h2.util.New
;
import
org.h2.util.Utils
;
/*
/*
...
@@ -295,7 +294,7 @@ public final class MVStore {
...
@@ -295,7 +294,7 @@ public final class MVStore {
* @throws IllegalArgumentException if the directory does not exist
* @throws IllegalArgumentException if the directory does not exist
*/
*/
MVStore
(
Map
<
String
,
Object
>
config
)
{
MVStore
(
Map
<
String
,
Object
>
config
)
{
this
.
compressionLevel
=
Utils
.
getConfigParam
(
config
,
"compress"
,
0
);
this
.
compressionLevel
=
Data
Utils
.
getConfigParam
(
config
,
"compress"
,
0
);
String
fileName
=
(
String
)
config
.
get
(
"fileName"
);
String
fileName
=
(
String
)
config
.
get
(
"fileName"
);
FileStore
fileStore
=
(
FileStore
)
config
.
get
(
"fileStore"
);
FileStore
fileStore
=
(
FileStore
)
config
.
get
(
"fileStore"
);
fileStoreIsProvided
=
fileStore
!=
null
;
fileStoreIsProvided
=
fileStore
!=
null
;
...
@@ -307,7 +306,7 @@ public final class MVStore {
...
@@ -307,7 +306,7 @@ public final class MVStore {
int
pgSplitSize
=
48
;
// for "mem:" case it is # of keys
int
pgSplitSize
=
48
;
// for "mem:" case it is # of keys
CacheLongKeyLIRS
.
Config
cc
=
null
;
CacheLongKeyLIRS
.
Config
cc
=
null
;
if
(
this
.
fileStore
!=
null
)
{
if
(
this
.
fileStore
!=
null
)
{
int
mb
=
Utils
.
getConfigParam
(
config
,
"cacheSize"
,
16
);
int
mb
=
Data
Utils
.
getConfigParam
(
config
,
"cacheSize"
,
16
);
if
(
mb
>
0
)
{
if
(
mb
>
0
)
{
cc
=
new
CacheLongKeyLIRS
.
Config
();
cc
=
new
CacheLongKeyLIRS
.
Config
();
cc
.
maxMemory
=
mb
*
1024L
*
1024L
;
cc
.
maxMemory
=
mb
*
1024L
*
1024L
;
...
@@ -327,7 +326,7 @@ public final class MVStore {
...
@@ -327,7 +326,7 @@ public final class MVStore {
cacheChunkRef
=
null
;
cacheChunkRef
=
null
;
}
}
pgSplitSize
=
Utils
.
getConfigParam
(
config
,
"pageSplitSize"
,
pgSplitSize
);
pgSplitSize
=
Data
Utils
.
getConfigParam
(
config
,
"pageSplitSize"
,
pgSplitSize
);
// Make sure pages will fit into cache
// Make sure pages will fit into cache
if
(
cache
!=
null
&&
pgSplitSize
>
cache
.
getMaxItemSize
())
{
if
(
cache
!=
null
&&
pgSplitSize
>
cache
.
getMaxItemSize
())
{
pgSplitSize
=
(
int
)
cache
.
getMaxItemSize
();
pgSplitSize
=
(
int
)
cache
.
getMaxItemSize
();
...
@@ -343,10 +342,10 @@ public final class MVStore {
...
@@ -343,10 +342,10 @@ public final class MVStore {
meta
.
init
(
this
,
c
);
meta
.
init
(
this
,
c
);
if
(
this
.
fileStore
!=
null
)
{
if
(
this
.
fileStore
!=
null
)
{
retentionTime
=
this
.
fileStore
.
getDefaultRetentionTime
();
retentionTime
=
this
.
fileStore
.
getDefaultRetentionTime
();
int
kb
=
Utils
.
getConfigParam
(
config
,
"autoCommitBufferSize"
,
1024
);
int
kb
=
Data
Utils
.
getConfigParam
(
config
,
"autoCommitBufferSize"
,
1024
);
// 19 KB memory is about 1 KB storage
// 19 KB memory is about 1 KB storage
autoCommitMemory
=
kb
*
1024
*
19
;
autoCommitMemory
=
kb
*
1024
*
19
;
autoCompactFillRate
=
Utils
.
getConfigParam
(
config
,
"autoCompactFillRate"
,
50
);
autoCompactFillRate
=
Data
Utils
.
getConfigParam
(
config
,
"autoCompactFillRate"
,
50
);
char
[]
encryptionKey
=
(
char
[])
config
.
get
(
"encryptionKey"
);
char
[]
encryptionKey
=
(
char
[])
config
.
get
(
"encryptionKey"
);
try
{
try
{
if
(!
fileStoreIsProvided
)
{
if
(!
fileStoreIsProvided
)
{
...
@@ -375,7 +374,7 @@ public final class MVStore {
...
@@ -375,7 +374,7 @@ public final class MVStore {
// setAutoCommitDelay starts the thread, but only if
// setAutoCommitDelay starts the thread, but only if
// the parameter is different from the old value
// the parameter is different from the old value
int
delay
=
Utils
.
getConfigParam
(
config
,
"autoCommitDelay"
,
1000
);
int
delay
=
Data
Utils
.
getConfigParam
(
config
,
"autoCommitDelay"
,
1000
);
setAutoCommitDelay
(
delay
);
setAutoCommitDelay
(
delay
);
}
}
}
}
...
...
h2/src/main/org/h2/util/ColumnNamer.java
浏览文件 @
e9f6a718
...
@@ -124,7 +124,7 @@ public class ColumnNamer {
...
@@ -124,7 +124,7 @@ public class ColumnNamer {
return
newColumnName
;
return
newColumnName
;
}
}
p
ublic
boolean
isAllowableColumnName
(
String
proposedName
)
{
p
rivate
boolean
isAllowableColumnName
(
String
proposedName
)
{
// check null
// check null
if
(
proposedName
==
null
)
{
if
(
proposedName
==
null
)
{
...
...
h2/src/main/org/h2/util/ColumnNamerConfiguration.java
浏览文件 @
e9f6a718
...
@@ -161,6 +161,11 @@ public class ColumnNamerConfiguration {
...
@@ -161,6 +161,11 @@ public class ColumnNamerConfiguration {
this
.
generateUniqueColumnNames
=
generateUniqueColumnNames
;
this
.
generateUniqueColumnNames
=
generateUniqueColumnNames
;
}
}
/**
* Configure the rules.
*
* @param modeEnum the mode
*/
public
void
configure
(
ModeEnum
modeEnum
)
{
public
void
configure
(
ModeEnum
modeEnum
)
{
switch
(
modeEnum
)
{
switch
(
modeEnum
)
{
case
Oracle:
case
Oracle:
...
...
h2/src/main/org/h2/util/Utils.java
浏览文件 @
e9f6a718
...
@@ -17,7 +17,6 @@ import java.lang.reflect.Modifier;
...
@@ -17,7 +17,6 @@ import java.lang.reflect.Modifier;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Comparator
;
import
java.util.Comparator
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipInputStream
;
import
java.util.zip.ZipInputStream
;
...
@@ -699,20 +698,6 @@ public class Utils {
...
@@ -699,20 +698,6 @@ public class Utils {
return
defaultValue
;
return
defaultValue
;
}
}
public
static
int
getConfigParam
(
Map
<
String
,?>
config
,
String
key
,
int
defaultValue
)
{
Object
o
=
config
.
get
(
key
);
if
(
o
instanceof
Number
)
{
return
((
Number
)
o
).
intValue
();
}
else
if
(
o
!=
null
)
{
try
{
return
Integer
.
decode
(
o
.
toString
());
}
catch
(
NumberFormatException
e
)
{
// ignore
}
}
return
defaultValue
;
}
/**
/**
* Scale the value with the available memory. If 1 GB of RAM is available,
* Scale the value with the available memory. If 1 GB of RAM is available,
* the value is returned, if 2 GB are available, then twice the value, and
* the value is returned, if 2 GB are available, then twice the value, and
...
...
h2/src/main/org/h2/value/ValueLobDb.java
浏览文件 @
e9f6a718
...
@@ -184,6 +184,9 @@ public class ValueLobDb extends Value implements Value.ValueClob,
...
@@ -184,6 +184,9 @@ public class ValueLobDb extends Value implements Value.ValueClob,
* except when converting to BLOB or CLOB.
* except when converting to BLOB or CLOB.
*
*
* @param t the new type
* @param t the new type
* @param precision the precision
* @param mode the mode
* @param column the column
* @return the converted value
* @return the converted value
*/
*/
@Override
@Override
...
...
h2/src/test/org/h2/test/db/TestFunctions.java
浏览文件 @
e9f6a718
...
@@ -2475,6 +2475,8 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -2475,6 +2475,8 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @returns a fixed number
*/
*/
public
static
long
currentTimestampOverride
()
{
public
static
long
currentTimestampOverride
()
{
return
3141
;
return
3141
;
...
...
h2/src/test/org/h2/test/utils/TestColumnNamer.java
浏览文件 @
e9f6a718
...
@@ -25,7 +25,10 @@ public class TestColumnNamer extends TestBase {
...
@@ -25,7 +25,10 @@ public class TestColumnNamer extends TestBase {
"col2col2col2col2col2col2col2_2"
};
"col2col2col2col2col2col2col2_2"
};
/**
/**
* Run just this test.
* This method is called when executing this application from the command
* line.
*
* @param args the command line parameters
*/
*/
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
new
TestColumnNamer
().
test
();
new
TestColumnNamer
().
test
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论