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

Page store: the recover tool sometimes generated a script file that contained duplicate data.

上级 2f5474c0
...@@ -353,7 +353,7 @@ public class Recover extends Tool implements DataHandler { ...@@ -353,7 +353,7 @@ public class Recover extends Tool implements DataHandler {
writer.println("-- ERROR: " + error + " block: " + block + " blockCount: " + blockCount + " storageId: " writer.println("-- ERROR: " + error + " block: " + block + " blockCount: " + blockCount + " storageId: "
+ storageId + " recordLength: " + recordLength + " valueId: " + valueId); + storageId + " recordLength: " + recordLength + " valueId: " + valueId);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int i = 0; i < dumpBlocks * DiskFile.BLOCK_SIZE; i++) { for (int i = 0; i < data.length && i < dumpBlocks * DiskFile.BLOCK_SIZE; i++) {
int x = data[i] & 0xff; int x = data[i] & 0xff;
if (x >= ' ' && x < 128) { if (x >= ' ' && x < 128) {
sb.append((char) x); sb.append((char) x);
...@@ -363,7 +363,7 @@ public class Recover extends Tool implements DataHandler { ...@@ -363,7 +363,7 @@ public class Recover extends Tool implements DataHandler {
} }
writer.println("-- dump: " + sb.toString()); writer.println("-- dump: " + sb.toString());
sb = new StringBuilder(); sb = new StringBuilder();
for (int i = 0; i < dumpBlocks * DiskFile.BLOCK_SIZE; i++) { for (int i = 0; i < data.length && i < dumpBlocks * DiskFile.BLOCK_SIZE; i++) {
int x = data[i] & 0xff; int x = data[i] & 0xff;
sb.append(' '); sb.append(' ');
if (x < 16) { if (x < 16) {
...@@ -918,11 +918,10 @@ public class Recover extends Tool implements DataHandler { ...@@ -918,11 +918,10 @@ public class Recover extends Tool implements DataHandler {
pageTypeCount[type]++; pageTypeCount[type]++;
int parentPageId = s.readInt(); int parentPageId = s.readInt();
setStorage(s.readVarInt()); setStorage(s.readVarInt());
// row count int rowCount = s.readInt();
s.readInt();
int entries = s.readShortInt(); int entries = s.readShortInt();
writer.println("-- page " + page + ": data node " + (last ? "(last)" : "") + " parent: " + parentPageId + writer.println("-- page " + page + ": data node " + (last ? "(last)" : "") + " parent: " + parentPageId +
" entries: " + entries); " entries: " + entries + " rowCount: " + rowCount);
dumpPageDataNode(writer, s, page, entries); dumpPageDataNode(writer, s, page, entries);
break; break;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论