提交 02b57fc3 authored 作者: noelgrandin's avatar noelgrandin

rename the newly introduced UNDO_LOG_SIZE column to CONTAINS_UNCOMMITTED,…

rename the newly introduced UNDO_LOG_SIZE column to CONTAINS_UNCOMMITTED, because that is more reliable than the size of the undo log
上级 6138986f
......@@ -41,7 +41,7 @@ Change Log
engines on a per-DB basis.
</li><li>When running the Recover tool on very large (>6G) databases, some statistics were reported with
negative numbers.
</li><li>Add an UNDO_LOG_SIZE column to the SESSIONS metadata table, to allow detecting when rogue
</li><li>Add a CONTAINS_UNCOMMITTED column to the SESSIONS metadata table, to allow detecting when rogue
sessions are creating large transactions.
</li><li>Some small fixes to the GEOMETRY support, patches by Nicolas Fortin.
</li></ul>
......
......@@ -841,7 +841,7 @@ public class Session extends SessionWithState {
firstUncommittedPos = Session.LOG_WRITTEN;
}
private boolean containsUncommitted() {
public boolean containsUncommitted() {
return firstUncommittedLog != Session.LOG_WRITTEN;
}
......@@ -1382,10 +1382,6 @@ public class Session extends SessionWithState {
closeTemporaryResults();
}
public int getUndoLogSize() {
return undoLog.size();
}
/**
* Represents a savepoint (a position in a transaction to where one can roll
* back to).
......
......@@ -489,7 +489,7 @@ public class MetaTable extends Table {
"SESSION_START",
"STATEMENT",
"STATEMENT_START",
"UNDO_LOG_SIZE"
"CONTAINS_UNCOMMITTED"
);
break;
}
......@@ -1549,8 +1549,8 @@ public class MetaTable extends Table {
command == null ? null : command.toString(),
// STATEMENT_START
new Timestamp(start).toString(),
// UNDO_LOG_SIZE
"" + s.getUndoLogSize()
// CONTAINS_UNCOMMITTED
"" + s.containsUncommitted()
);
}
}
......
......@@ -981,14 +981,14 @@ public class TestMetaData extends TestBase {
for (int i = 0; i < 6; i++) {
stat.execute("insert into test values (1)");
}
ResultSet rs = stat.executeQuery("select undo_log_size from INFORMATION_SCHEMA.SESSIONS");
ResultSet rs = stat.executeQuery("select contains_uncommitted from INFORMATION_SCHEMA.SESSIONS");
rs.next();
assertEquals(6, rs.getInt(1));
assertEquals(true, rs.getBoolean(1));
rs.close();
stat.execute("commit");
rs = stat.executeQuery("select undo_log_size from INFORMATION_SCHEMA.SESSIONS");
rs = stat.executeQuery("select contains_uncommitted from INFORMATION_SCHEMA.SESSIONS");
rs.next();
assertEquals(0, rs.getInt(1));
assertEquals(false, rs.getBoolean(1));
conn.close();
deleteDb("metaData");
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论