提交 7b59a66f authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 86cb1379
......@@ -207,6 +207,12 @@ Features
</tr>
</table>
<h3>Derby and HSQLDB</h3>
After an unexpected process termination (for example power failure), H2 can recover safely and
automatically without any user interaction. For Derby and HSQLDB, there are some manual steps required
('Another instance of Derby may have already booted the database' /
'The database is already in use by another process').
<h3>DaffodilDb and One$Db</h3>
It looks like the development of this database has stopped. The last release was February 2006.
......@@ -846,7 +852,7 @@ where executed. This database offers the following trace features:
The simplest way to enable the trace option is setting it in the database URL.
There are two settings, one for System.out (TRACE_LEVEL_SYSTEM_OUT) tracing,
and one for file tracing (TRACE_LEVEL_FILE).
The trace levels are 0 for OFF, 1 for ERROR, 2 for INFO and 3 for DEBUG.
The trace levels are 0 for OFF, 1 for ERROR (the default), 2 for INFO and 3 for DEBUG.
A database URL with both levels set to DEBUG is:
<pre>
jdbc:h2:test;TRACE_LEVEL_FILE=3;TRACE_LEVEL_SYSTEM_OUT=3
......
......@@ -34,8 +34,14 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>Version 1.0 (Current)</h3>
<h3>Version 1.0 / TODO</h3><ul>
<li>Fixed a problem where data that was in the log file did not end up in the database (recovery failure) a crash, if an index was deleted previously.
<h3>Version 1.0 / 2007-01-16</h3><ul>
<li>Setting the collation (SET COLLATOR) was very slow on some systems (up to 24 seconds).
Thanks a lot to Martina Nissler for finding this problem!
<li>The Console is now translated to Japanese thanks to IKEMOTO, Masahiro (ikeyan (at) arizona (dot) ne (dot) jp)
<li>The database engine can not be compiled with JDK 1.3 using ant codeswitch_jdk13.
There are still some limitations, and the ant script to build the jar does not work yet.
<li>Fixed a problem where data in the log file was not written to the data file (recovery failure) after a crash,
if an index was deleted previously.
<li>SCRIPT NODATA now writes the row count for each table (this simplifies comparing databases).
<li>Selecting a column using the syntax schemaName.tableName.columName did not work in all cases.
<li>Can now parse timestamps with timezone information (Z or +/-hh:mm) and dates before year 1.
......@@ -1469,6 +1475,7 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<li>Column level privileges
<li>Copy database: Tool with config GUI and batch mode, extendable (example: compare)
<li>Document shrinking jar file using http://proguard.sourceforge.net/
<li>Document, implement tool for long running transactions using user defined compensation statements
<li>Support SET TABLE DUAL READONLY;
<li>Don't write stack traces for common exceptions like duplicate key to the log by default
<li>Setting for MAX_QUERY_TIME (default no limit?)
......@@ -1484,7 +1491,6 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<li>Allow editing NULL values in the Console
<li>RunScript / RUNSCRIPT: progress meter and "suspend/resume" capability
<li>Compatibility: in MySQL, HSQLDB, /0.0 is NULL; in PostgreSQL, Derby: Division by zero
<li>Implement solution for long running transactions using user defined compensation statements
<li>Functional tables should accept parameters from other tables (see FunctionMultiReturn)
SELECT * FROM TEST T, P2C(T.A, T.R)
<li>Custom class loader to reload functions on demand
......@@ -1628,6 +1634,12 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<li>Autocomplete: schema support: "Other Grammar","Table Expression","{[schemaName.]tableName | (select)} [[AS] newTableAlias]
<li>Functions: options readonly, deterministic
<li>Document FTP server, including -ftpTask option to execute / kill remote processes
<li>Add jdbcx to the javadocs
<li>Shrink the data file without closing the database (if the end of the file is empty)
<li>Add TPC-B style benchmark: download/tpcb_current.pdf
<li>Delay reading the row if data is not required
<li>Eliminate undo log records if stored on disk (just one pointer per block, not per record)
<li>User defined aggregate functions
</ul>
<h3>Not Planned</h3>
......
......@@ -35,7 +35,6 @@ public class TransactionCommand extends Prepared {
public static final int ROLLBACK_TRANSACTION = 11;
public static final int SHUTDOWN = 12;
public static final int SHUTDOWN_IMMEDIATELY = 13;
public static final int BACKUP = 14;
private int type;
private String savepointName;
......@@ -118,12 +117,12 @@ public class TransactionCommand extends Prepared {
session.close();
break;
}
case BACKUP: {
session.getUser().checkAdmin();
session.commit();
backupTo("backup.zip");
break;
}
// case BACKUP: {
// session.getUser().checkAdmin();
// session.commit();
// backupTo("backup.zip");
// break;
// }
default:
throw Message.getInternalError("type=" + type);
}
......
......@@ -15,11 +15,14 @@ package org.h2.engine;
* - Update latest version in build.html: http://mirrors.ibiblio.org/pub/mirrors/maven2/com/h2database/h2/
* - ant jarClient, check jar file size
* - Compiling with JDK 1.3, 1.4, 1.5 and 1.6
* set path=C:\jdk1.3.1_19\bin;%PATH%
* set JAVA_HOME=C:\jdk1.3.1_19\bin
* set path=C:\Programme\Java\jdk1.6.0\bin;%PATH%
* - Change FAQ (next release planned, known bugs)
* - Check version, change build number in Constants.java and build.xml
* - Check code coverage
* - No " Message.getInternalError" (must be "throw Message.getInternalError")
* - ' #ifdef', ' #endif'
* - No TODO in the docs
* - Run regression test with JDK 1.4 and 1.5
* - Change version(s) in performance.html; use latest versions of other databases
......@@ -50,13 +53,14 @@ package org.h2.engine;
* - Scan for viruses
* - newsletter: prepare, send (always send to BCC!!)
* - http://maven.apache.org/guides/mini/guide-ibiblio-upload.html
* - Add to freshmeat, http://code.google.com/p/h2database/downloads/list
*
* @author Thomas
*/
public class Constants {
public static final int BUILD_ID = 38;
private static final String BUILD = "2007-01-10";
public static final int BUILD_ID = 39;
private static final String BUILD = "2007-01-16";
public static final int VERSION_MAJOR = 1;
public static final int VERSION_MINOR = 0;
......
......@@ -182,7 +182,7 @@ public class Aggregate extends Expression {
Value[] a2 = ((ValueArray)o2).getList();
return sort.compare(a1, a2);
} catch(SQLException e) {
throw new Error(e);
throw Message.getInternalError("sort", e);
}
}
});
......
......@@ -21,7 +21,9 @@ import java.util.StringTokenizer;
import org.h2.api.Trigger;
import org.h2.tools.SimpleResultSet;
import org.h2.util.ByteUtils;
import org.h2.util.JdbcUtils;
import org.h2.util.StringUtils;
import org.h2.value.DataType;
public class FullText implements Trigger {
......@@ -366,7 +368,7 @@ public class FullText implements Trigger {
}
switch(type) {
case Types.BIT:
case Types.BOOLEAN:
case DataType.TYPE_BOOLEAN:
case Types.INTEGER:
case Types.BIGINT:
case Types.DECIMAL:
......@@ -394,7 +396,7 @@ public class FullText implements Trigger {
case Types.REF:
case Types.NULL:
case Types.ARRAY:
case Types.DATALINK:
case DataType.TYPE_DATALINK:
case Types.DISTINCT:
throw new SQLException("FULLTEXT", "Unsupported column data type: " + type);
}
......@@ -407,7 +409,7 @@ public class FullText implements Trigger {
}
switch(type) {
case Types.BIT:
case Types.BOOLEAN:
case DataType.TYPE_BOOLEAN:
case Types.INTEGER:
case Types.BIGINT:
case Types.DECIMAL:
......@@ -437,7 +439,7 @@ public class FullText implements Trigger {
case Types.REF:
case Types.NULL:
case Types.ARRAY:
case Types.DATALINK:
case DataType.TYPE_DATALINK:
case Types.DISTINCT:
throw new SQLException("FULLTEXT", "Unsupported key data type: " + type);
}
......@@ -472,7 +474,7 @@ public class FullText implements Trigger {
if(wId == null) {
prepInsertWord.setString(1, word);
prepInsertWord.execute();
ResultSet rs = prepInsertWord.getGeneratedKeys();
ResultSet rs = JdbcUtils.getGeneratedKeys(prepInsertWord);
rs.next();
wordId = rs.getInt(1);
allWords.put(word, new Integer(wordId));
......@@ -492,7 +494,7 @@ public class FullText implements Trigger {
prepInsertRow.setLong(2, index.id);
prepInsertRow.setString(3, key);
prepInsertRow.execute();
ResultSet rs = prepInsertRow.getGeneratedKeys();
ResultSet rs = JdbcUtils.getGeneratedKeys(prepInsertRow);
rs.next();
long rowId = rs.getLong(1);
prepInsertMap.setLong(1, rowId);
......
......@@ -15,7 +15,9 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLWarning;
//#ifdef JDK14
import java.sql.Savepoint;
//#endif
import java.sql.Statement;
import java.util.Iterator;
import java.util.Map;
......@@ -57,14 +59,22 @@ public class JdbcConnection extends TraceObject implements Connection {
private String url;
private String user;
private int holdability = ResultSet.HOLD_CURSORS_OVER_COMMIT;
private int holdability
//#ifdef JDK14
= ResultSet.HOLD_CURSORS_OVER_COMMIT
//#endif
;
private SessionInterface session;
private CommandInterface commit, rollback;
private CommandInterface setAutoCommitTrue, setAutoCommitFalse, getAutoCommit;
private CommandInterface getReadOnly, getGeneratedKeys;
private CommandInterface setLockMode, getLockMode;
private Exception openStackTrace;
//#ifdef JDK14
private int savepointId;
//#endif
private Trace trace;
private JdbcConnectionListener listener;
private boolean isInternal;
......@@ -1172,10 +1182,12 @@ public class JdbcConnection extends TraceObject implements Connection {
private void checkHoldability(int resultSetHoldability) throws SQLException {
// TODO compatibility / correctness: DBPool uses ResultSet.HOLD_CURSORS_OVER_COMMIT
//#ifdef JDK14
if(resultSetHoldability != ResultSet.HOLD_CURSORS_OVER_COMMIT &&
resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) {
throw Message.getInvalidValueException("" + resultSetHoldability, "resultSetHoldability");
}
//#endif
}
void checkClosed() throws SQLException {
......
......@@ -2488,19 +2488,23 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
* @param holdability ResultSet.HOLD_CURSORS_OVER_COMMIT or CLOSE_CURSORS_AT_COMMIT
* @return true if the holdability is ResultSet.CLOSE_CURSORS_AT_COMMIT
*/
//#ifdef JDK14
public boolean supportsResultSetHoldability(int holdability) {
debugCodeCall("supportsResultSetHoldability", holdability);
return holdability == ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
//#endif
/**
* Gets the result set holdability.
* @return ResultSet.CLOSE_CURSORS_AT_COMMIT
*/
//#ifdef JDK14
public int getResultSetHoldability() {
debugCodeCall("getResultSetHoldability");
return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
//#endif
/**
* Gets the major version of the database.
......@@ -2542,10 +2546,12 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
* Gets the SQL State type.
* @return DatabaseMetaData.sqlStateSQL99
*/
//#ifdef JDK14
public int getSQLStateType() {
debugCodeCall("getSQLStateType");
return DatabaseMetaData.sqlStateSQL99;
}
//#endif
/**
* Does the database make a copy before updating.
......
......@@ -15,9 +15,9 @@ import org.h2.message.TraceObject;
* Information about the parameters of a prepared statement.
*/
public class JdbcParameterMetaData extends TraceObject
// #ifdef JDK14
//#ifdef JDK14
implements ParameterMetaData
// #endif
//#endif
{
private JdbcPreparedStatement prep;
......@@ -44,6 +44,7 @@ implements ParameterMetaData
*
* @return parameterModeIn
*/
//#ifdef JDK14
public int getParameterMode(int param) throws SQLException {
try {
debugCodeCall("getParameterMode", param);
......@@ -53,6 +54,7 @@ implements ParameterMetaData
throw logAndConvert(e);
}
}
//#endif
/**
* Returns the parameter type.
......
......@@ -11,13 +11,15 @@ import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
//#ifdef JDK14
import java.sql.ParameterMetaData;
import java.sql.Statement;
//#endif
import java.sql.PreparedStatement;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Calendar;
import org.h2.command.CommandInterface;
......@@ -1037,7 +1039,9 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
next = e;
}
logAndConvert(e);
//#ifdef JDK14
result[i] = Statement.EXECUTE_FAILED;
//#endif
error = true;
}
}
......@@ -1053,7 +1057,6 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
}
/**
* Adds the current settings to the batch.
*/
......@@ -1179,7 +1182,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
*
* @return the meta data
*/
// #ifdef JDK14
//#ifdef JDK14
public ParameterMetaData getParameterMetaData() throws SQLException {
try {
int id = getNextId(TraceObject.PARAMETER_META_DATA);
......@@ -1194,7 +1197,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
throw logAndConvert(e);
}
}
// #endif
//#endif
// =============================================================
......
......@@ -5,7 +5,9 @@
package org.h2.jdbc;
import java.sql.SQLException;
//#ifdef JDK14
import java.sql.Savepoint;
//#endif
import org.h2.message.Message;
import org.h2.message.Trace;
......@@ -16,7 +18,11 @@ import org.h2.util.StringUtils;
* A savepoint is a point inside a transaction to where a transaction can be rolled back.
* The tasks that where done before the savepoint are not rolled back in this case.
*/
public class JdbcSavepoint extends TraceObject implements Savepoint {
public class JdbcSavepoint extends TraceObject
//#ifdef JDK14
implements Savepoint
//#endif
{
static final String SYSTEM_SAVEPOINT_PREFIX = "SYSTEM_SAVEPOINT_";
......
......@@ -603,7 +603,9 @@ public class JdbcStatement extends TraceObject implements Statement {
result[i] = executeUpdate(sql);
} catch(SQLException e) {
logAndConvert(e);
//#ifdef JDK14
result[i] = Statement.EXECUTE_FAILED;
//#endif
error = true;
}
}
......@@ -783,6 +785,7 @@ public class JdbcStatement extends TraceObject implements Statement {
*
* @return the holdability
*/
//#ifdef JDK14
public int getResultSetHoldability() throws SQLException {
try {
debugCodeCall("getResultSetHoldability");
......@@ -792,6 +795,7 @@ public class JdbcStatement extends TraceObject implements Statement {
throw logAndConvert(e);
}
}
//#endif
// =============================================================
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论