提交 9a083a0a authored 作者: noelgrandin's avatar noelgrandin

variable naming - improve and make consistent

上级 53e07a08
......@@ -106,14 +106,14 @@ public class Analyze extends DefineCommand {
if (manual) {
db.update(session, table);
} else {
Session s = db.getSystemSession();
if (s != session) {
Session sysSession = db.getSystemSession();
if (sysSession != session) {
// if the current session is the system session
// (which is the case if we are within a trigger)
// then we can't update the statistics because
// that would unlock all locked objects
db.update(s, table);
s.commit(true);
db.update(sysSession, table);
sysSession.commit(true);
}
}
}
......
......@@ -64,8 +64,8 @@ public class TriggerObject extends SchemaObjectBase {
return;
}
try {
Session session = database.getSystemSession();
Connection c2 = session.createConnection(false);
Session sysSession = database.getSystemSession();
Connection c2 = sysSession.createConnection(false);
Object obj = Utils.loadUserClass(triggerClassName).newInstance();
triggerCallback = (Trigger) obj;
triggerCallback.init(c2, getSchema().getName(), getName(), table.getName(), before, typeMask);
......
......@@ -545,17 +545,17 @@ public class PageStore implements CacheWriter {
recordedPagesList = New.arrayList();
recordedPagesIndex = new IntIntHashMap();
recordPageReads = true;
Session s = database.getSystemSession();
Session sysSession = database.getSystemSession();
for (Table table : tables) {
if (!table.isTemporary() && Table.TABLE.equals(table.getTableType())) {
Index scanIndex = table.getScanIndex(s);
Cursor cursor = scanIndex.find(s, null, null);
Index scanIndex = table.getScanIndex(sysSession);
Cursor cursor = scanIndex.find(sysSession, null, null);
while (cursor.next()) {
cursor.get();
}
for (Index index : table.getIndexes()) {
if (index != scanIndex && index.canScan()) {
cursor = index.find(s, null, null);
cursor = index.find(sysSession, null, null);
while (cursor.next()) {
// the data is already read
}
......
......@@ -109,9 +109,9 @@ public class RecoverTester implements Recorder {
ConnectionInfo ci = new ConnectionInfo("jdbc:h2:" + testDatabase + ";FILE_LOCK=NO;TRACE_LEVEL_FILE=0", p);
Database database = new Database(ci, null);
// close the database
Session session = database.getSystemSession();
session.prepare("script to '" + testDatabase + ".sql'").query(0);
session.prepare("shutdown immediately").update();
Session sysSession = database.getSystemSession();
sysSession.prepare("script to '" + testDatabase + ".sql'").query(0);
sysSession.prepare("shutdown immediately").update();
database.removeSession(null);
// everything OK - return
return;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论