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

--no commit message

--no commit message
上级 21b02e28
......@@ -1103,14 +1103,16 @@ public class Database implements DataHandler {
pageStore.compact(compactFully);
}
} catch (DbException e) {
if (e.getErrorCode() != ErrorCode.DATABASE_IS_CLOSED){
// e.printStackTrace();
// TODO don't ignore exceptions
if (e.getErrorCode() != ErrorCode.DATABASE_IS_CLOSED) {
if (SysProperties.CHECK2) {
e.printStackTrace();
}
}
traceSystem.getTrace(Trace.DATABASE).error("close", e);
} catch (Throwable t){
// e.printStackTrace();
// TODO don't ignore exceptions
} catch (Throwable t) {
if (SysProperties.CHECK2) {
t.printStackTrace();
}
traceSystem.getTrace(Trace.DATABASE).error("close", t);
}
}
......
......@@ -21,7 +21,11 @@ import org.h2.value.Value;
*/
public class HashIndex extends BaseIndex {
/**
* The index of the indexed column.
*/
protected final int indexColumn;
private final TableData tableData;
private ValueHashMap<Long> rows;
......@@ -85,15 +89,6 @@ public class HashIndex extends BaseIndex {
// nothing to do
}
/**
* Generate the search key from a row. Only single column indexes are
* supported (multi-column indexes could be mapped to an value array, but
* that is much slower than using a tree based index).
*
* @param row the row
* @return the value
*/
public double getCost(Session session, int[] masks) {
for (Column column : columns) {
int index = column.getColumnId();
......
......@@ -11,16 +11,15 @@ package org.h2.store;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Date;
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import org.h2.constant.ErrorCode;
import org.h2.constant.SysProperties;
import org.h2.engine.Constants;
import org.h2.message.DbException;
import org.h2.util.Utils;
import org.h2.util.DateTimeUtils;
import org.h2.util.MathUtils;
import org.h2.util.Utils;
import org.h2.value.Value;
import org.h2.value.ValueArray;
import org.h2.value.ValueBoolean;
......@@ -53,6 +52,7 @@ public class Data {
*/
public static final int LENGTH_INT = 4;
private static final boolean TEST = false;
private static final int TEST_OFFSET = 0;
/**
......@@ -355,7 +355,7 @@ public class Data {
*/
public void writeValue(Value v) {
int start = pos;
if (TEST_OFFSET > 0) {
if (TEST) {
pos += TEST_OFFSET;
}
if (v == ValueNull.INSTANCE) {
......@@ -562,8 +562,8 @@ public class Data {
* @return the value
*/
public Value readValue() {
if (TEST_OFFSET > 0) {
pos+=TEST_OFFSET;
if (TEST) {
pos += TEST_OFFSET;
}
int type = data[pos++] & 255;
switch (type) {
......
......@@ -22,10 +22,8 @@ public class ValueHashMap<V> extends HashBase {
private V[] values;
/**
* Create a new value hash map using the given data handler.
* The data handler is used to compare values.
* Create a new value hash map.
*
* @param handler the data handler
* @return the object
*/
public static <T> ValueHashMap<T> newInstance() {
......
......@@ -291,6 +291,7 @@ java org.h2.test.TestAll timer
System.setProperty("h2.check2", "true");
/*
maybe remove ValueHashMap
test recovery of large pages and transaction log
test recovery with 'trace' mode (btree data)
test runscript with setCheckResults, execute, process, setShowResults
......
......@@ -42,8 +42,8 @@ public class TestRecovery extends TestBase {
stat.execute("create table test as select * from system_range(1, 100)");
stat.execute("create table a(id int primary key) as select * from system_range(1, 100)");
stat.execute("create table b(id int references a(id)) as select * from system_range(1, 100)");
stat.execute("create table c(d clob) as select space(10000) || 'end'");
stat.execute("create table d(d varchar) as select space(10000) || 'end'");
stat.execute("create table c(d clob) as select space(10000) || 'end'");
stat.execute("create table d(d varchar) as select space(10000) || 'end'");
stat.execute("alter table a add foreign key(id) references b(id)");
// all rows have the same value - so that SCRIPT can't re-order the rows
stat.execute("create table e(id varchar) as select space(10) from system_range(1, 1000)");
......
......@@ -634,4 +634,4 @@ profiles superinterfaces conventions brace indentations increments
explicitconstructorcall switchstatements members parens alignment declarations
jdt continuation codegen parenthesized tabulation ellipsis imple inits guardian
postfix iconified deiconified deactivated activated worker frequent utilities
workers appender recovers
workers appender recovers balanced
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论