Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1109 - add 'default' value for table attribute type in schema.xml #1110

Merged
merged 2 commits into from
Apr 10, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ private void mergeFkERMap(SchemaConfig schemaConfig) {
erRelations.putAll(schemaFkERMap);
}


private Map<String, TableConfig> loadTables(Element node, boolean isLowerCaseNames) {
// supprot [`] BEN GONG in table name
Map<String, TableConfig> tables = new TableConfigMap();
Expand All @@ -242,10 +241,14 @@ private Map<String, TableConfig> loadTables(Element node, boolean isLowerCaseNam
TableTypeEnum tableType = TableTypeEnum.TYPE_SHARDING_TABLE;
if (tableElement.hasAttribute("type")) {
String tableTypeStr = tableElement.getAttribute("type");
if ("global".equalsIgnoreCase(tableTypeStr)) {
tableType = TableTypeEnum.TYPE_GLOBAL_TABLE;
} else {
problemReporter.warn("Table[" + tableElement.getAttribute("name") + "] attribute type " + tableTypeStr + " in schema.xml is illegal, use sharding replaced");
switch (tableTypeStr.toLowerCase()) {
case "global":
tableType = TableTypeEnum.TYPE_GLOBAL_TABLE;
break;
case "default":
break;
default:
problemReporter.warn("Table[" + tableElement.getAttribute("name") + "] attribute type value '" + tableTypeStr + "' in schema.xml is illegal, use default replaced");
}
}
//dataNode of table
Expand Down