提交 d6fdf873 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 391f3743
#Fri Oct 26 09:46:47 CEST 2007
#Fri Nov 09 12:31:47 CET 2007
benchmark.drivers.dir=C\:/data/java
javac=javac
path.servlet.jar=C\:/data/classpath/servlet-api.jar
path.lucene.jar=C\:/data/classpath/lucene-core-2.2.0.jar
version.name.maven=1.0.60
version.name.maven=1.0.61
jdk=1.4
......@@ -254,9 +254,7 @@
</target>
<target name="javadocImpl">
<javac target="${jdk}" source="${jdk}" executable="${javac}" srcdir="src/test" destdir="bin" debug="true" includes="org/h2/test/bnf/*.java"/>
<javac target="${jdk}" source="${jdk}" executable="${javac}" srcdir="src/tools" destdir="bin" debug="true" includes="org/h2/tools/doclet/*.java"/>
<mkdir dir="docs/javadoc"/>
<mkdir dir="docs/javadocImpl"/>
<javadoc
sourcepath="src/main"
packagenames="org.h2.jdbc.*,org.h2.tools.*,org.h2.api.*,org.h2.store.*"
......
......@@ -75,7 +75,7 @@ Example:
&lt;dependency&gt;
&lt;groupId&gt;com.h2database&lt;/groupId&gt;
&lt;artifactId&gt;h2&lt;/artifactId&gt;
&lt;version&gt;1.0.60&lt;/version&gt;
&lt;version&gt;1.0.61&lt;/version&gt;
&lt;/dependency&gt;
</pre>
</p>
......
......@@ -15,10 +15,10 @@ H2 Database Engine
<h1>Downloads</h1>
<h3>Version 1.0.60 (2007-10-20, Current)</h3>
<h3>Version 1.0.61 (2007-11-09, Current)</h3>
<p>
<a href="http://www.h2database.com/h2-setup-2007-10-20.exe">Windows Installer</a><br />
<a href="http://www.h2database.com/h2-2007-10-20.zip">Platform-Independent Zip</a><br />
<a href="http://www.h2database.com/h2-setup-2007-11-09.exe">Windows Installer</a><br />
<a href="http://www.h2database.com/h2-2007-11-09.zip">Platform-Independent Zip</a><br />
</p>
<h3>Download Mirror</h3>
......
......@@ -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;">
<tr><td style="border: 0px; background-color: #eee;" colspan="2">
<h3>Download</h3>
Version 1.0.60 (2007-10-20):
Version 1.0.61 (2007-11-09):
</td></tr>
<tr><td style="border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-setup-2007-10-20.exe"><img border="1" src="images/download.png" alt="download" /></a>
<a href="http://www.h2database.com/h2-setup-2007-11-09.exe"><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-setup-2007-10-20.exe">Windows Installer (2.8 MB)</a>
<a href="http://www.h2database.com/h2-setup-2007-11-09.exe">Windows Installer (2.8 MB)</a>
</td></tr>
<tr><td style="border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-2007-10-20.zip"><img border="1" src="images/download.png" alt="download" /></a>
<a href="http://www.h2database.com/h2-2007-11-09.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-2007-10-20.zip">All platforms (zip, 3.9 MB)</a>
<a href="http://www.h2database.com/h2-2007-11-09.zip">All platforms (zip, 3.9 MB)</a>
</td></tr>
<tr><td style="border: 0px; background-color: #eee;" colspan="2">
<a href="download.html">All Downloads</a>
......
......@@ -1130,7 +1130,7 @@ Mit Maven 2
#Downloads
@download_1001_h3
#Version 1.0.60 (2007-10-20, Current)
#Version 1.0.61 (2007-11-09, Current)
@download_1002_a
#Windows Installer
......@@ -3122,7 +3122,7 @@ Mit Maven 2
#Download
@mainWeb_1007_td
#Version 1.0.60 (2007-10-20):
#Version 1.0.61 (2007-11-09):
@mainWeb_1008_a
#Windows Installer (2.8 MB)
......
......@@ -1130,7 +1130,7 @@ Afterwards, you can include the database in your Maven 2 project as a dependency
Downloads
@download_1001_h3
Version 1.0.60 (2007-10-20, Current)
Version 1.0.61 (2007-11-09, Current)
@download_1002_a
Windows Installer
......@@ -3122,7 +3122,7 @@ JDBC and (partial) ODBC API; Web Client application
Download
@mainWeb_1007_td
Version 1.0.60 (2007-10-20):
Version 1.0.61 (2007-11-09):
@mainWeb_1008_a
Windows Installer (2.8 MB)
......
......@@ -1132,7 +1132,7 @@ Centralリポジトリの利用
ダウンロード
@download_1001_h3
#Version 1.0.60 (2007-10-20, Current)
#Version 1.0.61 (2007-11-09, Current)
@download_1002_a
Windows Installer
......@@ -3124,7 +3124,7 @@ JDBC、 (部分的な) ODBC API; Web クライアントアプリケーション
ダウンロード
@mainWeb_1007_td
#Version 1.0.60 (2007-10-20):
#Version 1.0.61 (2007-11-09):
@mainWeb_1008_a
#Windows Installer (2.8 MB)
......
......@@ -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_1026_p=Afterwards, you can include the database in your Maven 2 project as a dependency\:
download_1000_h1=Downloads
download_1001_h3=Version 1.0.60 (2007-10-20, Current)
download_1001_h3=Version 1.0.61 (2007-11-09, Current)
download_1002_a=Windows Installer
download_1003_a=Platform-Independent Zip
download_1004_h3=Download Mirror
......@@ -1039,7 +1039,7 @@ mainWeb_1003_li=Written Java; can be compiled with GCJ (Linux)
mainWeb_1004_li=Embedded, Server and Cluster modes
mainWeb_1005_li=JDBC and (partial) ODBC API; Web Client application
mainWeb_1006_h3=Download
mainWeb_1007_td=Version 1.0.60 (2007-10-20)\:
mainWeb_1007_td=Version 1.0.61 (2007-11-09)\:
mainWeb_1008_a=Windows Installer (2.8 MB)
mainWeb_1009_a=All platforms (zip, 3.9 MB)
mainWeb_1010_a=All Downloads
......
......@@ -66,7 +66,7 @@ public class ScriptCommand extends ScriptBase {
private byte[] buffer;
private boolean tempLobTableCreated;
private int nextLobId;
private int lobBlockSize = Integer.MAX_VALUE;
private int lobBlockSize = Constants.FILE_BLOCK_SIZE;
private static final String TEMP_LOB_FILENAME = "system_temp_lob.db";
public ScriptCommand(Session session) {
......@@ -330,8 +330,8 @@ public class ScriptCommand extends ScriptBase {
for (int i = 0;; i++) {
StringBuffer buff = new StringBuffer(lobBlockSize * 2);
buff.append("INSERT INTO SYSTEM_LOB_STREAM VALUES(" + id + ", " + i + ", NULL, '");
int len = IOUtils.readFully(in, bytes, lobBlockSize);
if (len < 0) {
int len = IOUtils.readFully(in, bytes, 0, lobBlockSize);
if (len <= 0) {
break;
}
buff.append(ByteUtils.convertBytesToString(bytes, len));
......
......@@ -19,7 +19,8 @@ import org.h2.constant.SysProperties;
* set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_01
* ant codeswitchJdk16
* ant compile
* ant javadocImpl
* set classpath=
* ant javadocImpl (to find missing javadocs)
* ant codeswitchJdk14
* ant javadocImpl
*
......@@ -70,8 +71,8 @@ import org.h2.constant.SysProperties;
*/
public class Constants {
public static final int BUILD_ID = 60;
private static final String BUILD = "2007-10-20";
public static final int BUILD_ID = 61;
private static final String BUILD = "2007-11-09";
public static final int VERSION_MAJOR = 1;
public static final int VERSION_MINOR = 0;
......
......@@ -402,7 +402,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
try {
debugCodeCall("getColumnDisplaySize", column);
checkColumnIndex(column);
return (int) result.getDisplaySize(--column);
return result.getDisplaySize(--column);
} catch (Throwable e) {
throw logAndConvert(e);
}
......
......@@ -290,6 +290,7 @@ public class LogFile {
logSystem.addRedoLog(storage, recordId, blockCount, null);
storage.setRecordCount(storage.getRecordCount() - 1);
} else {
logSystem.getOrAddSessionState(sessionId);
logSystem.addRedoLog(storage, recordId, blockCount, rec);
storage.setRecordCount(storage.getRecordCount() + 1);
}
......@@ -299,6 +300,7 @@ public class LogFile {
logSystem.addRedoLog(storage, recordId, blockCount, rec);
storage.setRecordCount(storage.getRecordCount() + 1);
} else {
logSystem.getOrAddSessionState(sessionId);
logSystem.addRedoLog(storage, recordId, blockCount, null);
storage.setRecordCount(storage.getRecordCount() - 1);
}
......
......@@ -171,6 +171,7 @@ public class LogSystem {
}
void addUndoLogRecord(LogFile log, int logRecordId, int sessionId) {
getOrAddSessionState(sessionId);
LogRecord record = new LogRecord(log, logRecordId, sessionId);
undo.add(record);
}
......@@ -286,19 +287,13 @@ public class LogSystem {
}
void setLastCommitForSession(int sessionId, int logId, int pos) {
Integer key = ObjectUtils.getInteger(sessionId);
SessionState state = (SessionState) sessions.get(key);
if (state == null) {
state = new SessionState();
sessions.put(key, state);
state.sessionId = sessionId;
}
SessionState state = getOrAddSessionState(sessionId);
state.lastCommitLog = logId;
state.lastCommitPos = pos;
state.inDoubtTransaction = null;
}
void setPreparedCommitForSession(LogFile log, int sessionId, int pos, String transaction, int blocks) {
SessionState getOrAddSessionState(int sessionId) {
Integer key = ObjectUtils.getInteger(sessionId);
SessionState state = (SessionState) sessions.get(key);
if (state == null) {
......@@ -306,6 +301,11 @@ public class LogSystem {
sessions.put(key, state);
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)
setLastCommitForSession(sessionId, log.getId(), pos);
state.inDoubtTransaction = new InDoubtTransaction(log, sessionId, pos, transaction, blocks);
......
......@@ -80,7 +80,7 @@ public class FtpData extends Thread {
try {
OutputStream out = socket.getOutputStream();
InputStream in = fs.openFileInputStream(fileName);
in.skip(skip);
IOUtils.skipFully(in, skip);
IOUtils.copy(in, out);
in.close();
} finally {
......
......@@ -21,7 +21,7 @@ import org.h2.util.TempFileDeleter;
/**
* This class is an abstraction of a random access file.
* 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 {
......
......@@ -4,11 +4,14 @@
*/
package org.h2.store.fs;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.h2.util.IOUtils;
public class FileObjectZip implements FileObject {
private ZipFile file;
......@@ -47,10 +50,13 @@ public class FileObjectZip implements FileObject {
inPos = 0;
}
if (inPos < pos) {
in.skip(pos - inPos);
IOUtils.skipFully(in, pos - inPos);
inPos = pos;
}
in.read(b, off, len);
int l = IOUtils.readFully(in, b, off, len);
if (l != len) {
throw new EOFException();
}
pos += len;
inPos += len;
}
......
......@@ -174,23 +174,19 @@ public class IOUtils {
}
}
public static int readFully(InputStream in, byte[] buffer, int max) throws IOException {
int off = 0, len = Math.min(max, buffer.length);
if (len == 0) {
return 0;
}
while (true) {
int l = len - off;
if (l <= 0) {
break;
}
l = in.read(buffer, off, l);
public static int readFully(InputStream in, byte[] buffer, int off, int max) throws IOException {
int len = Math.min(max, buffer.length);
int result = 0;
while (len > 0) {
int l = in.read(buffer, off, len);
if (l < 0) {
break;
}
result += l;
off += l;
len -= l;
}
return off <= 0 ? -1 : off;
return result;
}
public static int readFully(Reader in, char[] buffer, int max) throws IOException {
......
......@@ -253,8 +253,7 @@ public class ValueLob extends Value {
}
int len = getBufferSize(handler, compress, remaining);
byte[] buff = new byte[len];
len = IOUtils.readFully(in, buff, len);
len = len < 0 ? 0 : len;
len = IOUtils.readFully(in, buff, 0, len);
if (len <= handler.getMaxLengthInplaceLob()) {
byte[] small = new byte[len];
System.arraycopy(buff, 0, small, 0, len);
......@@ -306,7 +305,7 @@ public class ValueLob extends Value {
break;
}
len = getBufferSize(handler, compress, remaining);
len = IOUtils.readFully(in, buff, len);
len = IOUtils.readFully(in, buff, 0, len);
if (len <= 0) {
break;
}
......
......@@ -149,6 +149,8 @@ java org.h2.test.TestAll timer
/*
implement & test: checkpoint commits running transactions
start writing javadocs for jdbcx package
toString() method to print something useful
......
......@@ -121,7 +121,7 @@ public class TestHaltApp extends TestHalt {
trace("committed: " + rowCount, null);
}
if ((flags & FLAG_NO_DELAY) != 0) {
if (random.nextInt(100) == 0) {
if (random.nextInt(10) == 0 && (rowCount % 2 == 0)) {
execute(stat, "CHECKPOINT");
}
}
......
......@@ -17,7 +17,6 @@ import java.util.Random;
import org.h2.store.fs.FileObject;
import org.h2.store.fs.FileSystem;
import org.h2.store.fs.FileSystemMemory;
import org.h2.test.TestBase;
public class TestFileSystem extends TestBase {
......@@ -25,10 +24,10 @@ public class TestFileSystem extends TestBase {
public void test() throws Exception {
testDatabaseInJar();
testFileSystem(baseDir + "/fs");
testFileSystem(FileSystemMemory.MEMORY_PREFIX);
testFileSystem(FileSystem.MEMORY_PREFIX);
// testFileSystem("jdbc:h2:mem:fs;TRACE_LEVEL_FILE=3");
testFileSystem("jdbc:h2:mem:fs");
testFileSystem(FileSystemMemory.MEMORY_PREFIX_LZF);
testFileSystem(FileSystem.MEMORY_PREFIX_LZF);
testUserHome();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论