提交 a629fbfe authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Address review comments

上级 41a53786
......@@ -404,7 +404,7 @@ public class Constants {
/**
* The identity of INFORMATION_SCHEMA.
*/
public static final int META_SCHEMA_ID = -1;
public static final int INFORMATION_SCHEMA_ID = -1;
/**
* The identity of PUBLIC schema.
......
......@@ -791,7 +791,7 @@ public class Database implements DataHandler {
systemUser = new User(this, 0, SYSTEM_USER_NAME, true);
mainSchema = new Schema(this, Constants.MAIN_SCHEMA_ID, sysIdentifier(Constants.SCHEMA_MAIN), systemUser,
true);
infoSchema = new Schema(this, Constants.META_SCHEMA_ID, sysIdentifier("INFORMATION_SCHEMA"), systemUser,
infoSchema = new Schema(this, Constants.INFORMATION_SCHEMA_ID, sysIdentifier("INFORMATION_SCHEMA"), systemUser,
true);
schemas.put(mainSchema.getName(), mainSchema);
schemas.put(infoSchema.getName(), infoSchema);
......@@ -2772,7 +2772,7 @@ public class Database implements DataHandler {
continue;
}
// exclude the LOB_MAP that the Recover tool creates
if (table.getSchema().getId() == Constants.META_SCHEMA_ID
if (table.getSchema().getId() == Constants.INFORMATION_SCHEMA_ID
&& table.getName().equalsIgnoreCase("LOB_BLOCKS")) {
continue;
}
......@@ -3088,9 +3088,24 @@ public class Database implements DataHandler {
* @return identifier in upper or lower case
*/
public String sysIdentifier(String upperName) {
assert isUpperSysIdentifier(upperName);
return dbSettings.databaseToLower ? StringUtils.toLowerEnglish(upperName) : upperName;
}
private static boolean isUpperSysIdentifier(String upperName) {
int l = upperName.length();
if (l == 0) {
return false;
}
for (int i = 0; i < l; i++) {
int ch = upperName.charAt(i);
if (ch < 'A' || ch > 'Z' && ch != '_') {
return false;
}
}
return true;
}
@Override
public int readLob(long lobId, byte[] hmac, long offset, byte[] buff,
int off, int length) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论