Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
a4afb494
提交
a4afb494
authored
7月 17, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix Eclipse 3.5 warnings
上级
383a7c09
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
39 行增加
和
33 行删除
+39
-33
Restore.java
h2/src/main/org/h2/tools/Restore.java
+4
-2
SimpleResultSet.java
h2/src/main/org/h2/tools/SimpleResultSet.java
+1
-1
StringCache.java
h2/src/main/org/h2/util/StringCache.java
+7
-6
Profile.java
h2/src/test/org/h2/test/coverage/Profile.java
+9
-7
TestCompatibility.java
h2/src/test/org/h2/test/db/TestCompatibility.java
+1
-7
TestAutoServer.java
h2/src/test/org/h2/test/server/TestAutoServer.java
+3
-3
TestValueHashMap.java
h2/src/test/org/h2/test/unit/TestValueHashMap.java
+1
-1
PgTcpRedirect.java
h2/src/tools/org/h2/dev/net/PgTcpRedirect.java
+4
-2
Query.java
h2/src/tools/org/h2/jaqu/Query.java
+9
-4
没有找到文件。
h2/src/main/org/h2/tools/Restore.java
浏览文件 @
a4afb494
...
...
@@ -103,7 +103,7 @@ public class Restore extends Tool {
}
}
zipIn
.
close
();
if
(
multiple
&&
!
originalDbName
.
equals
(
db
))
{
if
(
multiple
&&
!
db
.
equals
(
originalDbName
))
{
throw
new
IOException
(
"Multiple databases found, but not "
+
db
);
}
return
originalDbName
;
...
...
@@ -141,6 +141,7 @@ public class Restore extends Tool {
throw
new
IOException
(
"File not found: "
+
zipFileName
);
}
String
originalDbName
=
null
;
int
originalDbLen
=
0
;
if
(
db
!=
null
)
{
originalDbName
=
getOriginalDbName
(
zipFileName
,
db
);
if
(
originalDbName
==
null
)
{
...
...
@@ -149,6 +150,7 @@ public class Restore extends Tool {
if
(
originalDbName
.
startsWith
(
File
.
separator
))
{
originalDbName
=
originalDbName
.
substring
(
1
);
}
originalDbLen
=
originalDbName
.
length
();
}
in
=
FileUtils
.
openFileInputStream
(
zipFileName
);
ZipInputStream
zipIn
=
new
ZipInputStream
(
in
);
...
...
@@ -168,7 +170,7 @@ public class Restore extends Tool {
if
(
db
==
null
)
{
copy
=
true
;
}
else
if
(
fileName
.
startsWith
(
originalDbName
+
"."
))
{
fileName
=
db
+
fileName
.
substring
(
originalDb
Name
.
length
()
);
fileName
=
db
+
fileName
.
substring
(
originalDb
Len
);
copy
=
true
;
}
if
(
copy
)
{
...
...
h2/src/main/org/h2/tools/SimpleResultSet.java
浏览文件 @
a4afb494
...
...
@@ -91,7 +91,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
* A simple array implementation,
* backed by an object array
*/
p
rivate
static
class
SimpleArray
implements
Array
{
p
ublic
static
class
SimpleArray
implements
Array
{
private
Object
[]
value
;
...
...
h2/src/main/org/h2/util/StringCache.java
浏览文件 @
a4afb494
...
...
@@ -77,12 +77,13 @@ public class StringCache {
int
hash
=
s
.
hashCode
();
String
[]
cache
=
getCache
();
int
index
=
hash
&
(
SysProperties
.
OBJECT_CACHE_SIZE
-
1
);
if
(
cache
!=
null
)
{
String
cached
=
cache
[
index
];
if
(
cached
!=
null
)
{
if
(
s
.
equals
(
cached
))
{
return
cached
;
}
if
(
cache
==
null
)
{
return
s
;
}
String
cached
=
cache
[
index
];
if
(
cached
!=
null
)
{
if
(
s
.
equals
(
cached
))
{
return
cached
;
}
}
// create a new object that is not shared
...
...
h2/src/test/org/h2/test/coverage/Profile.java
浏览文件 @
a4afb494
...
...
@@ -133,13 +133,15 @@ public class Profile extends Thread {
return
;
}
long
now
=
System
.
currentTimeMillis
();
if
(
TRACE
&&
trace
!=
null
)
{
int
duration
=
(
int
)
(
now
-
lastTime
);
try
{
trace
.
write
(
i
+
"\t"
+
duration
+
"\r\n"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
System
.
exit
(
1
);
if
(
TRACE
)
{
if
(
trace
!=
null
)
{
int
duration
=
(
int
)
(
now
-
lastTime
);
try
{
trace
.
write
(
i
+
"\t"
+
duration
+
"\r\n"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
System
.
exit
(
1
);
}
}
}
count
[
i
]++;
...
...
h2/src/test/org/h2/test/db/TestCompatibility.java
浏览文件 @
a4afb494
...
...
@@ -12,8 +12,6 @@ import java.sql.ResultSet;
import
java.sql.ResultSetMetaData
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
org.h2.engine.Constants
;
import
org.h2.test.TestBase
;
/**
...
...
@@ -70,11 +68,7 @@ public class TestCompatibility extends TestBase {
Statement
stat
=
conn
.
createStatement
();
String
[]
modes
=
new
String
[]
{
"PostgreSQL"
,
"MySQL"
,
"HSQLDB"
,
"MSSQLServer"
,
"Derby"
,
"Oracle"
,
"Regular"
};
String
columnAlias
;
if
(
Constants
.
VERSION_MINOR
==
0
)
{
columnAlias
=
"MySQL"
;
}
else
{
columnAlias
=
"MySQL,Regular"
;
}
columnAlias
=
"MySQL,Regular"
;
stat
.
execute
(
"CREATE TABLE TEST(ID INT)"
);
for
(
String
mode
:
modes
)
{
stat
.
execute
(
"SET MODE "
+
mode
);
...
...
h2/src/test/org/h2/test/server/TestAutoServer.java
浏览文件 @
a4afb494
...
...
@@ -20,9 +20,9 @@ import org.h2.util.SortedProperties;
public
class
TestAutoServer
extends
TestBase
{
/**
*
If enabled, this flag allows to debug the test case
.
*
The number of iterations
.
*/
static
final
boolean
SLOW
=
false
;
static
final
int
ITERATIONS
=
30
;
/**
* Run just this test.
...
...
@@ -42,7 +42,7 @@ public class TestAutoServer extends TestBase {
String
user
=
getUser
(),
password
=
getPassword
();
Connection
connServer
=
getConnection
(
url
+
";OPEN_NEW=TRUE"
,
user
,
password
);
int
i
=
SLOW
?
Integer
.
MAX_VALUE
:
30
;
int
i
=
ITERATIONS
;
for
(;
i
>
0
;
i
--)
{
Thread
.
sleep
(
100
);
SortedProperties
prop
=
SortedProperties
.
loadProperties
(
baseDir
+
"/autoServer.lock.db"
);
...
...
h2/src/test/org/h2/test/unit/TestValueHashMap.java
浏览文件 @
a4afb494
...
...
@@ -86,7 +86,7 @@ public class TestValueHashMap extends TestBase implements DataHandler {
case
2
:
Value
v1
=
map
.
get
(
key
);
Value
v2
=
hash
.
get
(
key
);
assertTrue
(
(
v1
==
null
&&
v2
==
null
)
||
v1
.
compareEqual
(
v2
));
assertTrue
(
v1
==
null
?
v2
==
null
:
v1
.
compareEqual
(
v2
));
break
;
case
3
:
{
ObjectArray
<
Value
>
a1
=
map
.
keys
();
...
...
h2/src/tools/org/h2/dev/net/PgTcpRedirect.java
浏览文件 @
a4afb494
...
...
@@ -22,6 +22,8 @@ import java.net.Socket;
*/
public
class
PgTcpRedirect
{
private
static
final
boolean
DEBUG
=
false
;
/**
* This method is called when executing this application from the command
* line.
...
...
@@ -92,7 +94,7 @@ public class PgTcpRedirect {
}
private
void
println
(
String
s
)
{
if
(
false
)
{
if
(
DEBUG
)
{
System
.
out
.
println
(
s
);
}
}
...
...
@@ -536,7 +538,7 @@ public class PgTcpRedirect {
* @param len the length
*/
synchronized
void
printData
(
byte
[]
buffer
,
int
len
)
{
if
(
false
)
{
if
(
DEBUG
)
{
System
.
out
.
print
(
" "
);
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
int
c
=
buffer
[
i
]
&
255
;
...
...
h2/src/tools/org/h2/jaqu/Query.java
浏览文件 @
a4afb494
...
...
@@ -7,6 +7,7 @@
package
org
.
h2
.
jaqu
;
//## Java 1.5 begin ##
import
java.lang.reflect.Field
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
...
...
@@ -165,10 +166,14 @@ public class Query<T> {
public
<
A
>
QueryWhere
<
T
>
where
(
Filter
filter
)
{
// TODO decompile the filter and add conditions accordingly
// for (Field f : filter.getClass().getDeclaredFields()) {
// f.setAccessible(true);
// try { System.out.println(f.getName() + "=" + f.get(filter));
// } catch (Exception e) { } }
for
(
Field
f
:
filter
.
getClass
().
getDeclaredFields
())
{
f
.
setAccessible
(
true
);
// try {
// System.out.println(f.getName() + "=" + f.get(filter));
// } catch (Exception e) {
// // convert
// }
}
return
new
QueryWhere
<
T
>(
this
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论