Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
1e9832f5
提交
1e9832f5
authored
6月 15, 2012
作者:
noelgrandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove some dead fields and variables
上级
de91fc28
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
10 行增加
和
23 行删除
+10
-23
TestDateStorage.java
h2/src/test/org/h2/test/db/TestDateStorage.java
+0
-2
TestMultiDimension.java
h2/src/test/org/h2/test/db/TestMultiDimension.java
+2
-2
TestOpenClose.java
h2/src/test/org/h2/test/db/TestOpenClose.java
+1
-1
TestTableEngines.java
h2/src/test/org/h2/test/db/TestTableEngines.java
+3
-6
TestTwoPhaseCommit.java
h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java
+1
-1
TestPowerOffFs2.java
h2/src/test/org/h2/test/synth/TestPowerOffFs2.java
+0
-3
TestThreads.java
h2/src/test/org/h2/test/synth/TestThreads.java
+1
-1
TestCache.java
h2/src/test/org/h2/test/unit/TestCache.java
+0
-2
TestCompress.java
h2/src/test/org/h2/test/unit/TestCompress.java
+1
-2
Indexer.java
h2/src/tools/org/h2/build/indexer/Indexer.java
+0
-2
ModelUtils.java
h2/src/tools/org/h2/jaqu/ModelUtils.java
+1
-1
没有找到文件。
h2/src/test/org/h2/test/db/TestDateStorage.java
浏览文件 @
1e9832f5
...
@@ -153,7 +153,6 @@ public class TestDateStorage extends TestBase {
...
@@ -153,7 +153,6 @@ public class TestDateStorage extends TestBase {
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6772689
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6772689
java
.
sql
.
Date
date
=
java
.
sql
.
Date
.
valueOf
(
s
);
java
.
sql
.
Date
date
=
java
.
sql
.
Date
.
valueOf
(
s
);
long
time
=
date
.
getTime
();
long
time
=
date
.
getTime
();
int
plus
=
0
;
while
(
true
)
{
while
(
true
)
{
date
=
new
java
.
sql
.
Date
(
time
);
date
=
new
java
.
sql
.
Date
(
time
);
String
x
=
date
.
toString
();
String
x
=
date
.
toString
();
...
@@ -161,7 +160,6 @@ public class TestDateStorage extends TestBase {
...
@@ -161,7 +160,6 @@ public class TestDateStorage extends TestBase {
break
;
break
;
}
}
time
+=
1000
;
time
+=
1000
;
plus
+=
1000
;
}
}
if
(!
date
.
toString
().
equals
(
s
))
{
if
(!
date
.
toString
().
equals
(
s
))
{
println
(
TimeZone
.
getDefault
().
getID
()
+
" "
+
s
+
" <> "
+
date
.
toString
());
println
(
TimeZone
.
getDefault
().
getID
()
+
" "
+
s
+
" <> "
+
date
.
toString
());
...
...
h2/src/test/org/h2/test/db/TestMultiDimension.java
浏览文件 @
1e9832f5
...
@@ -128,7 +128,7 @@ public class TestMultiDimension extends TestBase {
...
@@ -128,7 +128,7 @@ public class TestMultiDimension extends TestBase {
long
timeMulti
=
0
,
timeRegular
=
0
;
long
timeMulti
=
0
,
timeRegular
=
0
;
int
timeMax
=
getSize
(
500
,
2000
);
int
timeMax
=
getSize
(
500
,
2000
);
Random
rand
=
new
Random
(
1
);
Random
rand
=
new
Random
(
1
);
for
(
int
i
=
0
;
timeMulti
<
timeMax
;
i
++
)
{
while
(
timeMulti
<
timeMax
)
{
int
size
=
rand
.
nextInt
(
max
/
10
);
int
size
=
rand
.
nextInt
(
max
/
10
);
int
minX
=
rand
.
nextInt
(
max
-
size
);
int
minX
=
rand
.
nextInt
(
max
-
size
);
int
minY
=
rand
.
nextInt
(
max
-
size
);
int
minY
=
rand
.
nextInt
(
max
-
size
);
...
@@ -199,7 +199,7 @@ public class TestMultiDimension extends TestBase {
...
@@ -199,7 +199,7 @@ public class TestMultiDimension extends TestBase {
long
timeMulti
=
0
,
timeRegular
=
0
;
long
timeMulti
=
0
,
timeRegular
=
0
;
int
timeMax
=
getSize
(
500
,
2000
);
int
timeMax
=
getSize
(
500
,
2000
);
Random
rand
=
new
Random
(
1
);
Random
rand
=
new
Random
(
1
);
for
(
int
i
=
0
;
timeMulti
<
timeMax
;
i
++
)
{
while
(
timeMulti
<
timeMax
)
{
int
size
=
rand
.
nextInt
(
max
/
10
);
int
size
=
rand
.
nextInt
(
max
/
10
);
int
minX
=
rand
.
nextInt
(
max
-
size
);
int
minX
=
rand
.
nextInt
(
max
-
size
);
int
minY
=
rand
.
nextInt
(
max
-
size
);
int
minY
=
rand
.
nextInt
(
max
-
size
);
...
...
h2/src/test/org/h2/test/db/TestOpenClose.java
浏览文件 @
1e9832f5
...
@@ -85,7 +85,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
...
@@ -85,7 +85,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
conn
.
close
();
conn
.
close
();
Thread
.
sleep
(
950
);
Thread
.
sleep
(
950
);
long
time
=
System
.
currentTimeMillis
();
long
time
=
System
.
currentTimeMillis
();
for
(
int
i
=
0
;
System
.
currentTimeMillis
()
-
time
<
100
;
i
++
)
{
while
(
System
.
currentTimeMillis
()
-
time
<
100
)
{
conn
=
DriverManager
.
getConnection
(
url
,
user
,
password
);
conn
=
DriverManager
.
getConnection
(
url
,
user
,
password
);
conn
.
close
();
conn
.
close
();
}
}
...
...
h2/src/test/org/h2/test/db/TestTableEngines.java
浏览文件 @
1e9832f5
...
@@ -347,23 +347,20 @@ public class TestTableEngines extends TestBase {
...
@@ -347,23 +347,20 @@ public class TestTableEngines extends TestBase {
}
}
public
Cursor
find
(
TableFilter
filter
,
SearchRow
first
,
SearchRow
last
)
{
public
Cursor
find
(
TableFilter
filter
,
SearchRow
first
,
SearchRow
last
)
{
return
find
(
filter
.
get
Session
(),
filter
.
getFilterCondition
(),
first
,
last
);
return
find
(
filter
.
get
FilterCondition
()
);
}
}
public
Cursor
find
(
Session
session
,
SearchRow
first
,
SearchRow
last
)
{
public
Cursor
find
(
Session
session
,
SearchRow
first
,
SearchRow
last
)
{
return
find
(
session
,
null
,
first
,
last
);
return
find
(
null
);
}
}
/**
/**
* Search within the table.
* Search within the table.
*
*
* @param session the session
* @param filter the table filter (optional)
* @param filter the table filter (optional)
* @param first the first row (optional)
* @param last the last row (optional)
* @return the cursor
* @return the cursor
*/
*/
private
Cursor
find
(
Session
session
,
Expression
filter
,
SearchRow
first
,
SearchRow
last
)
{
private
Cursor
find
(
Expression
filter
)
{
if
(
filter
!=
null
)
{
if
(
filter
!=
null
)
{
row
.
setValue
(
1
,
ValueString
.
get
(
filter
.
getSQL
()));
row
.
setValue
(
1
,
ValueString
.
get
(
filter
.
getSQL
()));
}
}
...
...
h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java
浏览文件 @
1e9832f5
...
@@ -55,7 +55,7 @@ public class TestTwoPhaseCommit extends TestBase {
...
@@ -55,7 +55,7 @@ public class TestTwoPhaseCommit extends TestBase {
stat
.
execute
(
"CREATE TABLE TEST2(ID INT)"
);
stat
.
execute
(
"CREATE TABLE TEST2(ID INT)"
);
String
name
=
"tx12345678"
;
String
name
=
"tx12345678"
;
try
{
try
{
for
(
int
i
=
0
;;
i
++
)
{
while
(
true
)
{
stat
.
execute
(
"INSERT INTO TEST2 VALUES(1)"
);
stat
.
execute
(
"INSERT INTO TEST2 VALUES(1)"
);
name
+=
"x"
;
name
+=
"x"
;
stat
.
execute
(
"PREPARE COMMIT "
+
name
);
stat
.
execute
(
"PREPARE COMMIT "
+
name
);
...
...
h2/src/test/org/h2/test/synth/TestPowerOffFs2.java
浏览文件 @
1e9832f5
...
@@ -31,7 +31,6 @@ public class TestPowerOffFs2 extends TestBase {
...
@@ -31,7 +31,6 @@ public class TestPowerOffFs2 extends TestBase {
private
String
password
=
"sa"
;
private
String
password
=
"sa"
;
private
ArrayList
<
Connection
>
connections
=
New
.
arrayList
();
private
ArrayList
<
Connection
>
connections
=
New
.
arrayList
();
private
ArrayList
<
String
>
tables
=
New
.
arrayList
();
private
ArrayList
<
String
>
tables
=
New
.
arrayList
();
private
int
openCount
;
/**
/**
* Run just this test.
* Run just this test.
...
@@ -84,7 +83,6 @@ public class TestPowerOffFs2 extends TestBase {
...
@@ -84,7 +83,6 @@ public class TestPowerOffFs2 extends TestBase {
private
void
testCrash
(
int
x
)
throws
SQLException
{
private
void
testCrash
(
int
x
)
throws
SQLException
{
connections
.
clear
();
connections
.
clear
();
tables
.
clear
();
tables
.
clear
();
openCount
=
0
;
Random
random
=
new
Random
(
x
);
Random
random
=
new
Random
(
x
);
for
(
int
i
=
0
;;
i
++)
{
for
(
int
i
=
0
;;
i
++)
{
if
(
i
>
200
&&
connections
.
size
()
>
1
&&
tables
.
size
()
>
1
)
{
if
(
i
>
200
&&
connections
.
size
()
>
1
&&
tables
.
size
()
>
1
)
{
...
@@ -167,7 +165,6 @@ public class TestPowerOffFs2 extends TestBase {
...
@@ -167,7 +165,6 @@ public class TestPowerOffFs2 extends TestBase {
}
}
private
Connection
openConnection
()
throws
SQLException
{
private
Connection
openConnection
()
throws
SQLException
{
openCount
++;
Connection
conn
=
DriverManager
.
getConnection
(
url
,
user
,
password
);
Connection
conn
=
DriverManager
.
getConnection
(
url
,
user
,
password
);
connections
.
add
(
conn
);
connections
.
add
(
conn
);
return
conn
;
return
conn
;
...
...
h2/src/test/org/h2/test/synth/TestThreads.java
浏览文件 @
1e9832f5
...
@@ -126,7 +126,7 @@ public class TestThreads extends TestBase implements Runnable {
...
@@ -126,7 +126,7 @@ public class TestThreads extends TestBase implements Runnable {
ResultSet
rs
;
ResultSet
rs
;
int
max
=
master
.
getMaxId
();
int
max
=
master
.
getMaxId
();
int
rid
=
random
.
nextInt
(
max
);
int
rid
=
random
.
nextInt
(
max
);
for
(
int
i
=
0
;
!
master
.
stop
;
i
++
)
{
while
(!
master
.
stop
)
{
switch
(
type
)
{
switch
(
type
)
{
case
INSERT:
case
INSERT:
max
=
master
.
incrementMaxId
();
max
=
master
.
incrementMaxId
();
...
...
h2/src/test/org/h2/test/unit/TestCache.java
浏览文件 @
1e9832f5
...
@@ -88,12 +88,10 @@ public class TestCache extends TestBase implements CacheWriter {
...
@@ -88,12 +88,10 @@ public class TestCache extends TestBase implements CacheWriter {
int
rc
;
int
rc
;
prep
=
conn
.
prepareStatement
(
"select * from test where id = ?"
);
prep
=
conn
.
prepareStatement
(
"select * from test where id = ?"
);
rc
=
getReadCount
(
stat
);
rc
=
getReadCount
(
stat
);
int
p
=
0
;
for
(
int
x
=
0
;
x
<
2
;
x
++)
{
for
(
int
x
=
0
;
x
<
2
;
x
++)
{
for
(
int
i
=
0
;
i
<
15000
;
i
++)
{
for
(
int
i
=
0
;
i
<
15000
;
i
++)
{
prep
.
setInt
(
1
,
i
);
prep
.
setInt
(
1
,
i
);
prep
.
executeQuery
();
prep
.
executeQuery
();
p
++;
}
}
}
}
int
rcData
=
getReadCount
(
stat
)
-
rc
;
int
rcData
=
getReadCount
(
stat
)
-
rc
;
...
...
h2/src/test/org/h2/test/unit/TestCompress.java
浏览文件 @
1e9832f5
...
@@ -159,13 +159,12 @@ public class TestCompress extends TestBase {
...
@@ -159,13 +159,12 @@ public class TestCompress extends TestBase {
long
time
=
System
.
currentTimeMillis
();
long
time
=
System
.
currentTimeMillis
();
for
(
int
i
=
0
;
i
<
1000
;
i
++)
{
for
(
int
i
=
0
;
i
<
1000
;
i
++)
{
InputStream
in
=
FileUtils
.
newInputStream
(
"memFS:compress.h2.db"
);
InputStream
in
=
FileUtils
.
newInputStream
(
"memFS:compress.h2.db"
);
int
total
=
0
;
while
(
true
)
{
while
(
true
)
{
int
len
=
in
.
read
(
buff
);
int
len
=
in
.
read
(
buff
);
if
(
len
<
0
)
{
if
(
len
<
0
)
{
break
;
break
;
}
}
total
+=
compress
.
compress
(
buff
,
pageSize
,
test
,
0
);
compress
.
compress
(
buff
,
pageSize
,
test
,
0
);
}
}
in
.
close
();
in
.
close
();
}
}
...
...
h2/src/tools/org/h2/build/indexer/Indexer.java
浏览文件 @
1e9832f5
...
@@ -44,7 +44,6 @@ public class Indexer {
...
@@ -44,7 +44,6 @@ public class Indexer {
private
HashMap
<
String
,
Word
>
words
=
new
HashMap
<
String
,
Word
>();
private
HashMap
<
String
,
Word
>
words
=
new
HashMap
<
String
,
Word
>();
private
HashSet
<
String
>
noIndex
=
new
HashSet
<
String
>();
private
HashSet
<
String
>
noIndex
=
new
HashSet
<
String
>();
private
ArrayList
<
Word
>
wordList
;
private
ArrayList
<
Word
>
wordList
;
private
int
totalAllWeights
;
private
PrintWriter
output
;
private
PrintWriter
output
;
private
Page
page
;
private
Page
page
;
private
boolean
title
;
private
boolean
title
;
...
@@ -350,7 +349,6 @@ public class Indexer {
...
@@ -350,7 +349,6 @@ public class Indexer {
word
.
name
=
token
.
compareTo
(
word
.
name
)
>
0
?
token
:
word
.
name
;
word
.
name
=
token
.
compareTo
(
word
.
name
)
>
0
?
token
:
word
.
name
;
}
}
page
.
totalWeight
+=
weight
;
page
.
totalWeight
+=
weight
;
totalAllWeights
+=
weight
;
word
.
addPage
(
page
,
weight
);
word
.
addPage
(
page
,
weight
);
}
}
}
}
...
...
h2/src/tools/org/h2/jaqu/ModelUtils.java
浏览文件 @
1e9832f5
...
@@ -298,7 +298,7 @@ public class ModelUtils {
...
@@ -298,7 +298,7 @@ public class ModelUtils {
try
{
try
{
// delegate to static valueOf() method to parse string
// delegate to static valueOf() method to parse string
Method
m
=
modelClass
.
getMethod
(
"valueOf"
,
String
.
class
);
Method
m
=
modelClass
.
getMethod
(
"valueOf"
,
String
.
class
);
Object
o
=
m
.
invoke
(
null
,
unquoted
);
m
.
invoke
(
null
,
unquoted
);
}
catch
(
NumberFormatException
ex
)
{
}
catch
(
NumberFormatException
ex
)
{
return
false
;
return
false
;
}
catch
(
Throwable
t
)
{
}
catch
(
Throwable
t
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论