提交 5e8cba1e authored 作者: Thomas Mueller's avatar Thomas Mueller

The SQL statement "shutdown defag" could corrupt the database if the process was…

The SQL statement "shutdown defag" could corrupt the database if the process was killed while the shutdown was in progress. The same problem could occur when the database setting "defrag_always" was used.
上级 afecfba0
......@@ -510,6 +510,7 @@ public class PageStore implements CacheWriter {
}
}
if (isDefrag) {
log.checkpoint();
writeBack();
cache.clear();
ArrayList<Table> tables = database.getAllTablesAndViews(false);
......@@ -538,6 +539,8 @@ public class PageStore implements CacheWriter {
int target = MIN_PAGE_COUNT - 1;
int temp = 0;
for (int i = 0, size = recordedPagesList.size(); i < size; i++) {
log.checkpoint();
writeBack();
int source = recordedPagesList.get(i);
Page pageSource = getPage(source);
if (!pageSource.canMove()) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论