提交 065aa507 authored 作者: Thomas Mueller's avatar Thomas Mueller

Prepare release.

上级 121598c2
......@@ -60,8 +60,8 @@ Change Log
Previously it would throw an exception, now it works.
</li><li>Issue 484: In the H2 Console tool, all schemas starting with "INFO" where hidden.
Now they are hidden only if the database is not H2. Patch from "mgcodeact"/"cumer d"
</li><li>MySQL compatibiltity, support the "AUTO_INCREMENT=3" part of the CREATE TABLE statement.
</li><li>Issue 486: MySQL compatibiltity, support the "DEFAULT CHARSET" part of the CREATE TABLE statement.
</li><li>MySQL compatibility, support the "AUTO_INCREMENT=3" part of the CREATE TABLE statement.
</li><li>Issue 486: MySQL compatibility, support the "DEFAULT CHARSET" part of the CREATE TABLE statement.
</li><li>Issue 487: support the MySQL "SET foreign_key_checks = 0" command
</li><li>Issue 490: support MySQL "USING BTREE" index declaration
</li><li>Issue 485: Database get corrupted when column is renamed for which check constraint was defined inside create table statement.
......
......@@ -47,7 +47,8 @@ public class AlterTableRenameColumn extends DefineCommand {
Database db = session.getDatabase();
session.getUser().checkRight(table, Right.ALL);
table.checkSupportAlter();
// we need to update CHECK constraint since it might reference the name of the column
// we need to update CHECK constraint
// since it might reference the name of the column
Expression newCheckExpr = column.getCheckConstraint(session, newName);
table.renameColumn(column, newName);
column.removeCheckConstraint();
......
......@@ -687,6 +687,7 @@ public class DataUtils {
/**
* Create a new IllegalStateException.
*
* @param errorCode the error code
* @param message the message
* @param arguments the arguments
* @return the exception
......
......@@ -1459,7 +1459,8 @@ public class MVStore {
}
/**
* Set the listener to be used for exceptions that occur in the background thread.
* Set the listener to be used for exceptions that occur in the background
* thread.
*
* @param backgroundExceptionListener the listener
*/
......
......@@ -197,7 +197,7 @@ public class MVTableEngine implements TableEngine {
public void initTransactions() {
List<Transaction> list = transactionStore.getOpenTransactions();
for (Transaction t : list) {
if (t.getStatus() == Transaction.STATUS_COMITTING) {
if (t.getStatus() == Transaction.STATUS_COMMITTING) {
t.commit();
} else if (t.getStatus() != Transaction.STATUS_PREPARED) {
t.rollback();
......
......@@ -147,7 +147,7 @@ public class TransactionStore {
if (undoLog.containsKey(key)) {
status = Transaction.STATUS_OPEN;
} else {
status = Transaction.STATUS_COMITTING;
status = Transaction.STATUS_COMMITTING;
}
name = null;
} else {
......@@ -239,7 +239,7 @@ public class TransactionStore {
return;
}
synchronized (undoLog) {
t.setStatus(Transaction.STATUS_COMITTING);
t.setStatus(Transaction.STATUS_COMMITTING);
for (long logId = 0; logId < maxLogId; logId++) {
commitIfNeeded();
long[] undoKey = new long[] { t.getId(), logId };
......@@ -504,7 +504,7 @@ public class TransactionStore {
* closed while the transaction is committing. When opening a store,
* such transactions should be committed.
*/
public static final int STATUS_COMITTING = 3;
public static final int STATUS_COMMITTING = 3;
/**
* The operation type for changes in a map.
......
......@@ -8,6 +8,7 @@ package org.h2.mvstore.rtree;
import java.util.ArrayList;
import java.util.Iterator;
import org.h2.mvstore.CursorPos;
import org.h2.mvstore.DataUtils;
import org.h2.mvstore.MVMap;
......@@ -61,7 +62,7 @@ public class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
* @param x the rectangle
* @return the iterator
*/
public Iterator<SpatialKey> findIntersectingKeys(SpatialKey x) {
public RTreeCursor findIntersectingKeys(SpatialKey x) {
checkOpen();
return new RTreeCursor(root, x) {
@Override
......@@ -77,7 +78,7 @@ public class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
* @param x the rectangle
* @return the iterator
*/
public Iterator<SpatialKey> findContainedKeys(SpatialKey x) {
public RTreeCursor findContainedKeys(SpatialKey x) {
checkOpen();
return new RTreeCursor(root, x) {
@Override
......@@ -506,6 +507,12 @@ public class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
return current != null;
}
/**
* Skip over that many entries. This method is relatively fast (for this map
* implementation) even if many entries need to be skipped.
*
* @param n the number of entries to skip
*/
public void skip(long n) {
while (hasNext() && n-- > 0) {
fetchNext();
......
......@@ -153,7 +153,8 @@ public class ResultTempTable implements ResultExternal {
}
try {
Database database = session.getDatabase();
// Need to lock because not all of the code-paths that reach here have already taken this lock,
// Need to lock because not all of the code-paths
// that reach here have already taken this lock,
// notably via the close() paths.
synchronized (session) {
synchronized (database) {
......
......@@ -244,6 +244,12 @@ public class LobStorageBackend implements LobStorageInterface {
}
}
/**
* Create a prepared statement, or re-use an existing one.
*
* @param sql the SQL statement
* @return the prepared statement
*/
PreparedStatement prepare(String sql) throws SQLException {
if (SysProperties.CHECK2) {
if (!Thread.holdsLock(database)) {
......@@ -257,6 +263,12 @@ public class LobStorageBackend implements LobStorageInterface {
return prep;
}
/**
* Allow to re-use the prepared statement.
*
* @param sql the SQL statement
* @param prep the prepared statement
*/
void reuse(String sql, PreparedStatement prep) {
if (SysProperties.CHECK2) {
if (!Thread.holdsLock(database)) {
......
......@@ -563,6 +563,9 @@ public class Column {
checkConstraintSQL = getCheckConstraintSQL(session, name);
}
/**
* Remove the check constraint if there is one.
*/
public void removeCheckConstraint() {
checkConstraint = null;
checkConstraintSQL = null;
......
......@@ -211,9 +211,10 @@ public class SourceCompiler {
ByteArrayOutputStream buff = new ByteArrayOutputStream();
try {
ProcessBuilder builder = new ProcessBuilder();
// The javac executable allows some of it's flags to be smuggled in via environment variables.
// But if it sees those flags, it will write out a message to stderr, which messes up our
// parsing of the output.
// The javac executable allows some of it's flags
// to be smuggled in via environment variables.
// But if it sees those flags, it will write out a message
// to stderr, which messes up our parsing of the output.
builder.environment().remove("JAVA_TOOL_OPTIONS");
builder.command(args);
......
......@@ -1474,4 +1474,4 @@ public class TestLob extends TestBase {
conn.close();
}
}
}
......@@ -83,7 +83,7 @@ public class TestTableEngines extends TestBase {
assertEquals("param2", EndlessTableEngine.createTableData.tableEngineParams.get(1));
conn.close();
if (!config.memory) {
// Test serialisation of table parameters
// Test serialization of table parameters
EndlessTableEngine.createTableData.tableEngineParams.clear();
conn = getConnection("tableEngine");
assertEquals(2, EndlessTableEngine.createTableData.tableEngineParams.size());
......
......@@ -67,6 +67,12 @@ public class FreeSpaceList {
"Could not find a free page to allocate");
}
/**
* Mark the space as in use.
*
* @param pos the position in bytes
* @param length the number of bytes
*/
public synchronized void markUsed(long pos, int length) {
int start = (int) (pos / blockSize);
int required = getBlockCount(length);
......@@ -112,6 +118,12 @@ public class FreeSpaceList {
}
}
/**
* Mark the space as free.
*
* @param pos the position in bytes
* @param length the number of bytes
*/
public synchronized void free(long pos, int length) {
int start = (int) (pos / blockSize);
int required = getBlockCount(length);
......
......@@ -74,6 +74,12 @@ public class FreeSpaceTree {
return pos;
}
/**
* Mark the space as in use.
*
* @param pos the position in bytes
* @param length the number of bytes
*/
public synchronized void markUsed(long pos, int length) {
int start = getBlock(pos);
int blocks = getBlockCount(length);
......@@ -104,6 +110,12 @@ public class FreeSpaceTree {
}
}
/**
* Mark the space as free.
*
* @param pos the position in bytes
* @param length the number of bytes
*/
public synchronized void free(long pos, int length) {
int start = getBlock(pos);
int blocks = getBlockCount(length);
......
......@@ -106,7 +106,7 @@ public class TestTransactionStore extends TestBase {
List<Transaction> list = ts.getOpenTransactions();
if (list.size() != 0) {
tx = list.get(0);
if (tx.getStatus() == Transaction.STATUS_COMITTING) {
if (tx.getStatus() == Transaction.STATUS_COMMITTING) {
i++;
}
}
......
......@@ -730,7 +730,6 @@ customizers retains scalability assuming gili cancelled departments juerg
franklin indicated offending unimplemented executors dumping variants
presence spiess azeckoski aaron cowwoc decompiles canceling vividsolutions
quadtree envelope geometry polygon typname intersects wkt intersects wkb
coordinate geometric rates cope attempting sphere hyde clinton
computation varies
coordinate geometric rates cope attempting sphere hyde clinton taskkill
mgcodeact cumer reach notably computation varies smuggled stderr sees messes
nico devel
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论