提交 41a53786 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Fix NPE in Session() in PageStore mode

上级 bd0bd5d1
......@@ -168,7 +168,6 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
*/
private BitSet idsToRelease;
public Session(Database database, User user, int id) {
this.database = database;
this.queryTimeout = database.getSettings().maxQueryTimeout;
......@@ -176,7 +175,10 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
this.user = user;
this.id = id;
this.lockTimeout = database.getLockTimeout();
this.currentSchemaName = database.getMainSchema().getName();
// PageStore creates a system session before initialization of the main schema
Schema mainSchema = database.getMainSchema();
this.currentSchemaName = mainSchema != null ? mainSchema.getName()
: database.sysIdentifier(Constants.SCHEMA_MAIN);
this.columnNamerConfiguration = ColumnNamerConfiguration.getDefault();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论