Skip to content

Commit

Permalink
0002334: create triggers should take into account that the catalog or…
Browse files Browse the repository at this point in the history
… schema could be blank in database versus null
  • Loading branch information
chenson42 committed Jun 26, 2015
1 parent 091627e commit 7bce3a5
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -246,8 +246,8 @@ protected String castDatetimeColumnToString(String columnName) {
}

protected String getSourceTablePrefix(Table table) {
String prefix = (table.getSchema() != null ? table.getSchema() + symmetricDialect.getPlatform().getDatabaseInfo().getSchemaSeparator() : "");
prefix = (table.getCatalog() != null ? table.getCatalog() + symmetricDialect.getPlatform().getDatabaseInfo().getCatalogSeparator() : "") + prefix;
String prefix = (isNotBlank(table.getSchema()) ? table.getSchema() + symmetricDialect.getPlatform().getDatabaseInfo().getSchemaSeparator() : "");
prefix = (isNotBlank(table.getCatalog()) ? table.getCatalog() + symmetricDialect.getPlatform().getDatabaseInfo().getCatalogSeparator() : "") + prefix;
if (isBlank(prefix)) {
prefix = (isNotBlank(symmetricDialect.getPlatform().getDefaultSchema()) ? SymmetricUtils
.quote(symmetricDialect, symmetricDialect.getPlatform().getDefaultSchema())
Expand All @@ -260,9 +260,9 @@ protected String getSourceTablePrefix(Table table) {
}

protected String getSourceTablePrefix(TriggerHistory triggerHistory) {
String prefix = (triggerHistory.getSourceSchemaName() != null ? SymmetricUtils.quote(
String prefix = (isNotBlank(triggerHistory.getSourceSchemaName()) ? SymmetricUtils.quote(
symmetricDialect, triggerHistory.getSourceSchemaName()) + symmetricDialect.getPlatform().getDatabaseInfo().getSchemaSeparator() : "");
prefix = (triggerHistory.getSourceCatalogName() != null ? SymmetricUtils.quote(
prefix = (isNotBlank(triggerHistory.getSourceCatalogName()) ? SymmetricUtils.quote(
symmetricDialect, triggerHistory.getSourceCatalogName()) + symmetricDialect.getPlatform().getDatabaseInfo().getCatalogSeparator() : "")
+ prefix;
if (isBlank(prefix)) {
Expand Down

0 comments on commit 7bce3a5

Please sign in to comment.