Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
ebb7d972
Unverified
提交
ebb7d972
authored
7 年前
作者:
Evgenij Ryazanov
提交者:
GitHub
7 年前
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1105 from katzyn/misc
Assorted minor changes
上级
82ffee2e
511ec332
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
35 行增加
和
50 行删除
+35
-50
DbSettings.java
h2/src/main/org/h2/engine/DbSettings.java
+2
-2
SysProperties.java
h2/src/main/org/h2/engine/SysProperties.java
+6
-9
ObjectDataType.java
h2/src/main/org/h2/mvstore/type/ObjectDataType.java
+3
-3
WebApp.java
h2/src/main/org/h2/server/web/WebApp.java
+2
-1
StringUtils.java
h2/src/main/org/h2/util/StringUtils.java
+0
-14
ValueDecimal.java
h2/src/main/org/h2/value/ValueDecimal.java
+1
-1
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+1
-1
TestCases.java
h2/src/test/org/h2/test/db/TestCases.java
+19
-18
TestSpaceReuse.java
h2/src/test/org/h2/test/db/TestSpaceReuse.java
+1
-1
没有找到文件。
h2/src/main/org/h2/engine/DbSettings.java
浏览文件 @
ebb7d972
...
@@ -329,10 +329,10 @@ public class DbSettings extends SettingsBase {
...
@@ -329,10 +329,10 @@ public class DbSettings extends SettingsBase {
/**
/**
* Database setting <code>MV_STORE</code>
* Database setting <code>MV_STORE</code>
* (default:
false for version 1.3, true for version 1.4
).<br />
* (default:
true
).<br />
* Use the MVStore storage engine.
* Use the MVStore storage engine.
*/
*/
public
boolean
mvStore
=
get
(
"MV_STORE"
,
Constants
.
VERSION_MINOR
>=
4
);
public
boolean
mvStore
=
get
(
"MV_STORE"
,
true
);
/**
/**
* Database setting <code>COMPRESS</code>
* Database setting <code>COMPRESS</code>
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/SysProperties.java
浏览文件 @
ebb7d972
...
@@ -332,12 +332,11 @@ public class SysProperties {
...
@@ -332,12 +332,11 @@ public class SysProperties {
/**
/**
* System property <code>h2.oldStyleOuterJoin</code>
* System property <code>h2.oldStyleOuterJoin</code>
* (default:
true for version 1.3, false for version 1.4
).<br />
* (default:
false
).<br />
* Limited support for the old-style Oracle outer join with "(+)".
* Limited support for the old-style Oracle outer join with "(+)".
*/
*/
public
static
final
boolean
OLD_STYLE_OUTER_JOIN
=
public
static
final
boolean
OLD_STYLE_OUTER_JOIN
=
Utils
.
getProperty
(
"h2.oldStyleOuterJoin"
,
Utils
.
getProperty
(
"h2.oldStyleOuterJoin"
,
false
);
Constants
.
VERSION_MINOR
<
4
);
/**
/**
* System property {@code h2.oldResultSetGetObject}, {@code true} by default.
* System property {@code h2.oldResultSetGetObject}, {@code true} by default.
...
@@ -439,13 +438,12 @@ public class SysProperties {
...
@@ -439,13 +438,12 @@ public class SysProperties {
/**
/**
* System property <code>h2.sortBinaryUnsigned</code>
* System property <code>h2.sortBinaryUnsigned</code>
* (default:
false with version 1.3, true with version 1.4
).<br />
* (default:
true
).<br />
* Whether binary data should be sorted in unsigned mode
* Whether binary data should be sorted in unsigned mode
* (0xff is larger than 0x00).
* (0xff is larger than 0x00).
*/
*/
public
static
final
boolean
SORT_BINARY_UNSIGNED
=
public
static
final
boolean
SORT_BINARY_UNSIGNED
=
Utils
.
getProperty
(
"h2.sortBinaryUnsigned"
,
Utils
.
getProperty
(
"h2.sortBinaryUnsigned"
,
true
);
Constants
.
VERSION_MINOR
>=
4
);
/**
/**
* System property <code>h2.sortNullsHigh</code> (default: false).<br />
* System property <code>h2.sortNullsHigh</code> (default: false).<br />
...
@@ -493,13 +491,12 @@ public class SysProperties {
...
@@ -493,13 +491,12 @@ public class SysProperties {
/**
/**
* System property <code>h2.implicitRelativePath</code>
* System property <code>h2.implicitRelativePath</code>
* (default:
true for version 1.3, false for version 1.4
).<br />
* (default:
false
).<br />
* If disabled, relative paths in database URLs need to be written as
* If disabled, relative paths in database URLs need to be written as
* jdbc:h2:./test instead of jdbc:h2:test.
* jdbc:h2:./test instead of jdbc:h2:test.
*/
*/
public
static
final
boolean
IMPLICIT_RELATIVE_PATH
=
public
static
final
boolean
IMPLICIT_RELATIVE_PATH
=
Utils
.
getProperty
(
"h2.implicitRelativePath"
,
Utils
.
getProperty
(
"h2.implicitRelativePath"
,
false
);
Constants
.
VERSION_MINOR
<
4
);
/**
/**
* System property <code>h2.urlMap</code> (default: null).<br />
* System property <code>h2.urlMap</code> (default: null).<br />
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/type/ObjectDataType.java
浏览文件 @
ebb7d972
...
@@ -288,7 +288,7 @@ public class ObjectDataType implements DataType {
...
@@ -288,7 +288,7 @@ public class ObjectDataType implements DataType {
* @return true if yes
* @return true if yes
*/
*/
static
boolean
isBigInteger
(
Object
obj
)
{
static
boolean
isBigInteger
(
Object
obj
)
{
return
obj
instanceof
BigInteger
&&
obj
.
getClass
()
==
BigInteger
.
class
;
return
obj
!=
null
&&
obj
.
getClass
()
==
BigInteger
.
class
;
}
}
/**
/**
...
@@ -298,7 +298,7 @@ public class ObjectDataType implements DataType {
...
@@ -298,7 +298,7 @@ public class ObjectDataType implements DataType {
* @return true if yes
* @return true if yes
*/
*/
static
boolean
isBigDecimal
(
Object
obj
)
{
static
boolean
isBigDecimal
(
Object
obj
)
{
return
obj
instanceof
BigDecima
l
&&
obj
.
getClass
()
==
BigDecimal
.
class
;
return
obj
!=
nul
l
&&
obj
.
getClass
()
==
BigDecimal
.
class
;
}
}
/**
/**
...
@@ -308,7 +308,7 @@ public class ObjectDataType implements DataType {
...
@@ -308,7 +308,7 @@ public class ObjectDataType implements DataType {
* @return true if yes
* @return true if yes
*/
*/
static
boolean
isDate
(
Object
obj
)
{
static
boolean
isDate
(
Object
obj
)
{
return
obj
instanceof
Date
&&
obj
.
getClass
()
==
Date
.
class
;
return
obj
!=
null
&&
obj
.
getClass
()
==
Date
.
class
;
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/server/web/WebApp.java
浏览文件 @
ebb7d972
...
@@ -1420,7 +1420,8 @@ public class WebApp {
...
@@ -1420,7 +1420,8 @@ public class WebApp {
}
}
private
static
boolean
isBuiltIn
(
String
sql
,
String
builtIn
)
{
private
static
boolean
isBuiltIn
(
String
sql
,
String
builtIn
)
{
return
StringUtils
.
startsWithIgnoreCase
(
sql
,
builtIn
);
int
len
=
builtIn
.
length
();
return
sql
.
length
()
>=
len
&&
sql
.
regionMatches
(
true
,
0
,
builtIn
,
0
,
len
);
}
}
private
String
executeLoop
(
Connection
conn
,
int
count
,
String
sql
)
private
String
executeLoop
(
Connection
conn
,
int
count
,
String
sql
)
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/StringUtils.java
浏览文件 @
ebb7d972
...
@@ -110,20 +110,6 @@ public class StringUtils {
...
@@ -110,20 +110,6 @@ public class StringUtils {
return
s
.
toLowerCase
(
Locale
.
ENGLISH
);
return
s
.
toLowerCase
(
Locale
.
ENGLISH
);
}
}
/**
* Check is a string starts with another string, ignoring the case.
*
* @param s the string to check (must be longer than start)
* @param start the prefix of s
* @return true if start is a prefix of s
*/
public
static
boolean
startsWithIgnoreCase
(
String
s
,
String
start
)
{
if
(
s
.
length
()
<
start
.
length
())
{
return
false
;
}
return
s
.
substring
(
0
,
start
.
length
()).
equalsIgnoreCase
(
start
);
}
/**
/**
* Convert a string to a SQL literal. Null is converted to NULL. The text is
* Convert a string to a SQL literal. Null is converted to NULL. The text is
* enclosed in single quotes. If there are any special characters, the
* enclosed in single quotes. If there are any special characters, the
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/value/ValueDecimal.java
浏览文件 @
ebb7d972
...
@@ -57,7 +57,7 @@ public class ValueDecimal extends Value {
...
@@ -57,7 +57,7 @@ public class ValueDecimal extends Value {
private
ValueDecimal
(
BigDecimal
value
)
{
private
ValueDecimal
(
BigDecimal
value
)
{
if
(
value
==
null
)
{
if
(
value
==
null
)
{
throw
new
IllegalArgumentException
(
"null"
);
throw
new
IllegalArgumentException
(
"null"
);
}
else
if
(
!
value
.
getClass
().
equals
(
BigDecimal
.
class
)
)
{
}
else
if
(
value
.
getClass
()
!=
BigDecimal
.
class
)
{
throw
DbException
.
get
(
ErrorCode
.
INVALID_CLASS_2
,
throw
DbException
.
get
(
ErrorCode
.
INVALID_CLASS_2
,
BigDecimal
.
class
.
getName
(),
value
.
getClass
().
getName
());
BigDecimal
.
class
.
getName
(),
value
.
getClass
().
getName
());
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
ebb7d972
...
@@ -286,7 +286,7 @@ java org.h2.test.TestAll timer
...
@@ -286,7 +286,7 @@ java org.h2.test.TestAll timer
/**
/**
* Whether the MVStore storage is used.
* Whether the MVStore storage is used.
*/
*/
public
boolean
mvStore
=
Constants
.
VERSION_MINOR
>=
4
;
public
boolean
mvStore
=
true
;
/**
/**
* If the test should run with many rows.
* If the test should run with many rows.
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/db/TestCases.java
浏览文件 @
ebb7d972
...
@@ -20,7 +20,7 @@ import java.util.List;
...
@@ -20,7 +20,7 @@ import java.util.List;
import
java.util.Random
;
import
java.util.Random
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
org.h2.api.ErrorCode
;
import
org.h2.api.ErrorCode
;
import
org.h2.engine.
Constant
s
;
import
org.h2.engine.
SysPropertie
s
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
...
@@ -1265,8 +1265,8 @@ public class TestCases extends TestBase {
...
@@ -1265,8 +1265,8 @@ public class TestCases extends TestBase {
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
ResultSet
rs
;
ResultSet
rs
;
// test the
default (SIGNED)
// test the
SIGNED mode
if
(
Constants
.
VERSION_MINOR
<
4
)
{
stat
.
execute
(
"SET BINARY_COLLATION SIGNED"
);
stat
.
execute
(
"create table bin( x binary(1) );"
);
stat
.
execute
(
"create table bin( x binary(1) );"
);
stat
.
execute
(
"insert into bin(x) values (x'09'),(x'0a'),(x'99'),(x'aa');"
);
stat
.
execute
(
"insert into bin(x) values (x'09'),(x'0a'),(x'99'),(x'aa');"
);
rs
=
stat
.
executeQuery
(
"select * from bin order by x;"
);
rs
=
stat
.
executeQuery
(
"select * from bin order by x;"
);
...
@@ -1279,9 +1279,7 @@ public class TestCases extends TestBase {
...
@@ -1279,9 +1279,7 @@ public class TestCases extends TestBase {
rs
.
next
();
rs
.
next
();
assertEquals
(
"0a"
,
rs
.
getString
(
1
));
assertEquals
(
"0a"
,
rs
.
getString
(
1
));
stat
.
execute
(
"drop table bin"
);
stat
.
execute
(
"drop table bin"
);
}
// test UNSIGNED mode (default)
// test UNSIGNED mode
stat
.
execute
(
"SET BINARY_COLLATION UNSIGNED"
);
stat
.
execute
(
"SET BINARY_COLLATION UNSIGNED"
);
stat
.
execute
(
"create table bin( x binary(1) );"
);
stat
.
execute
(
"create table bin( x binary(1) );"
);
stat
.
execute
(
"insert into bin(x) values (x'09'),(x'0a'),(x'99'),(x'aa');"
);
stat
.
execute
(
"insert into bin(x) values (x'09'),(x'0a'),(x'99'),(x'aa');"
);
...
@@ -1294,6 +1292,9 @@ public class TestCases extends TestBase {
...
@@ -1294,6 +1292,9 @@ public class TestCases extends TestBase {
assertEquals
(
"99"
,
rs
.
getString
(
1
));
assertEquals
(
"99"
,
rs
.
getString
(
1
));
rs
.
next
();
rs
.
next
();
assertEquals
(
"aa"
,
rs
.
getString
(
1
));
assertEquals
(
"aa"
,
rs
.
getString
(
1
));
stat
.
execute
(
"drop table bin"
);
stat
.
execute
(
"SET BINARY_COLLATION "
+
(
SysProperties
.
SORT_BINARY_UNSIGNED
?
"UNSIGNED"
:
"SIGNED"
));
conn
.
close
();
conn
.
close
();
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/db/TestSpaceReuse.java
浏览文件 @
ebb7d972
...
@@ -45,7 +45,7 @@ public class TestSpaceReuse extends TestBase {
...
@@ -45,7 +45,7 @@ public class TestSpaceReuse extends TestBase {
conn
.
createStatement
().
execute
(
"delete from t"
);
conn
.
createStatement
().
execute
(
"delete from t"
);
conn
.
close
();
conn
.
close
();
String
fileName
=
getBaseDir
()
+
"/spaceReuse"
;
String
fileName
=
getBaseDir
()
+
"/spaceReuse"
;
if
(
Constants
.
VERSION_MINOR
>=
4
)
{
if
(
config
.
mvStore
)
{
fileName
+=
Constants
.
SUFFIX_MV_FILE
;
fileName
+=
Constants
.
SUFFIX_MV_FILE
;
}
else
{
}
else
{
fileName
+=
Constants
.
SUFFIX_PAGE_FILE
;
fileName
+=
Constants
.
SUFFIX_PAGE_FILE
;
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论