提交 8166e699 authored 作者: Thomas Mueller's avatar Thomas Mueller

Remove unused code.

上级 2eebcdd2
......@@ -234,10 +234,9 @@ abstract class PageData extends Page {
}
public boolean canRemove() {
int test;
// if (changeCount >= index.getPageStore().getChangeCount()) {
// return false;
// }
if (changeCount >= index.getPageStore().getChangeCount()) {
return false;
}
return true;
}
......
......@@ -204,7 +204,7 @@ public class PageDataIndex extends PageIndex {
if (p instanceof PageDataOverflow) {
return (PageDataOverflow) p;
}
throw DbException.get(ErrorCode.FILE_CORRUPTED_1, p.toString());
throw DbException.get(ErrorCode.FILE_CORRUPTED_1, p == null ? "null" : p.toString());
}
/**
......
......@@ -155,18 +155,7 @@ public class PageFreeList extends Page {
data.readShortInt();
for (int i = 0; i < pageCount; i += 8) {
int x = data.readByte() & 255;
int test;
used.setByte(i, x);
// for (int j = 0; j < 8; j++) {
// if ((x & (1 << j)) != 0) {
// if (!used.get(i + j)) {
// System.out.println("??");
// }
// used.set(i + j);
// } else if (used.get(i+j)) {
// System.out.println("??");
// }
// }
}
full = false;
}
......@@ -176,14 +165,6 @@ public class PageFreeList extends Page {
data.writeByte((byte) Page.TYPE_FREE_LIST);
data.writeShortInt(0);
for (int i = 0; i < pageCount; i += 8) {
int tst;
// int x = 0;
// for (int j = 0; j < 8; j++) {
// if (used.get(i + j)) {
// x += 1 << j;
// }
// }
// data.writeByte((byte) x);
data.writeByte((byte) used.getByte(i));
}
store.writePage(getPos(), data);
......
......@@ -468,7 +468,7 @@ public class PageStore implements CacheWriter {
boolean isCompactFully = compactMode == CommandInterface.SHUTDOWN_COMPACT;
boolean isDefrag = compactMode == CommandInterface.SHUTDOWN_DEFRAG;
int test;
int testWithReopen;
// isCompactFully = isDefrag = true;
int maxCompactTime = SysProperties.MAX_COMPACT_TIME;
......@@ -492,10 +492,10 @@ public class PageStore implements CacheWriter {
if (compact(full, firstFree)) {
j++;
long now = System.currentTimeMillis();
// if (now > start + maxCompactTime) {
// j = maxMove;
// break;
// }
if (now > start + maxCompactTime) {
j = maxMove;
break;
}
}
}
}
......@@ -1584,6 +1584,11 @@ public class PageStore implements CacheWriter {
metaRootPageId.put(id, rootPageId);
if (type == META_TYPE_DATA_INDEX) {
CreateTableData data = new CreateTableData();
if (SysProperties.CHECK) {
if (columns == null) {
throw DbException.throwInternalError(row.toString());
}
}
for (int i = 0; i < columns.length; i++) {
Column col = new Column("C" + i, Value.INT);
data.columns.add(col);
......
......@@ -168,11 +168,9 @@ public class CacheLRU implements Cache {
}
}
if (changed.size() > 0) {
int fixMaybeReplacesChangeCount;
if (!flushed) {
writer.flushLog();
}
Collections.sort(changed);
int max = maxMemory;
try {
......
......@@ -552,7 +552,9 @@ public class TestCases extends TestBase {
}
time = System.currentTimeMillis() - time;
if (time > 5000) {
fail("closing took " + time);
if (!config.record) {
fail("closing took " + time);
}
}
deleteDb("cases");
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论