Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d6fdf873
提交
d6fdf873
authored
11月 09, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
391f3743
隐藏空白字符变更
内嵌
并排
正在显示
22 个修改的文件
包含
64 行增加
和
61 行删除
+64
-61
ant-build.properties
h2/ant-build.properties
+2
-2
build.xml
h2/build.xml
+1
-3
build.html
h2/src/docsrc/html/build.html
+1
-1
download.html
h2/src/docsrc/html/download.html
+3
-3
mainWeb.html
h2/src/docsrc/html/mainWeb.html
+5
-5
_docs_de.utf8.txt
h2/src/docsrc/text/_docs_de.utf8.txt
+2
-2
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+2
-2
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+2
-2
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+2
-2
ScriptCommand.java
h2/src/main/org/h2/command/dml/ScriptCommand.java
+3
-3
Constants.java
h2/src/main/org/h2/engine/Constants.java
+4
-3
JdbcResultSetMetaData.java
h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java
+1
-1
LogFile.java
h2/src/main/org/h2/log/LogFile.java
+2
-0
LogSystem.java
h2/src/main/org/h2/log/LogSystem.java
+9
-9
FtpData.java
h2/src/main/org/h2/server/ftp/FtpData.java
+1
-1
FileStore.java
h2/src/main/org/h2/store/FileStore.java
+1
-1
FileObjectZip.java
h2/src/main/org/h2/store/fs/FileObjectZip.java
+8
-2
IOUtils.java
h2/src/main/org/h2/util/IOUtils.java
+8
-12
ValueLob.java
h2/src/main/org/h2/value/ValueLob.java
+2
-3
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+2
-0
TestHaltApp.java
h2/src/test/org/h2/test/synth/TestHaltApp.java
+1
-1
TestFileSystem.java
h2/src/test/org/h2/test/unit/TestFileSystem.java
+2
-3
没有找到文件。
h2/ant-build.properties
浏览文件 @
d6fdf873
#Fri
Oct 26 09:46:47 CES
T 2007
#Fri
Nov 09 12:31:47 CE
T 2007
benchmark.drivers.dir
=
C
\:
/data/java
benchmark.drivers.dir
=
C
\:
/data/java
javac
=
javac
javac
=
javac
path.servlet.jar
=
C
\:
/data/classpath/servlet-api.jar
path.servlet.jar
=
C
\:
/data/classpath/servlet-api.jar
path.lucene.jar
=
C
\:
/data/classpath/lucene-core-2.2.0.jar
path.lucene.jar
=
C
\:
/data/classpath/lucene-core-2.2.0.jar
version.name.maven
=
1.0.6
0
version.name.maven
=
1.0.6
1
jdk
=
1.4
jdk
=
1.4
h2/build.xml
浏览文件 @
d6fdf873
...
@@ -254,9 +254,7 @@
...
@@ -254,9 +254,7 @@
</target>
</target>
<target
name=
"javadocImpl"
>
<target
name=
"javadocImpl"
>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
srcdir=
"src/test"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/test/bnf/*.java"
/>
<mkdir
dir=
"docs/javadocImpl"
/>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
srcdir=
"src/tools"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/tools/doclet/*.java"
/>
<mkdir
dir=
"docs/javadoc"
/>
<javadoc
<javadoc
sourcepath=
"src/main"
sourcepath=
"src/main"
packagenames=
"org.h2.jdbc.*,org.h2.tools.*,org.h2.api.*,org.h2.store.*"
packagenames=
"org.h2.jdbc.*,org.h2.tools.*,org.h2.api.*,org.h2.store.*"
...
...
h2/src/docsrc/html/build.html
浏览文件 @
d6fdf873
...
@@ -75,7 +75,7 @@ Example:
...
@@ -75,7 +75,7 @@ Example:
<
dependency
>
<
dependency
>
<
groupId
>
com.h2database
<
/groupId
>
<
groupId
>
com.h2database
<
/groupId
>
<
artifactId
>
h2
<
/artifactId
>
<
artifactId
>
h2
<
/artifactId
>
<
version
>
1.0.6
0
<
/version
>
<
version
>
1.0.6
1
<
/version
>
<
/dependency
>
<
/dependency
>
</pre>
</pre>
</p>
</p>
...
...
h2/src/docsrc/html/download.html
浏览文件 @
d6fdf873
...
@@ -15,10 +15,10 @@ H2 Database Engine
...
@@ -15,10 +15,10 @@ H2 Database Engine
<h1>
Downloads
</h1>
<h1>
Downloads
</h1>
<h3>
Version 1.0.6
0 (2007-10-20
, Current)
</h3>
<h3>
Version 1.0.6
1 (2007-11-09
, Current)
</h3>
<p>
<p>
<a
href=
"http://www.h2database.com/h2-setup-2007-1
0-20
.exe"
>
Windows Installer
</a><br
/>
<a
href=
"http://www.h2database.com/h2-setup-2007-1
1-09
.exe"
>
Windows Installer
</a><br
/>
<a
href=
"http://www.h2database.com/h2-2007-1
0-20
.zip"
>
Platform-Independent Zip
</a><br
/>
<a
href=
"http://www.h2database.com/h2-2007-1
1-09
.zip"
>
Platform-Independent Zip
</a><br
/>
</p>
</p>
<h3>
Download Mirror
</h3>
<h3>
Download Mirror
</h3>
...
...
h2/src/docsrc/html/mainWeb.html
浏览文件 @
d6fdf873
...
@@ -31,17 +31,17 @@ Welcome to H2, the free SQL database. The main feature of H2 are:
...
@@ -31,17 +31,17 @@ Welcome to H2, the free SQL database. The main feature of H2 are:
<table
style=
"border: 0px; margin: 5px; background-color: #eee;"
>
<table
style=
"border: 0px; margin: 5px; background-color: #eee;"
>
<tr><td
style=
"border: 0px; background-color: #eee;"
colspan=
"2"
>
<tr><td
style=
"border: 0px; background-color: #eee;"
colspan=
"2"
>
<h3>
Download
</h3>
<h3>
Download
</h3>
Version 1.0.6
0 (2007-10-20
):
Version 1.0.6
1 (2007-11-09
):
</td></tr>
</td></tr>
<tr><td
style=
"border: 0px; background-color: #eee;"
>
<tr><td
style=
"border: 0px; background-color: #eee;"
>
<a
href=
"http://www.h2database.com/h2-setup-2007-1
0-20
.exe"
><img
border=
"1"
src=
"images/download.png"
alt=
"download"
/></a>
<a
href=
"http://www.h2database.com/h2-setup-2007-1
1-09
.exe"
><img
border=
"1"
src=
"images/download.png"
alt=
"download"
/></a>
</td><td
style=
"vertical-align: middle; border: 0px; background-color: #eee;"
>
</td><td
style=
"vertical-align: middle; border: 0px; background-color: #eee;"
>
<a
href=
"http://www.h2database.com/h2-setup-2007-1
0-20
.exe"
>
Windows Installer (2.8 MB)
</a>
<a
href=
"http://www.h2database.com/h2-setup-2007-1
1-09
.exe"
>
Windows Installer (2.8 MB)
</a>
</td></tr>
</td></tr>
<tr><td
style=
"border: 0px; background-color: #eee;"
>
<tr><td
style=
"border: 0px; background-color: #eee;"
>
<a
href=
"http://www.h2database.com/h2-2007-1
0-20
.zip"
><img
border=
"1"
src=
"images/download.png"
alt=
"download"
/></a>
<a
href=
"http://www.h2database.com/h2-2007-1
1-09
.zip"
><img
border=
"1"
src=
"images/download.png"
alt=
"download"
/></a>
</td><td
style=
"vertical-align: middle; border: 0px; background-color: #eee;"
>
</td><td
style=
"vertical-align: middle; border: 0px; background-color: #eee;"
>
<a
href=
"http://www.h2database.com/h2-2007-1
0-20
.zip"
>
All platforms (zip, 3.9 MB)
</a>
<a
href=
"http://www.h2database.com/h2-2007-1
1-09
.zip"
>
All platforms (zip, 3.9 MB)
</a>
</td></tr>
</td></tr>
<tr><td
style=
"border: 0px; background-color: #eee;"
colspan=
"2"
>
<tr><td
style=
"border: 0px; background-color: #eee;"
colspan=
"2"
>
<a
href=
"download.html"
>
All Downloads
</a>
<a
href=
"download.html"
>
All Downloads
</a>
...
...
h2/src/docsrc/text/_docs_de.utf8.txt
浏览文件 @
d6fdf873
...
@@ -1130,7 +1130,7 @@ Mit Maven 2
...
@@ -1130,7 +1130,7 @@ Mit Maven 2
#Downloads
#Downloads
@download_1001_h3
@download_1001_h3
#Version 1.0.6
0 (2007-10-20
, Current)
#Version 1.0.6
1 (2007-11-09
, Current)
@download_1002_a
@download_1002_a
#Windows Installer
#Windows Installer
...
@@ -3122,7 +3122,7 @@ Mit Maven 2
...
@@ -3122,7 +3122,7 @@ Mit Maven 2
#Download
#Download
@mainWeb_1007_td
@mainWeb_1007_td
#Version 1.0.6
0 (2007-10-20
):
#Version 1.0.6
1 (2007-11-09
):
@mainWeb_1008_a
@mainWeb_1008_a
#Windows Installer (2.8 MB)
#Windows Installer (2.8 MB)
...
...
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
d6fdf873
...
@@ -1130,7 +1130,7 @@ Afterwards, you can include the database in your Maven 2 project as a dependency
...
@@ -1130,7 +1130,7 @@ Afterwards, you can include the database in your Maven 2 project as a dependency
Downloads
Downloads
@download_1001_h3
@download_1001_h3
Version 1.0.6
0 (2007-10-20
, Current)
Version 1.0.6
1 (2007-11-09
, Current)
@download_1002_a
@download_1002_a
Windows Installer
Windows Installer
...
@@ -3122,7 +3122,7 @@ JDBC and (partial) ODBC API; Web Client application
...
@@ -3122,7 +3122,7 @@ JDBC and (partial) ODBC API; Web Client application
Download
Download
@mainWeb_1007_td
@mainWeb_1007_td
Version 1.0.6
0 (2007-10-20
):
Version 1.0.6
1 (2007-11-09
):
@mainWeb_1008_a
@mainWeb_1008_a
Windows Installer (2.8 MB)
Windows Installer (2.8 MB)
...
...
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
d6fdf873
...
@@ -1132,7 +1132,7 @@ Centralリポジトリの利用
...
@@ -1132,7 +1132,7 @@ Centralリポジトリの利用
ダウンロード
ダウンロード
@download_1001_h3
@download_1001_h3
#Version 1.0.6
0 (2007-10-20
, Current)
#Version 1.0.6
1 (2007-11-09
, Current)
@download_1002_a
@download_1002_a
Windows Installer
Windows Installer
...
@@ -3124,7 +3124,7 @@ JDBC、 (部分的な) ODBC API; Web クライアントアプリケーション
...
@@ -3124,7 +3124,7 @@ JDBC、 (部分的な) ODBC API; Web クライアントアプリケーション
ダウンロード
ダウンロード
@mainWeb_1007_td
@mainWeb_1007_td
#Version 1.0.6
0 (2007-10-20
):
#Version 1.0.6
1 (2007-11-09
):
@mainWeb_1008_a
@mainWeb_1008_a
#Windows Installer (2.8 MB)
#Windows Installer (2.8 MB)
...
...
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
d6fdf873
...
@@ -375,7 +375,7 @@ build_1024_h3=Using Snapshot Version
...
@@ -375,7 +375,7 @@ build_1024_h3=Using Snapshot Version
build_1025_p
=
To build a 'snapshot' H2 .jar file and upload it the to the local Maven 2 repository, execute the following command
\:
build_1025_p
=
To build a 'snapshot' H2 .jar file and upload it the to the local Maven 2 repository, execute the following command
\:
build_1026_p=Afterwards, you can include the database in your Maven 2 project as a dependency
\:
build_1026_p=Afterwards, you can include the database in your Maven 2 project as a dependency
\:
download_1000_h1=Downloads
download_1000_h1=Downloads
download_1001_h3
=
Version 1.0.6
0 (2007-10-20
, Current)
download_1001_h3
=
Version 1.0.6
1 (2007-11-09
, Current)
download_1002_a
=
Windows Installer
download_1002_a
=
Windows Installer
download_1003_a
=
Platform-Independent Zip
download_1003_a
=
Platform-Independent Zip
download_1004_h3
=
Download Mirror
download_1004_h3
=
Download Mirror
...
@@ -1039,7 +1039,7 @@ mainWeb_1003_li=Written Java; can be compiled with GCJ (Linux)
...
@@ -1039,7 +1039,7 @@ mainWeb_1003_li=Written Java; can be compiled with GCJ (Linux)
mainWeb_1004_li
=
Embedded, Server and Cluster modes
mainWeb_1004_li
=
Embedded, Server and Cluster modes
mainWeb_1005_li
=
JDBC and (partial) ODBC API; Web Client application
mainWeb_1005_li
=
JDBC and (partial) ODBC API; Web Client application
mainWeb_1006_h3
=
Download
mainWeb_1006_h3
=
Download
mainWeb_1007_td
=
Version 1.0.6
0 (2007-10-20
)
\:
mainWeb_1007_td
=
Version 1.0.6
1 (2007-11-09
)
\:
mainWeb_1008_a=Windows Installer (2.8 MB)
mainWeb_1008_a=Windows Installer (2.8 MB)
mainWeb_1009_a
=
All platforms (zip, 3.9 MB)
mainWeb_1009_a
=
All platforms (zip, 3.9 MB)
mainWeb_1010_a
=
All Downloads
mainWeb_1010_a
=
All Downloads
...
...
h2/src/main/org/h2/command/dml/ScriptCommand.java
浏览文件 @
d6fdf873
...
@@ -66,7 +66,7 @@ public class ScriptCommand extends ScriptBase {
...
@@ -66,7 +66,7 @@ public class ScriptCommand extends ScriptBase {
private
byte
[]
buffer
;
private
byte
[]
buffer
;
private
boolean
tempLobTableCreated
;
private
boolean
tempLobTableCreated
;
private
int
nextLobId
;
private
int
nextLobId
;
private
int
lobBlockSize
=
Integer
.
MAX_VALU
E
;
private
int
lobBlockSize
=
Constants
.
FILE_BLOCK_SIZ
E
;
private
static
final
String
TEMP_LOB_FILENAME
=
"system_temp_lob.db"
;
private
static
final
String
TEMP_LOB_FILENAME
=
"system_temp_lob.db"
;
public
ScriptCommand
(
Session
session
)
{
public
ScriptCommand
(
Session
session
)
{
...
@@ -330,8 +330,8 @@ public class ScriptCommand extends ScriptBase {
...
@@ -330,8 +330,8 @@ public class ScriptCommand extends ScriptBase {
for
(
int
i
=
0
;;
i
++)
{
for
(
int
i
=
0
;;
i
++)
{
StringBuffer
buff
=
new
StringBuffer
(
lobBlockSize
*
2
);
StringBuffer
buff
=
new
StringBuffer
(
lobBlockSize
*
2
);
buff
.
append
(
"INSERT INTO SYSTEM_LOB_STREAM VALUES("
+
id
+
", "
+
i
+
", NULL, '"
);
buff
.
append
(
"INSERT INTO SYSTEM_LOB_STREAM VALUES("
+
id
+
", "
+
i
+
", NULL, '"
);
int
len
=
IOUtils
.
readFully
(
in
,
bytes
,
lobBlockSize
);
int
len
=
IOUtils
.
readFully
(
in
,
bytes
,
0
,
lobBlockSize
);
if
(
len
<
0
)
{
if
(
len
<
=
0
)
{
break
;
break
;
}
}
buff
.
append
(
ByteUtils
.
convertBytesToString
(
bytes
,
len
));
buff
.
append
(
ByteUtils
.
convertBytesToString
(
bytes
,
len
));
...
...
h2/src/main/org/h2/engine/Constants.java
浏览文件 @
d6fdf873
...
@@ -19,7 +19,8 @@ import org.h2.constant.SysProperties;
...
@@ -19,7 +19,8 @@ import org.h2.constant.SysProperties;
* set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_01
* set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_01
* ant codeswitchJdk16
* ant codeswitchJdk16
* ant compile
* ant compile
* ant javadocImpl
* set classpath=
* ant javadocImpl (to find missing javadocs)
* ant codeswitchJdk14
* ant codeswitchJdk14
* ant javadocImpl
* ant javadocImpl
*
*
...
@@ -70,8 +71,8 @@ import org.h2.constant.SysProperties;
...
@@ -70,8 +71,8 @@ import org.h2.constant.SysProperties;
*/
*/
public
class
Constants
{
public
class
Constants
{
public
static
final
int
BUILD_ID
=
6
0
;
public
static
final
int
BUILD_ID
=
6
1
;
private
static
final
String
BUILD
=
"2007-1
0-20
"
;
private
static
final
String
BUILD
=
"2007-1
1-09
"
;
public
static
final
int
VERSION_MAJOR
=
1
;
public
static
final
int
VERSION_MAJOR
=
1
;
public
static
final
int
VERSION_MINOR
=
0
;
public
static
final
int
VERSION_MINOR
=
0
;
...
...
h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java
浏览文件 @
d6fdf873
...
@@ -402,7 +402,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
...
@@ -402,7 +402,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
try
{
try
{
debugCodeCall
(
"getColumnDisplaySize"
,
column
);
debugCodeCall
(
"getColumnDisplaySize"
,
column
);
checkColumnIndex
(
column
);
checkColumnIndex
(
column
);
return
(
int
)
result
.
getDisplaySize
(--
column
);
return
result
.
getDisplaySize
(--
column
);
}
catch
(
Throwable
e
)
{
}
catch
(
Throwable
e
)
{
throw
logAndConvert
(
e
);
throw
logAndConvert
(
e
);
}
}
...
...
h2/src/main/org/h2/log/LogFile.java
浏览文件 @
d6fdf873
...
@@ -290,6 +290,7 @@ public class LogFile {
...
@@ -290,6 +290,7 @@ public class LogFile {
logSystem
.
addRedoLog
(
storage
,
recordId
,
blockCount
,
null
);
logSystem
.
addRedoLog
(
storage
,
recordId
,
blockCount
,
null
);
storage
.
setRecordCount
(
storage
.
getRecordCount
()
-
1
);
storage
.
setRecordCount
(
storage
.
getRecordCount
()
-
1
);
}
else
{
}
else
{
logSystem
.
getOrAddSessionState
(
sessionId
);
logSystem
.
addRedoLog
(
storage
,
recordId
,
blockCount
,
rec
);
logSystem
.
addRedoLog
(
storage
,
recordId
,
blockCount
,
rec
);
storage
.
setRecordCount
(
storage
.
getRecordCount
()
+
1
);
storage
.
setRecordCount
(
storage
.
getRecordCount
()
+
1
);
}
}
...
@@ -299,6 +300,7 @@ public class LogFile {
...
@@ -299,6 +300,7 @@ public class LogFile {
logSystem
.
addRedoLog
(
storage
,
recordId
,
blockCount
,
rec
);
logSystem
.
addRedoLog
(
storage
,
recordId
,
blockCount
,
rec
);
storage
.
setRecordCount
(
storage
.
getRecordCount
()
+
1
);
storage
.
setRecordCount
(
storage
.
getRecordCount
()
+
1
);
}
else
{
}
else
{
logSystem
.
getOrAddSessionState
(
sessionId
);
logSystem
.
addRedoLog
(
storage
,
recordId
,
blockCount
,
null
);
logSystem
.
addRedoLog
(
storage
,
recordId
,
blockCount
,
null
);
storage
.
setRecordCount
(
storage
.
getRecordCount
()
-
1
);
storage
.
setRecordCount
(
storage
.
getRecordCount
()
-
1
);
}
}
...
...
h2/src/main/org/h2/log/LogSystem.java
浏览文件 @
d6fdf873
...
@@ -171,6 +171,7 @@ public class LogSystem {
...
@@ -171,6 +171,7 @@ public class LogSystem {
}
}
void
addUndoLogRecord
(
LogFile
log
,
int
logRecordId
,
int
sessionId
)
{
void
addUndoLogRecord
(
LogFile
log
,
int
logRecordId
,
int
sessionId
)
{
getOrAddSessionState
(
sessionId
);
LogRecord
record
=
new
LogRecord
(
log
,
logRecordId
,
sessionId
);
LogRecord
record
=
new
LogRecord
(
log
,
logRecordId
,
sessionId
);
undo
.
add
(
record
);
undo
.
add
(
record
);
}
}
...
@@ -286,19 +287,13 @@ public class LogSystem {
...
@@ -286,19 +287,13 @@ public class LogSystem {
}
}
void
setLastCommitForSession
(
int
sessionId
,
int
logId
,
int
pos
)
{
void
setLastCommitForSession
(
int
sessionId
,
int
logId
,
int
pos
)
{
Integer
key
=
ObjectUtils
.
getInteger
(
sessionId
);
SessionState
state
=
getOrAddSessionState
(
sessionId
);
SessionState
state
=
(
SessionState
)
sessions
.
get
(
key
);
if
(
state
==
null
)
{
state
=
new
SessionState
();
sessions
.
put
(
key
,
state
);
state
.
sessionId
=
sessionId
;
}
state
.
lastCommitLog
=
logId
;
state
.
lastCommitLog
=
logId
;
state
.
lastCommitPos
=
pos
;
state
.
lastCommitPos
=
pos
;
state
.
inDoubtTransaction
=
null
;
state
.
inDoubtTransaction
=
null
;
}
}
void
setPreparedCommitForSession
(
LogFile
log
,
int
sessionId
,
int
pos
,
String
transaction
,
int
blocks
)
{
SessionState
getOrAddSessionState
(
int
sessionId
)
{
Integer
key
=
ObjectUtils
.
getInteger
(
sessionId
);
Integer
key
=
ObjectUtils
.
getInteger
(
sessionId
);
SessionState
state
=
(
SessionState
)
sessions
.
get
(
key
);
SessionState
state
=
(
SessionState
)
sessions
.
get
(
key
);
if
(
state
==
null
)
{
if
(
state
==
null
)
{
...
@@ -306,6 +301,11 @@ public class LogSystem {
...
@@ -306,6 +301,11 @@ public class LogSystem {
sessions
.
put
(
key
,
state
);
sessions
.
put
(
key
,
state
);
state
.
sessionId
=
sessionId
;
state
.
sessionId
=
sessionId
;
}
}
return
state
;
}
void
setPreparedCommitForSession
(
LogFile
log
,
int
sessionId
,
int
pos
,
String
transaction
,
int
blocks
)
{
SessionState
state
=
getOrAddSessionState
(
sessionId
);
// this is potentially a commit, so don't roll back the action before it (currently)
// this is potentially a commit, so don't roll back the action before it (currently)
setLastCommitForSession
(
sessionId
,
log
.
getId
(),
pos
);
setLastCommitForSession
(
sessionId
,
log
.
getId
(),
pos
);
state
.
inDoubtTransaction
=
new
InDoubtTransaction
(
log
,
sessionId
,
pos
,
transaction
,
blocks
);
state
.
inDoubtTransaction
=
new
InDoubtTransaction
(
log
,
sessionId
,
pos
,
transaction
,
blocks
);
...
...
h2/src/main/org/h2/server/ftp/FtpData.java
浏览文件 @
d6fdf873
...
@@ -80,7 +80,7 @@ public class FtpData extends Thread {
...
@@ -80,7 +80,7 @@ public class FtpData extends Thread {
try
{
try
{
OutputStream
out
=
socket
.
getOutputStream
();
OutputStream
out
=
socket
.
getOutputStream
();
InputStream
in
=
fs
.
openFileInputStream
(
fileName
);
InputStream
in
=
fs
.
openFileInputStream
(
fileName
);
in
.
skip
(
skip
);
IOUtils
.
skipFully
(
in
,
skip
);
IOUtils
.
copy
(
in
,
out
);
IOUtils
.
copy
(
in
,
out
);
in
.
close
();
in
.
close
();
}
finally
{
}
finally
{
...
...
h2/src/main/org/h2/store/FileStore.java
浏览文件 @
d6fdf873
...
@@ -21,7 +21,7 @@ import org.h2.util.TempFileDeleter;
...
@@ -21,7 +21,7 @@ import org.h2.util.TempFileDeleter;
/**
/**
* This class is an abstraction of a random access file.
* This class is an abstraction of a random access file.
* Each file contains a magic header, and reading / writing is done in blocks.
* Each file contains a magic header, and reading / writing is done in blocks.
* See also {@link
MemoryFileStore} and {@link
SecureFileStore}
* See also {@link SecureFileStore}
*/
*/
public
class
FileStore
{
public
class
FileStore
{
...
...
h2/src/main/org/h2/store/fs/FileObjectZip.java
浏览文件 @
d6fdf873
...
@@ -4,11 +4,14 @@
...
@@ -4,11 +4,14 @@
*/
*/
package
org
.
h2
.
store
.
fs
;
package
org
.
h2
.
store
.
fs
;
import
java.io.EOFException
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipFile
;
import
java.util.zip.ZipFile
;
import
org.h2.util.IOUtils
;
public
class
FileObjectZip
implements
FileObject
{
public
class
FileObjectZip
implements
FileObject
{
private
ZipFile
file
;
private
ZipFile
file
;
...
@@ -47,10 +50,13 @@ public class FileObjectZip implements FileObject {
...
@@ -47,10 +50,13 @@ public class FileObjectZip implements FileObject {
inPos
=
0
;
inPos
=
0
;
}
}
if
(
inPos
<
pos
)
{
if
(
inPos
<
pos
)
{
in
.
skip
(
pos
-
inPos
);
IOUtils
.
skipFully
(
in
,
pos
-
inPos
);
inPos
=
pos
;
inPos
=
pos
;
}
}
in
.
read
(
b
,
off
,
len
);
int
l
=
IOUtils
.
readFully
(
in
,
b
,
off
,
len
);
if
(
l
!=
len
)
{
throw
new
EOFException
();
}
pos
+=
len
;
pos
+=
len
;
inPos
+=
len
;
inPos
+=
len
;
}
}
...
...
h2/src/main/org/h2/util/IOUtils.java
浏览文件 @
d6fdf873
...
@@ -174,23 +174,19 @@ public class IOUtils {
...
@@ -174,23 +174,19 @@ public class IOUtils {
}
}
}
}
public
static
int
readFully
(
InputStream
in
,
byte
[]
buffer
,
int
max
)
throws
IOException
{
public
static
int
readFully
(
InputStream
in
,
byte
[]
buffer
,
int
off
,
int
max
)
throws
IOException
{
int
off
=
0
,
len
=
Math
.
min
(
max
,
buffer
.
length
);
int
len
=
Math
.
min
(
max
,
buffer
.
length
);
if
(
len
==
0
)
{
int
result
=
0
;
return
0
;
while
(
len
>
0
)
{
}
int
l
=
in
.
read
(
buffer
,
off
,
len
);
while
(
true
)
{
int
l
=
len
-
off
;
if
(
l
<=
0
)
{
break
;
}
l
=
in
.
read
(
buffer
,
off
,
l
);
if
(
l
<
0
)
{
if
(
l
<
0
)
{
break
;
break
;
}
}
result
+=
l
;
off
+=
l
;
off
+=
l
;
len
-=
l
;
}
}
return
off
<=
0
?
-
1
:
off
;
return
result
;
}
}
public
static
int
readFully
(
Reader
in
,
char
[]
buffer
,
int
max
)
throws
IOException
{
public
static
int
readFully
(
Reader
in
,
char
[]
buffer
,
int
max
)
throws
IOException
{
...
...
h2/src/main/org/h2/value/ValueLob.java
浏览文件 @
d6fdf873
...
@@ -253,8 +253,7 @@ public class ValueLob extends Value {
...
@@ -253,8 +253,7 @@ public class ValueLob extends Value {
}
}
int
len
=
getBufferSize
(
handler
,
compress
,
remaining
);
int
len
=
getBufferSize
(
handler
,
compress
,
remaining
);
byte
[]
buff
=
new
byte
[
len
];
byte
[]
buff
=
new
byte
[
len
];
len
=
IOUtils
.
readFully
(
in
,
buff
,
len
);
len
=
IOUtils
.
readFully
(
in
,
buff
,
0
,
len
);
len
=
len
<
0
?
0
:
len
;
if
(
len
<=
handler
.
getMaxLengthInplaceLob
())
{
if
(
len
<=
handler
.
getMaxLengthInplaceLob
())
{
byte
[]
small
=
new
byte
[
len
];
byte
[]
small
=
new
byte
[
len
];
System
.
arraycopy
(
buff
,
0
,
small
,
0
,
len
);
System
.
arraycopy
(
buff
,
0
,
small
,
0
,
len
);
...
@@ -306,7 +305,7 @@ public class ValueLob extends Value {
...
@@ -306,7 +305,7 @@ public class ValueLob extends Value {
break
;
break
;
}
}
len
=
getBufferSize
(
handler
,
compress
,
remaining
);
len
=
getBufferSize
(
handler
,
compress
,
remaining
);
len
=
IOUtils
.
readFully
(
in
,
buff
,
len
);
len
=
IOUtils
.
readFully
(
in
,
buff
,
0
,
len
);
if
(
len
<=
0
)
{
if
(
len
<=
0
)
{
break
;
break
;
}
}
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
d6fdf873
...
@@ -149,6 +149,8 @@ java org.h2.test.TestAll timer
...
@@ -149,6 +149,8 @@ java org.h2.test.TestAll timer
/*
/*
implement & test: checkpoint commits running transactions
start writing javadocs for jdbcx package
start writing javadocs for jdbcx package
toString() method to print something useful
toString() method to print something useful
...
...
h2/src/test/org/h2/test/synth/TestHaltApp.java
浏览文件 @
d6fdf873
...
@@ -121,7 +121,7 @@ public class TestHaltApp extends TestHalt {
...
@@ -121,7 +121,7 @@ public class TestHaltApp extends TestHalt {
trace
(
"committed: "
+
rowCount
,
null
);
trace
(
"committed: "
+
rowCount
,
null
);
}
}
if
((
flags
&
FLAG_NO_DELAY
)
!=
0
)
{
if
((
flags
&
FLAG_NO_DELAY
)
!=
0
)
{
if
(
random
.
nextInt
(
10
0
)
==
0
)
{
if
(
random
.
nextInt
(
10
)
==
0
&&
(
rowCount
%
2
==
0
)
)
{
execute
(
stat
,
"CHECKPOINT"
);
execute
(
stat
,
"CHECKPOINT"
);
}
}
}
}
...
...
h2/src/test/org/h2/test/unit/TestFileSystem.java
浏览文件 @
d6fdf873
...
@@ -17,7 +17,6 @@ import java.util.Random;
...
@@ -17,7 +17,6 @@ import java.util.Random;
import
org.h2.store.fs.FileObject
;
import
org.h2.store.fs.FileObject
;
import
org.h2.store.fs.FileSystem
;
import
org.h2.store.fs.FileSystem
;
import
org.h2.store.fs.FileSystemMemory
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
public
class
TestFileSystem
extends
TestBase
{
public
class
TestFileSystem
extends
TestBase
{
...
@@ -25,10 +24,10 @@ public class TestFileSystem extends TestBase {
...
@@ -25,10 +24,10 @@ public class TestFileSystem extends TestBase {
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
testDatabaseInJar
();
testDatabaseInJar
();
testFileSystem
(
baseDir
+
"/fs"
);
testFileSystem
(
baseDir
+
"/fs"
);
testFileSystem
(
FileSystem
Memory
.
MEMORY_PREFIX
);
testFileSystem
(
FileSystem
.
MEMORY_PREFIX
);
// testFileSystem("jdbc:h2:mem:fs;TRACE_LEVEL_FILE=3");
// testFileSystem("jdbc:h2:mem:fs;TRACE_LEVEL_FILE=3");
testFileSystem
(
"jdbc:h2:mem:fs"
);
testFileSystem
(
"jdbc:h2:mem:fs"
);
testFileSystem
(
FileSystem
Memory
.
MEMORY_PREFIX_LZF
);
testFileSystem
(
FileSystem
.
MEMORY_PREFIX_LZF
);
testUserHome
();
testUserHome
();
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论