Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
4e085985
提交
4e085985
authored
10月 17, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
efb95058
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
86 行增加
和
69 行删除
+86
-69
download.html
h2/src/docsrc/html/download.html
+1
-1
mainWeb.html
h2/src/docsrc/html/mainWeb.html
+1
-1
RuleFixed.java
h2/src/main/org/h2/bnf/RuleFixed.java
+1
-1
RuleRepeat.java
h2/src/main/org/h2/bnf/RuleRepeat.java
+1
-1
Sentence.java
h2/src/main/org/h2/bnf/Sentence.java
+1
-1
CommandRemote.java
h2/src/main/org/h2/command/CommandRemote.java
+1
-1
JdbcConnection.java
h2/src/main/org/h2/jdbc/JdbcConnection.java
+4
-4
ResultRemote.java
h2/src/main/org/h2/result/ResultRemote.java
+7
-7
TestLob.java
h2/src/test/org/h2/test/db/TestLob.java
+0
-1
TestMultiConn.java
h2/src/test/org/h2/test/db/TestMultiConn.java
+1
-2
TestCancel.java
h2/src/test/org/h2/test/jdbc/TestCancel.java
+1
-1
TestResultSet.java
h2/src/test/org/h2/test/jdbc/TestResultSet.java
+11
-2
TestRecover.java
h2/src/test/org/h2/test/poweroff/TestRecover.java
+1
-1
TestHaltApp.java
h2/src/test/org/h2/test/synth/TestHaltApp.java
+1
-1
TestThreads.java
h2/src/test/org/h2/test/synth/TestThreads.java
+1
-1
FtpClient.java
h2/src/test/org/h2/test/unit/FtpClient.java
+8
-6
TestServlet.java
h2/src/test/org/h2/test/unit/TestServlet.java
+1
-1
TestStringCache.java
h2/src/test/org/h2/test/unit/TestStringCache.java
+1
-1
TestTools.java
h2/src/test/org/h2/test/unit/TestTools.java
+2
-2
BuildBase.java
h2/src/tools/org/h2/build/BuildBase.java
+10
-6
PropertiesToUTF8.java
h2/src/tools/org/h2/build/i18n/PropertiesToUTF8.java
+31
-27
没有找到文件。
h2/src/docsrc/html/download.html
浏览文件 @
4e085985
...
...
@@ -31,7 +31,7 @@ Downloads
<a
href=
"http://www.h2database.com/h2-${stableVersionDate}.zip"
>
Platform-Independent Zip
</a><br
/>
</p>
<h3>
Download Older Versions
</h3>
<h3>
Download
Mirror and
Older Versions
</h3>
<p>
<a
href=
"http://code.google.com/p/h2database/downloads/list"
>
Platform-Independent Zip
</a><br
/>
</p>
...
...
h2/src/docsrc/html/mainWeb.html
浏览文件 @
4e085985
...
...
@@ -44,7 +44,7 @@ Welcome to H2, the Java SQL database. The main feature of H2 are:
<tr><td
style=
"border: 0px; background-color: #eee;"
>
<a
href=
"http://www.h2database.com/h2-${versionDate}.zip"
><img
border=
"1"
src=
"images/download.png"
alt=
"download"
/></a>
</td><td
style=
"vertical-align: middle; border: 0px; background-color: #eee;"
>
<a
href=
"http://www.h2database.com/h2-${versionDate}.zip"
>
All platforms (zip, 4.
6
MB)
</a>
<a
href=
"http://www.h2database.com/h2-${versionDate}.zip"
>
All platforms (zip, 4.
7
MB)
</a>
</td></tr>
<tr><td
style=
"border: 0px; background-color: #eee;"
colspan=
"2"
>
<a
href=
"download.html"
>
All Downloads (including Stable)
</a>
...
...
h2/src/main/org/h2/bnf/RuleFixed.java
浏览文件 @
4e085985
...
...
@@ -215,7 +215,7 @@ public class RuleFixed implements Rule {
default
:
throw
new
Error
(
"type="
+
type
);
}
if
(
s
==
query
)
{
if
(
s
.
equals
(
query
)
)
{
return
false
;
}
sentence
.
setQuery
(
s
);
...
...
h2/src/main/org/h2/bnf/RuleRepeat.java
浏览文件 @
4e085985
...
...
@@ -64,7 +64,7 @@ public class RuleRepeat implements Rule {
String
old
=
sentence
.
getQuery
();
while
(
true
)
{
rule
.
addNextTokenList
(
sentence
);
if
(!
rule
.
matchRemove
(
sentence
)
||
old
==
sentence
.
getQuery
(
))
{
if
(!
rule
.
matchRemove
(
sentence
)
||
old
.
equals
(
sentence
.
getQuery
()
))
{
break
;
}
}
...
...
h2/src/main/org/h2/bnf/Sentence.java
浏览文件 @
4e085985
...
...
@@ -183,7 +183,7 @@ public class Sentence {
* @param query the query string
*/
public
void
setQuery
(
String
query
)
{
if
(
this
.
query
!=
query
)
{
if
(
!
this
.
query
.
equals
(
query
)
)
{
this
.
query
=
query
;
this
.
queryUpper
=
StringUtils
.
toUpperEnglish
(
query
);
}
...
...
h2/src/main/org/h2/command/CommandRemote.java
浏览文件 @
4e085985
...
...
@@ -235,8 +235,8 @@ public class CommandRemote implements CommandInterface {
trace
.
error
(
"close"
,
e
);
}
}
session
=
null
;
}
session
=
null
;
int
len
=
parameters
.
size
();
try
{
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
...
...
h2/src/main/org/h2/jdbc/JdbcConnection.java
浏览文件 @
4e085985
...
...
@@ -299,8 +299,8 @@ public class JdbcConnection extends TraceObject implements Connection {
return
;
}
session
.
cancel
();
synchronized
(
session
)
{
try
{
try
{
synchronized
(
session
)
{
if
(!
session
.
isClosed
())
{
try
{
rollbackInternal
();
...
...
@@ -319,9 +319,9 @@ public class JdbcConnection extends TraceObject implements Connection {
session
.
close
();
}
}
}
finally
{
session
=
null
;
}
}
finally
{
session
=
null
;
}
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
...
...
h2/src/main/org/h2/result/ResultRemote.java
浏览文件 @
4e085985
...
...
@@ -144,16 +144,16 @@ public class ResultRemote implements ResultInterface {
return
;
}
// TODO result sets: no reset possible for larger remote result sets
synchronized
(
session
)
{
try
{
try
{
synchronized
(
session
)
{
session
.
traceOperation
(
"RESULT_CLOSE"
,
id
);
transfer
.
writeInt
(
SessionRemote
.
RESULT_CLOSE
).
writeInt
(
id
);
}
catch
(
IOException
e
)
{
session
.
getTrace
().
error
(
"close"
,
e
);
}
finally
{
transfer
=
null
;
session
=
null
;
}
}
catch
(
IOException
e
)
{
session
.
getTrace
().
error
(
"close"
,
e
);
}
finally
{
transfer
=
null
;
session
=
null
;
}
}
...
...
h2/src/test/org/h2/test/db/TestLob.java
浏览文件 @
4e085985
...
...
@@ -667,7 +667,6 @@ public class TestLob extends TestBase {
checkStream
(
new
ByteArrayInputStream
(
data
),
rs
.
getBinaryStream
(
"TEXT"
),
-
1
);
prep
=
conn
.
prepareStatement
(
"UPDATE TEST SET TEXT = ?"
);
s
=
new
String
(
getRandomChars
(
10201
,
1
));
prep
.
setBinaryStream
(
1
,
new
ByteArrayInputStream
(
data
),
0
);
prep
.
execute
();
...
...
h2/src/test/org/h2/test/db/TestMultiConn.java
浏览文件 @
4e085985
...
...
@@ -152,10 +152,9 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener {
}
public
void
setProgress
(
int
state
,
String
name
,
int
x
,
int
max
)
{
while
(
wait
>
0
)
{
if
(
wait
>
0
)
{
try
{
Thread
.
sleep
(
wait
);
wait
=
0
;
}
catch
(
InterruptedException
e
)
{
TestBase
.
logError
(
"sleep"
,
e
);
}
...
...
h2/src/test/org/h2/test/jdbc/TestCancel.java
浏览文件 @
4e085985
...
...
@@ -27,7 +27,7 @@ public class TestCancel extends TestBase {
/**
* This thread cancels a statement after some time.
*/
class
CancelThread
extends
Thread
{
static
class
CancelThread
extends
Thread
{
private
Statement
cancel
;
private
int
wait
;
private
volatile
boolean
stop
;
...
...
h2/src/test/org/h2/test/jdbc/TestResultSet.java
浏览文件 @
4e085985
...
...
@@ -35,6 +35,15 @@ public class TestResultSet extends TestBase {
private
Connection
conn
;
private
Statement
stat
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
deleteDb
(
"resultSet"
);
...
...
@@ -654,8 +663,8 @@ public class TestResultSet extends TestBase {
assertEquals
(
date
.
getTime
(),
java
.
sql
.
Timestamp
.
valueOf
(
"2011-11-11 00:00:00.0"
).
getTime
());
assertEquals
(
time
.
getTime
(),
java
.
sql
.
Timestamp
.
valueOf
(
"1970-01-01 00:00:00.0"
).
getTime
());
assertEquals
(
ts
.
getTime
(),
java
.
sql
.
Timestamp
.
valueOf
(
"2011-11-11 00:00:00.0"
).
getTime
());
assertTrue
(
date
.
equals
(
java
.
sql
.
Timestamp
.
valueOf
(
"2011-11-11 00:00:00.0
"
)));
assertTrue
(
time
.
equals
(
java
.
sql
.
Time
stamp
.
valueOf
(
"1970-01-01 00:00:00.
0"
)));
assertTrue
(
date
.
equals
(
java
.
sql
.
Date
.
valueOf
(
"2011-11-11
"
)));
assertTrue
(
time
.
equals
(
java
.
sql
.
Time
.
valueOf
(
"00:00:0
0"
)));
assertTrue
(
ts
.
equals
(
java
.
sql
.
Timestamp
.
valueOf
(
"2011-11-11 00:00:00.0"
)));
assertFalse
(
rs
.
wasNull
());
o
=
rs
.
getObject
(
2
);
...
...
h2/src/test/org/h2/test/poweroff/TestRecover.java
浏览文件 @
4e085985
...
...
@@ -295,7 +295,7 @@ public class TestRecover {
int
id
=
rs
.
getInt
(
"ID"
);
String
name
=
rs
.
getString
(
"NAME"
);
int
value
=
Integer
.
parseInt
(
name
);
if
(
value
%
2
==
1
)
{
if
(
value
%
2
==
0
)
{
throw
new
Exception
(
"unexpected odd entry "
+
id
);
}
max
=
Math
.
max
(
max
,
id
);
...
...
h2/src/test/org/h2/test/synth/TestHaltApp.java
浏览文件 @
4e085985
...
...
@@ -77,7 +77,7 @@ public class TestHaltApp extends TestHalt {
rs
.
next
();
int
count
=
rs
.
getInt
(
1
);
System
.
out
.
println
(
"count: "
+
count
);
if
(
count
%
2
==
1
)
{
if
(
count
%
2
==
0
)
{
traceOperation
(
"row count: "
+
count
);
throw
new
SQLException
(
"Unexpected odd row count"
);
}
...
...
h2/src/test/org/h2/test/synth/TestThreads.java
浏览文件 @
4e085985
...
...
@@ -60,7 +60,7 @@ public class TestThreads extends TestBase implements Runnable {
for
(
int
i
=
0
;
i
<
threadCount
;
i
++)
{
String
table
=
random
.
nextBoolean
()
?
null
:
getRandomTable
();
int
op
=
random
.
nextInt
(
OP_TYPES
);
op
=
i
%
2
==
1
?
RECONNECT
:
CHECKPOINT
;
op
=
i
%
2
==
0
?
RECONNECT
:
CHECKPOINT
;
threads
[
i
]
=
new
Thread
(
new
TestThreads
(
this
,
op
,
table
));
}
for
(
int
i
=
0
;
i
<
threadCount
;
i
++)
{
...
...
h2/src/test/org/h2/test/unit/FtpClient.java
浏览文件 @
4e085985
...
...
@@ -62,12 +62,14 @@ public class FtpClient {
private
void
readLine
()
throws
IOException
{
message
=
reader
.
readLine
();
int
idx
=
message
.
indexOf
(
' '
);
if
(
idx
<
0
)
{
code
=
0
;
}
else
{
code
=
Integer
.
parseInt
(
message
.
substring
(
0
,
idx
));
message
=
message
.
substring
(
idx
+
1
);
if
(
message
!=
null
)
{
int
idx
=
message
.
indexOf
(
' '
);
if
(
idx
<
0
)
{
code
=
0
;
}
else
{
code
=
Integer
.
parseInt
(
message
.
substring
(
0
,
idx
));
message
=
message
.
substring
(
idx
+
1
);
}
}
}
...
...
h2/src/test/org/h2/test/unit/TestServlet.java
浏览文件 @
4e085985
...
...
@@ -203,7 +203,7 @@ public class TestServlet extends TestBase {
// listener must be stopped
try
{
conn2
=
DriverManager
.
getConnection
(
"jdbc:h2:tcp://localhost:8888/"
+
baseDir
+
"/servlet"
,
getUser
(),
getPassword
());
DriverManager
.
getConnection
(
"jdbc:h2:tcp://localhost:8888/"
+
baseDir
+
"/servlet"
,
getUser
(),
getPassword
());
fail
();
}
catch
(
SQLException
e
)
{
assertKnownException
(
e
);
...
...
h2/src/test/org/h2/test/unit/TestStringCache.java
浏览文件 @
4e085985
...
...
@@ -49,7 +49,7 @@ public class TestStringCache extends TestBase {
private
void
runBenchmark
()
{
returnNew
=
false
;
for
(
int
i
=
0
;
i
<
6
;
i
++)
{
useIntern
=
(
i
%
2
)
==
1
;
useIntern
=
(
i
%
2
)
==
0
;
long
time
=
System
.
currentTimeMillis
();
testSingleThread
(
100000
);
time
=
System
.
currentTimeMillis
()
-
time
;
...
...
h2/src/test/org/h2/test/unit/TestTools.java
浏览文件 @
4e085985
...
...
@@ -93,7 +93,7 @@ public class TestTools extends TestBase {
result
=
runServer
(
new
String
[]{
"-tcpShutdown"
,
"ssl://localhost:9001"
,
"-tcpPassword"
,
"abcdef"
},
0
);
assertTrue
(
result
.
indexOf
(
"Shutting down"
)
>=
0
);
try
{
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:ssl://localhost:9001/mem:"
,
"sa"
,
"sa"
);
DriverManager
.
getConnection
(
"jdbc:h2:ssl://localhost:9001/mem:"
,
"sa"
,
"sa"
);
fail
();
}
catch
(
SQLException
e
)
{
assertKnownException
(
e
);
...
...
@@ -418,7 +418,7 @@ public class TestTools extends TestBase {
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:tcp://localhost:9192/test"
,
"sa"
,
""
);
conn
.
close
();
server
.
stop
();
server
=
Server
.
createTcpServer
(
Server
.
createTcpServer
(
new
String
[]
{
"-ifExists"
,
"-tcpPassword"
,
"abc"
,
"-baseDir"
,
baseDir
,
"-tcpPort"
,
"9192"
}).
start
();
try
{
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:tcp://localhost:9192/test2"
,
"sa"
,
""
);
...
...
h2/src/tools/org/h2/build/BuildBase.java
浏览文件 @
4e085985
...
...
@@ -278,7 +278,7 @@ public class BuildBase {
File
f
=
(
File
)
files
.
get
(
i
);
File
t
=
new
File
(
target
,
removeBase
(
basePath
,
f
.
getPath
()));
byte
[]
data
=
readFile
(
f
);
t
.
getParentFile
().
mkdirs
(
);
mkdirs
(
t
.
getParentFile
()
);
writeFile
(
t
,
data
);
}
}
...
...
@@ -388,7 +388,7 @@ public class BuildBase {
if
(
targetFile
.
exists
())
{
return
;
}
targetFile
.
getAbsoluteFile
().
getParentFile
().
mkdirs
(
);
mkdirs
(
targetFile
.
getAbsoluteFile
().
getParentFile
()
);
ByteArrayOutputStream
buff
=
new
ByteArrayOutputStream
();
try
{
println
(
"Downloading "
+
fileURL
);
...
...
@@ -589,7 +589,7 @@ public class BuildBase {
}
});
}
new
File
(
destFile
).
getAbsoluteFile
().
getParentFile
().
mkdirs
(
);
mkdirs
(
new
File
(
destFile
).
getAbsoluteFile
().
getParentFile
()
);
// normalize the path (replace / with \ if required)
basePath
=
new
File
(
basePath
).
getPath
();
try
{
...
...
@@ -709,12 +709,16 @@ public class BuildBase {
throw
new
Error
(
"Can not create directory "
+
dir
+
" because a file with this name exists"
);
}
}
else
{
if
(!
f
.
mkdirs
())
{
throw
new
Error
(
"Can not create directory "
+
dir
);
}
mkdirs
(
f
);
}
}
private
void
mkdirs
(
File
f
)
{
if
(!
f
.
mkdirs
())
{
throw
new
Error
(
"Can not create directory "
+
f
.
getAbsolutePath
());
}
}
/**
* Delete all files in the given directory and all subdirectories.
*
...
...
h2/src/tools/org/h2/build/i18n/PropertiesToUTF8.java
浏览文件 @
4e085985
...
...
@@ -85,37 +85,41 @@ public class PropertiesToUTF8 {
return
;
}
LineNumberReader
reader
=
new
LineNumberReader
(
new
InputStreamReader
(
new
FileInputStream
(
source
),
"UTF-8"
));
Properties
prop
=
new
SortedProperties
();
StringBuffer
buff
=
new
StringBuffer
();
String
key
=
null
;
boolean
found
=
false
;
while
(
true
)
{
String
line
=
reader
.
readLine
();
if
(
line
==
null
)
{
break
;
}
line
=
line
.
trim
();
if
(
line
.
length
()
==
0
)
{
continue
;
}
if
(
line
.
startsWith
(
"@"
))
{
if
(
key
!=
null
)
{
prop
.
setProperty
(
key
,
buff
.
toString
());
buff
.
setLength
(
0
);
try
{
Properties
prop
=
new
SortedProperties
();
StringBuffer
buff
=
new
StringBuffer
();
String
key
=
null
;
boolean
found
=
false
;
while
(
true
)
{
String
line
=
reader
.
readLine
();
if
(
line
==
null
)
{
break
;
}
found
=
true
;
key
=
line
.
substring
(
1
);
}
else
{
if
(
buff
.
length
()
>
0
)
{
buff
.
append
(
System
.
getProperty
(
"line.separator"
));
line
=
line
.
trim
();
if
(
line
.
length
()
==
0
)
{
continue
;
}
if
(
line
.
startsWith
(
"@"
))
{
if
(
key
!=
null
)
{
prop
.
setProperty
(
key
,
buff
.
toString
());
buff
.
setLength
(
0
);
}
found
=
true
;
key
=
line
.
substring
(
1
);
}
else
{
if
(
buff
.
length
()
>
0
)
{
buff
.
append
(
System
.
getProperty
(
"line.separator"
));
}
buff
.
append
(
line
);
}
buff
.
append
(
line
);
}
if
(
found
)
{
prop
.
setProperty
(
key
,
buff
.
toString
());
}
storeProperties
(
prop
,
target
);
}
finally
{
reader
.
close
();
}
if
(
found
)
{
prop
.
setProperty
(
key
,
buff
.
toString
());
}
storeProperties
(
prop
,
target
);
}
private
static
void
convert
(
String
source
)
throws
Exception
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论